cmd: autopkgtest --apt-upgrade --output-dir=artifact-dir --summary=artifact-dir/summary --no-built-binaries --needs-internet=run --copy=/etc/resolv.conf:/etc/resolv.conf /tmp/debusine-fetch-exec-upload-8nu7f5qq/python-click-doc_8.2.0-1_all.deb /tmp/debusine-fetch-exec-upload-8nu7f5qq/python-inline-snapshot-doc_0.19.3-1_all.deb /tmp/debusine-fetch-exec-upload-8nu7f5qq/python3-click_8.2.0-1_all.deb /tmp/debusine-fetch-exec-upload-8nu7f5qq/python3-inline-snapshot_0.19.3-1_all.deb /tmp/debusine-fetch-exec-upload-8nu7f5qq/python-inline-snapshot_0.19.3-1.dsc -- unshare --arch amd64 --release sid --tarball /var/lib/debusine/worker/system-images/1140235/system.tar.xz output (contains stdout and stderr): autopkgtest [16:02:26]: starting date and time: 2025-01-17 16:02:26+0000 autopkgtest [16:02:26]: version 5.38~bpo12+1 autopkgtest [16:02:26]: host debusine-worker-amd64-hades-05; command line: /usr/bin/autopkgtest --apt-upgrade --output-dir=artifact-dir --summary=artifact-dir/summary --no-built-binaries --needs-internet=run --copy=/etc/resolv.conf:/etc/resolv.conf /tmp/debusine-fetch-exec-upload-8nu7f5qq/python-click-doc_8.2.0-1_all.deb /tmp/debusine-fetch-exec-upload-8nu7f5qq/python-inline-snapshot-doc_0.19.3-1_all.deb /tmp/debusine-fetch-exec-upload-8nu7f5qq/python3-click_8.2.0-1_all.deb /tmp/debusine-fetch-exec-upload-8nu7f5qq/python3-inline-snapshot_0.19.3-1_all.deb /tmp/debusine-fetch-exec-upload-8nu7f5qq/python-inline-snapshot_0.19.3-1.dsc -- unshare --arch amd64 --release sid --tarball /var/lib/debusine/worker/system-images/1140235/system.tar.xz autopkgtest [16:02:31]: testbed dpkg architecture: amd64 autopkgtest [16:02:31]: testbed apt version: 2.9.20 autopkgtest [16:02:31]: @@@@@@@@@@@@@@@@@@@@ test bed setup Get:1 http://deb.debian.org/debian sid InRelease [205 kB] Get:2 http://deb.debian.org/debian sid/main amd64 Packages [10.0 MB] Get:3 http://deb.debian.org/debian sid/main Translation-en [7324 kB] Get:4 http://deb.debian.org/debian sid/main amd64 Components [5045 kB] Fetched 22.6 MB in 2s (9716 kB/s) Reading package lists... Reading package lists... Building dependency tree... Reading state information... Calculating upgrade... The following package was automatically installed and is no longer required: libldap-2.5-0 Use 'apt autoremove' to remove it. The following NEW packages will be installed: libldap-common libldap2 libtext-charwidth-perl libtext-wrapi18n-perl The following packages will be upgraded: apt base-passwd binutils binutils-common binutils-x86-64-linux-gnu bsdextrautils bsdutils dash diffutils dpkg dpkg-dev e2fsprogs gcc-14-base gettext gettext-base gpg gpgconf gzip init-system-helpers libapt-pkg6.0t64 libatomic1 libaudit1 libbinutils libblkid1 libc-bin libc6 libcgi-pm-perl libcom-err2 libcpanel-json-xs-perl libcrypt1 libctf-nobfd0 libctf0 libcurl3t64-gnutls libdebconfclient0 libdpkg-perl libext2fs2t64 libgcc-s1 libglib2.0-0t64 libgomp1 libgprofng0 libgssapi-krb5-2 libhtml-parser-perl libicu72 libk5crypto3 libkrb5-3 libkrb5support0 liblz1 liblz4-1 libmount1 libsasl2-2 libsasl2-modules-db libsframe1 libsmartcols1 libss2 libssl3t64 libstdc++6 libsystemd0 libtext-markdown-discount-perl libudev1 libuuid1 libxs-parse-keyword-perl libxxhash0 libzstd1 login logsave mount openssl openssl-provider-legacy sysvinit-utils tzdata ucf util-linux 72 upgraded, 4 newly installed, 0 to remove and 0 not upgraded. Need to get 41.7 MB of archives. After this operation, 1324 kB of additional disk space will be used. Get:1 http://deb.debian.org/debian sid/main amd64 bsdutils amd64 1:2.40.4-1 [106 kB] Get:2 http://deb.debian.org/debian sid/main amd64 dash amd64 0.5.12-11 [95.5 kB] Get:3 http://deb.debian.org/debian sid/main amd64 diffutils amd64 1:3.10-2 [384 kB] Get:4 http://deb.debian.org/debian sid/main amd64 libatomic1 amd64 14.2.0-14 [9288 B] Get:5 http://deb.debian.org/debian sid/main amd64 libgomp1 amd64 14.2.0-14 [137 kB] Get:6 http://deb.debian.org/debian sid/main amd64 gcc-14-base amd64 14.2.0-14 [48.6 kB] Get:7 http://deb.debian.org/debian sid/main amd64 libgcc-s1 amd64 14.2.0-14 [72.7 kB] Get:8 http://deb.debian.org/debian sid/main amd64 libstdc++6 amd64 14.2.0-14 [713 kB] Get:9 http://deb.debian.org/debian sid/main amd64 libc6 amd64 2.40-5 [2810 kB] Get:10 http://deb.debian.org/debian sid/main amd64 libxxhash0 amd64 0.8.3-2 [27.1 kB] Get:11 http://deb.debian.org/debian sid/main amd64 liblz4-1 amd64 1.9.4-4 [60.1 kB] Get:12 http://deb.debian.org/debian sid/main amd64 openssl-provider-legacy amd64 3.4.0-2 [301 kB] Get:13 http://deb.debian.org/debian sid/main amd64 libzstd1 amd64 1.5.6+dfsg-2 [300 kB] Get:14 http://deb.debian.org/debian sid/main amd64 libssl3t64 amd64 3.4.0-2 [2302 kB] Get:15 http://deb.debian.org/debian sid/main amd64 libsystemd0 amd64 257.2-2 [450 kB] Get:16 http://deb.debian.org/debian sid/main amd64 libudev1 amd64 257.2-2 [148 kB] Get:17 http://deb.debian.org/debian sid/main amd64 libapt-pkg6.0t64 amd64 2.9.22 [1115 kB] Get:18 http://deb.debian.org/debian sid/main amd64 dpkg amd64 1.22.14 [1537 kB] Get:19 http://deb.debian.org/debian sid/main amd64 gzip amd64 1.13-1 [138 kB] Get:20 http://deb.debian.org/debian sid/main amd64 bsdextrautils amd64 2.40.4-1 [92.2 kB] Get:21 http://deb.debian.org/debian sid/main amd64 libblkid1 amd64 2.40.4-1 [169 kB] Get:22 http://deb.debian.org/debian sid/main amd64 libmount1 amd64 2.40.4-1 [200 kB] Get:23 http://deb.debian.org/debian sid/main amd64 libsmartcols1 amd64 2.40.4-1 [140 kB] Get:24 http://deb.debian.org/debian sid/main amd64 mount amd64 2.40.4-1 [155 kB] Get:25 http://deb.debian.org/debian sid/main amd64 libuuid1 amd64 2.40.4-1 [36.2 kB] Get:26 http://deb.debian.org/debian sid/main amd64 util-linux amd64 2.40.4-1 [1213 kB] Get:27 http://deb.debian.org/debian sid/main amd64 libdebconfclient0 amd64 0.277 [10.4 kB] Get:28 http://deb.debian.org/debian sid/main amd64 base-passwd amd64 3.6.6 [53.1 kB] Get:29 http://deb.debian.org/debian sid/main amd64 apt amd64 2.9.22 [1382 kB] Get:30 http://deb.debian.org/debian sid/main amd64 init-system-helpers all 1.68 [38.7 kB] Get:31 http://deb.debian.org/debian sid/main amd64 libc-bin amd64 2.40-5 [627 kB] Get:32 http://deb.debian.org/debian sid/main amd64 sysvinit-utils amd64 3.13-1 [33.2 kB] Get:33 http://deb.debian.org/debian sid/main amd64 logsave amd64 1.47.2-1 [23.9 kB] Get:34 http://deb.debian.org/debian sid/main amd64 libext2fs2t64 amd64 1.47.2-1 [212 kB] Get:35 http://deb.debian.org/debian sid/main amd64 e2fsprogs amd64 1.47.2-1 [590 kB] Get:36 http://deb.debian.org/debian sid/main amd64 libaudit1 amd64 1:4.0.2-2+b1 [55.2 kB] Get:37 http://deb.debian.org/debian sid/main amd64 libcrypt1 amd64 1:4.4.38-1 [90.1 kB] Get:38 http://deb.debian.org/debian sid/main amd64 login amd64 1:4.16.0-2+really2.40.4-1 [88.4 kB] Get:39 http://deb.debian.org/debian sid/main amd64 tzdata all 2024b-6 [257 kB] Get:40 http://deb.debian.org/debian sid/main amd64 gettext-base amd64 0.23.1-1 [243 kB] Get:41 http://deb.debian.org/debian sid/main amd64 libtext-charwidth-perl amd64 0.04-11+b4 [9476 B] Get:42 http://deb.debian.org/debian sid/main amd64 libtext-wrapi18n-perl all 0.06-10 [8808 B] Get:43 http://deb.debian.org/debian sid/main amd64 ucf all 3.0048 [42.0 kB] Get:44 http://deb.debian.org/debian sid/main amd64 libgprofng0 amd64 2.43.50.20250108-1 [807 kB] Get:45 http://deb.debian.org/debian sid/main amd64 libctf0 amd64 2.43.50.20250108-1 [88.4 kB] Get:46 http://deb.debian.org/debian sid/main amd64 libctf-nobfd0 amd64 2.43.50.20250108-1 [155 kB] Get:47 http://deb.debian.org/debian sid/main amd64 binutils-x86-64-linux-gnu amd64 2.43.50.20250108-1 [2277 kB] Get:48 http://deb.debian.org/debian sid/main amd64 libbinutils amd64 2.43.50.20250108-1 [532 kB] Get:49 http://deb.debian.org/debian sid/main amd64 binutils amd64 2.43.50.20250108-1 [68.5 kB] Get:50 http://deb.debian.org/debian sid/main amd64 binutils-common amd64 2.43.50.20250108-1 [2628 kB] Get:51 http://deb.debian.org/debian sid/main amd64 libsframe1 amd64 2.43.50.20250108-1 [77.7 kB] Get:52 http://deb.debian.org/debian sid/main amd64 dpkg-dev all 1.22.14 [1334 kB] Get:53 http://deb.debian.org/debian sid/main amd64 libdpkg-perl all 1.22.14 [646 kB] Get:54 http://deb.debian.org/debian sid/main amd64 gettext amd64 0.23.1-1 [1680 kB] Get:55 http://deb.debian.org/debian sid/main amd64 gpg amd64 2.2.46-1+b1 [532 kB] Get:56 http://deb.debian.org/debian sid/main amd64 gpgconf amd64 2.2.46-1+b1 [121 kB] Get:57 http://deb.debian.org/debian sid/main amd64 libhtml-parser-perl amd64 3.83-1+b2 [99.7 kB] Get:58 http://deb.debian.org/debian sid/main amd64 libcgi-pm-perl all 4.67-1 [217 kB] Get:59 http://deb.debian.org/debian sid/main amd64 libcom-err2 amd64 1.47.2-1 [24.0 kB] Get:60 http://deb.debian.org/debian sid/main amd64 libcpanel-json-xs-perl amd64 4.39-1 [130 kB] Get:61 http://deb.debian.org/debian sid/main amd64 libgssapi-krb5-2 amd64 1.21.3-4 [138 kB] Get:62 http://deb.debian.org/debian sid/main amd64 libkrb5-3 amd64 1.21.3-4 [326 kB] Get:63 http://deb.debian.org/debian sid/main amd64 libkrb5support0 amd64 1.21.3-4 [32.8 kB] Get:64 http://deb.debian.org/debian sid/main amd64 libk5crypto3 amd64 1.21.3-4 [80.9 kB] Get:65 http://deb.debian.org/debian sid/main amd64 libsasl2-modules-db amd64 2.1.28+dfsg1-8+b1 [19.9 kB] Get:66 http://deb.debian.org/debian sid/main amd64 libsasl2-2 amd64 2.1.28+dfsg1-8+b1 [57.6 kB] Get:67 http://deb.debian.org/debian sid/main amd64 libldap2 amd64 2.6.9+dfsg-1 [192 kB] Get:68 http://deb.debian.org/debian sid/main amd64 libcurl3t64-gnutls amd64 8.11.1-1+b1 [360 kB] Get:69 http://deb.debian.org/debian sid/main amd64 libglib2.0-0t64 amd64 2.82.4-2 [1502 kB] Get:70 http://deb.debian.org/debian sid/main amd64 libicu72 amd64 72.1-6 [9421 kB] Get:71 http://deb.debian.org/debian sid/main amd64 libldap-common all 2.6.9+dfsg-1 [34.5 kB] Get:72 http://deb.debian.org/debian sid/main amd64 liblz1 amd64 1.15-1 [38.9 kB] Get:73 http://deb.debian.org/debian sid/main amd64 libss2 amd64 1.47.2-1 [28.7 kB] Get:74 http://deb.debian.org/debian sid/main amd64 libtext-markdown-discount-perl amd64 0.17-1 [12.9 kB] Get:75 http://deb.debian.org/debian sid/main amd64 libxs-parse-keyword-perl amd64 0.48-1 [65.6 kB] Get:76 http://deb.debian.org/debian sid/main amd64 openssl amd64 3.4.0-2 [1422 kB] Preconfiguring packages ... Fetched 41.7 MB in 0s (98.7 MB/s) (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 ... 17038 files and directories currently installed.) Preparing to unpack .../bsdutils_1%3a2.40.4-1_amd64.deb ... Unpacking bsdutils (1:2.40.4-1) over (1:2.40.2-13) ... Setting up bsdutils (1:2.40.4-1) ... (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 ... 17038 files and directories currently installed.) Preparing to unpack .../dash_0.5.12-11_amd64.deb ... Unpacking dash (0.5.12-11) over (0.5.12-9) ... Setting up dash (0.5.12-11) ... (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 ... 17038 files and directories currently installed.) Preparing to unpack .../diffutils_1%3a3.10-2_amd64.deb ... Unpacking diffutils (1:3.10-2) over (1:3.10-1) ... Setting up diffutils (1:3.10-2) ... (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 ... 17038 files and directories currently installed.) Preparing to unpack .../libatomic1_14.2.0-14_amd64.deb ... Unpacking libatomic1:amd64 (14.2.0-14) over (14.2.0-11) ... Preparing to unpack .../libgomp1_14.2.0-14_amd64.deb ... Unpacking libgomp1:amd64 (14.2.0-14) over (14.2.0-11) ... Preparing to unpack .../gcc-14-base_14.2.0-14_amd64.deb ... Unpacking gcc-14-base:amd64 (14.2.0-14) over (14.2.0-11) ... Setting up gcc-14-base:amd64 (14.2.0-14) ... (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 ... 17038 files and directories currently installed.) Preparing to unpack .../libgcc-s1_14.2.0-14_amd64.deb ... Unpacking libgcc-s1:amd64 (14.2.0-14) over (14.2.0-11) ... Setting up libgcc-s1:amd64 (14.2.0-14) ... (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 ... 17038 files and directories currently installed.) Preparing to unpack .../libstdc++6_14.2.0-14_amd64.deb ... Unpacking libstdc++6:amd64 (14.2.0-14) over (14.2.0-11) ... Setting up libstdc++6:amd64 (14.2.0-14) ... (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 ... 17038 files and directories currently installed.) Preparing to unpack .../libc6_2.40-5_amd64.deb ... Unpacking libc6:amd64 (2.40-5) over (2.40-4) ... Setting up libc6:amd64 (2.40-5) ... (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 ... 17038 files and directories currently installed.) Preparing to unpack .../libxxhash0_0.8.3-2_amd64.deb ... Unpacking libxxhash0:amd64 (0.8.3-2) over (0.8.2-2+b2) ... Setting up libxxhash0:amd64 (0.8.3-2) ... (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 ... 17037 files and directories currently installed.) Preparing to unpack .../liblz4-1_1.9.4-4_amd64.deb ... Unpacking liblz4-1:amd64 (1.9.4-4) over (1.9.4-3+b1) ... Setting up liblz4-1:amd64 (1.9.4-4) ... (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 ... 17036 files and directories currently installed.) Preparing to unpack .../openssl-provider-legacy_3.4.0-2_amd64.deb ... Unpacking openssl-provider-legacy (3.4.0-2) over (3.3.2-2) ... Setting up openssl-provider-legacy (3.4.0-2) ... (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 ... 17036 files and directories currently installed.) Preparing to unpack .../libzstd1_1.5.6+dfsg-2_amd64.deb ... Unpacking libzstd1:amd64 (1.5.6+dfsg-2) over (1.5.6+dfsg-1+b1) ... Setting up libzstd1:amd64 (1.5.6+dfsg-2) ... (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 ... 17035 files and directories currently installed.) Preparing to unpack .../libssl3t64_3.4.0-2_amd64.deb ... Unpacking libssl3t64:amd64 (3.4.0-2) over (3.3.2-2) ... Setting up libssl3t64:amd64 (3.4.0-2) ... (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 ... 17035 files and directories currently installed.) Preparing to unpack .../libsystemd0_257.2-2_amd64.deb ... Unpacking libsystemd0:amd64 (257.2-2) over (257.1-5) ... Setting up libsystemd0:amd64 (257.2-2) ... (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 ... 17035 files and directories currently installed.) Preparing to unpack .../libudev1_257.2-2_amd64.deb ... Unpacking libudev1:amd64 (257.2-2) over (257.1-5) ... Setting up libudev1:amd64 (257.2-2) ... (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 ... 17035 files and directories currently installed.) Preparing to unpack .../libapt-pkg6.0t64_2.9.22_amd64.deb ... Unpacking libapt-pkg6.0t64:amd64 (2.9.22) over (2.9.20) ... Setting up libapt-pkg6.0t64:amd64 (2.9.22) ... (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 ... 17035 files and directories currently installed.) Preparing to unpack .../dpkg_1.22.14_amd64.deb ... Unpacking dpkg (1.22.14) over (1.22.11) ... Setting up dpkg (1.22.14) ... (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 ... 17034 files and directories currently installed.) Preparing to unpack .../archives/gzip_1.13-1_amd64.deb ... Unpacking gzip (1.13-1) over (1.12-1.2) ... Setting up gzip (1.13-1) ... (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 ... 17034 files and directories currently installed.) Preparing to unpack .../bsdextrautils_2.40.4-1_amd64.deb ... Unpacking bsdextrautils (2.40.4-1) over (2.40.2-13) ... Preparing to unpack .../libblkid1_2.40.4-1_amd64.deb ... Unpacking libblkid1:amd64 (2.40.4-1) over (2.40.2-13) ... Setting up libblkid1:amd64 (2.40.4-1) ... (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 ... 17034 files and directories currently installed.) Preparing to unpack .../libmount1_2.40.4-1_amd64.deb ... Unpacking libmount1:amd64 (2.40.4-1) over (2.40.2-13) ... Setting up libmount1:amd64 (2.40.4-1) ... (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 ... 17034 files and directories currently installed.) Preparing to unpack .../libsmartcols1_2.40.4-1_amd64.deb ... Unpacking libsmartcols1:amd64 (2.40.4-1) over (2.40.2-13) ... Setting up libsmartcols1:amd64 (2.40.4-1) ... (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 ... 17034 files and directories currently installed.) Preparing to unpack .../mount_2.40.4-1_amd64.deb ... Unpacking mount (2.40.4-1) over (2.40.2-13) ... Preparing to unpack .../libuuid1_2.40.4-1_amd64.deb ... Unpacking libuuid1:amd64 (2.40.4-1) over (2.40.2-13) ... Setting up libuuid1:amd64 (2.40.4-1) ... (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 ... 17034 files and directories currently installed.) Preparing to unpack .../util-linux_2.40.4-1_amd64.deb ... Unpacking util-linux (2.40.4-1) over (2.40.2-13) ... Setting up util-linux (2.40.4-1) ... (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 ... 17036 files and directories currently installed.) Preparing to unpack .../libdebconfclient0_0.277_amd64.deb ... Unpacking libdebconfclient0:amd64 (0.277) over (0.276) ... Setting up libdebconfclient0:amd64 (0.277) ... (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 ... 17036 files and directories currently installed.) Preparing to unpack .../base-passwd_3.6.6_amd64.deb ... Unpacking base-passwd (3.6.6) over (3.6.5) ... Setting up base-passwd (3.6.6) ... (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 ... 17036 files and directories currently installed.) Preparing to unpack .../archives/apt_2.9.22_amd64.deb ... Unpacking apt (2.9.22) over (2.9.20) ... Setting up apt (2.9.22) ... (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 ... 17036 files and directories currently installed.) Preparing to unpack .../init-system-helpers_1.68_all.deb ... Unpacking init-system-helpers (1.68) over (1.67) ... Setting up init-system-helpers (1.68) ... (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 ... 17036 files and directories currently installed.) Preparing to unpack .../libc-bin_2.40-5_amd64.deb ... Unpacking libc-bin (2.40-5) over (2.40-4) ... Setting up libc-bin (2.40-5) ... (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 ... 17036 files and directories currently installed.) Preparing to unpack .../sysvinit-utils_3.13-1_amd64.deb ... Unpacking sysvinit-utils (3.13-1) over (3.11-1) ... Setting up sysvinit-utils (3.13-1) ... (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 ... 17036 files and directories currently installed.) Preparing to unpack .../logsave_1.47.2-1_amd64.deb ... Unpacking logsave (1.47.2-1) over (1.47.2~rc1-2) ... Preparing to unpack .../libext2fs2t64_1.47.2-1_amd64.deb ... Leaving 'diversion of /lib/x86_64-linux-gnu/libe2p.so.2 to /lib/x86_64-linux-gnu/libe2p.so.2.usr-is-merged by libext2fs2t64' Leaving 'diversion of /lib/x86_64-linux-gnu/libe2p.so.2.3 to /lib/x86_64-linux-gnu/libe2p.so.2.3.usr-is-merged by libext2fs2t64' Leaving 'diversion of /lib/x86_64-linux-gnu/libext2fs.so.2 to /lib/x86_64-linux-gnu/libext2fs.so.2.usr-is-merged by libext2fs2t64' Leaving 'diversion of /lib/x86_64-linux-gnu/libext2fs.so.2.4 to /lib/x86_64-linux-gnu/libext2fs.so.2.4.usr-is-merged by libext2fs2t64' Unpacking libext2fs2t64:amd64 (1.47.2-1) over (1.47.2~rc1-2) ... Setting up libext2fs2t64:amd64 (1.47.2-1) ... (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 ... 17036 files and directories currently installed.) Preparing to unpack .../e2fsprogs_1.47.2-1_amd64.deb ... Unpacking e2fsprogs (1.47.2-1) over (1.47.2~rc1-2) ... Preparing to unpack .../libaudit1_1%3a4.0.2-2+b1_amd64.deb ... Unpacking libaudit1:amd64 (1:4.0.2-2+b1) over (1:4.0.2-2) ... Setting up libaudit1:amd64 (1:4.0.2-2+b1) ... (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 ... 17037 files and directories currently installed.) Preparing to unpack .../libcrypt1_1%3a4.4.38-1_amd64.deb ... Unpacking libcrypt1:amd64 (1:4.4.38-1) over (1:4.4.36-5) ... Setting up libcrypt1:amd64 (1:4.4.38-1) ... (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 ... 17037 files and directories currently installed.) Preparing to unpack .../00-login_1%3a4.16.0-2+really2.40.4-1_amd64.deb ... Unpacking login (1:4.16.0-2+really2.40.4-1) over (1:4.16.0-2+really2.40.2-13) ... Preparing to unpack .../01-tzdata_2024b-6_all.deb ... Unpacking tzdata (2024b-6) over (2024b-4) ... Preparing to unpack .../02-gettext-base_0.23.1-1_amd64.deb ... Unpacking gettext-base (0.23.1-1) over (0.22.5-3) ... Selecting previously unselected package libtext-charwidth-perl:amd64. Preparing to unpack .../03-libtext-charwidth-perl_0.04-11+b4_amd64.deb ... Unpacking libtext-charwidth-perl:amd64 (0.04-11+b4) ... Selecting previously unselected package libtext-wrapi18n-perl. Preparing to unpack .../04-libtext-wrapi18n-perl_0.06-10_all.deb ... Unpacking libtext-wrapi18n-perl (0.06-10) ... Preparing to unpack .../05-ucf_3.0048_all.deb ... Unpacking ucf (3.0048) over (3.0046) ... Preparing to unpack .../06-libgprofng0_2.43.50.20250108-1_amd64.deb ... Unpacking libgprofng0:amd64 (2.43.50.20250108-1) over (2.43.50.20241221-1) ... Preparing to unpack .../07-libctf0_2.43.50.20250108-1_amd64.deb ... Unpacking libctf0:amd64 (2.43.50.20250108-1) over (2.43.50.20241221-1) ... Preparing to unpack .../08-libctf-nobfd0_2.43.50.20250108-1_amd64.deb ... Unpacking libctf-nobfd0:amd64 (2.43.50.20250108-1) over (2.43.50.20241221-1) ... Preparing to unpack .../09-binutils-x86-64-linux-gnu_2.43.50.20250108-1_amd64.deb ... Unpacking binutils-x86-64-linux-gnu (2.43.50.20250108-1) over (2.43.50.20241221-1) ... Preparing to unpack .../10-libbinutils_2.43.50.20250108-1_amd64.deb ... Unpacking libbinutils:amd64 (2.43.50.20250108-1) over (2.43.50.20241221-1) ... Preparing to unpack .../11-binutils_2.43.50.20250108-1_amd64.deb ... Unpacking binutils (2.43.50.20250108-1) over (2.43.50.20241221-1) ... Preparing to unpack .../12-binutils-common_2.43.50.20250108-1_amd64.deb ... Unpacking binutils-common:amd64 (2.43.50.20250108-1) over (2.43.50.20241221-1) ... Preparing to unpack .../13-libsframe1_2.43.50.20250108-1_amd64.deb ... Unpacking libsframe1:amd64 (2.43.50.20250108-1) over (2.43.50.20241221-1) ... Preparing to unpack .../14-dpkg-dev_1.22.14_all.deb ... Unpacking dpkg-dev (1.22.14) over (1.22.11) ... Preparing to unpack .../15-libdpkg-perl_1.22.14_all.deb ... Unpacking libdpkg-perl (1.22.14) over (1.22.11) ... Preparing to unpack .../16-gettext_0.23.1-1_amd64.deb ... Unpacking gettext (0.23.1-1) over (0.22.5-3) ... Preparing to unpack .../17-gpg_2.2.46-1+b1_amd64.deb ... Unpacking gpg (2.2.46-1+b1) over (2.2.45-2) ... Preparing to unpack .../18-gpgconf_2.2.46-1+b1_amd64.deb ... Unpacking gpgconf (2.2.46-1+b1) over (2.2.45-2) ... Preparing to unpack .../19-libhtml-parser-perl_3.83-1+b2_amd64.deb ... Unpacking libhtml-parser-perl:amd64 (3.83-1+b2) over (3.83-1+b1) ... Preparing to unpack .../20-libcgi-pm-perl_4.67-1_all.deb ... Unpacking libcgi-pm-perl (4.67-1) over (4.66-1) ... Preparing to unpack .../21-libcom-err2_1.47.2-1_amd64.deb ... Unpacking libcom-err2:amd64 (1.47.2-1) over (1.47.2~rc1-2) ... Preparing to unpack .../22-libcpanel-json-xs-perl_4.39-1_amd64.deb ... Unpacking libcpanel-json-xs-perl:amd64 (4.39-1) over (4.38-1+b1) ... Preparing to unpack .../23-libgssapi-krb5-2_1.21.3-4_amd64.deb ... Unpacking libgssapi-krb5-2:amd64 (1.21.3-4) over (1.21.3-3) ... Preparing to unpack .../24-libkrb5-3_1.21.3-4_amd64.deb ... Unpacking libkrb5-3:amd64 (1.21.3-4) over (1.21.3-3) ... Preparing to unpack .../25-libkrb5support0_1.21.3-4_amd64.deb ... Unpacking libkrb5support0:amd64 (1.21.3-4) over (1.21.3-3) ... Preparing to unpack .../26-libk5crypto3_1.21.3-4_amd64.deb ... Unpacking libk5crypto3:amd64 (1.21.3-4) over (1.21.3-3) ... Preparing to unpack .../27-libsasl2-modules-db_2.1.28+dfsg1-8+b1_amd64.deb ... Unpacking libsasl2-modules-db:amd64 (2.1.28+dfsg1-8+b1) over (2.1.28+dfsg1-8) ... Preparing to unpack .../28-libsasl2-2_2.1.28+dfsg1-8+b1_amd64.deb ... Unpacking libsasl2-2:amd64 (2.1.28+dfsg1-8+b1) over (2.1.28+dfsg1-8) ... Selecting previously unselected package libldap2:amd64. Preparing to unpack .../29-libldap2_2.6.9+dfsg-1_amd64.deb ... Unpacking libldap2:amd64 (2.6.9+dfsg-1) ... Preparing to unpack .../30-libcurl3t64-gnutls_8.11.1-1+b1_amd64.deb ... Unpacking libcurl3t64-gnutls:amd64 (8.11.1-1+b1) over (8.11.1-1) ... Preparing to unpack .../31-libglib2.0-0t64_2.82.4-2_amd64.deb ... Unpacking libglib2.0-0t64:amd64 (2.82.4-2) over (2.82.4-1) ... Preparing to unpack .../32-libicu72_72.1-6_amd64.deb ... Unpacking libicu72:amd64 (72.1-6) over (72.1-5+b1) ... Selecting previously unselected package libldap-common. Preparing to unpack .../33-libldap-common_2.6.9+dfsg-1_all.deb ... Unpacking libldap-common (2.6.9+dfsg-1) ... Preparing to unpack .../34-liblz1_1.15-1_amd64.deb ... Unpacking liblz1:amd64 (1.15-1) over (1.15~rc1-1) ... Preparing to unpack .../35-libss2_1.47.2-1_amd64.deb ... Unpacking libss2:amd64 (1.47.2-1) over (1.47.2~rc1-2) ... Preparing to unpack .../36-libtext-markdown-discount-perl_0.17-1_amd64.deb ... Unpacking libtext-markdown-discount-perl (0.17-1) over (0.16-1+b3) ... Preparing to unpack .../37-libxs-parse-keyword-perl_0.48-1_amd64.deb ... Unpacking libxs-parse-keyword-perl (0.48-1) over (0.47-1) ... Preparing to unpack .../38-openssl_3.4.0-2_amd64.deb ... Unpacking openssl (3.4.0-2) over (3.3.2-2) ... Setting up liblz1:amd64 (1.15-1) ... Setting up libtext-charwidth-perl:amd64 (0.04-11+b4) ... Setting up libicu72:amd64 (72.1-6) ... Setting up bsdextrautils (2.40.4-1) ... Setting up libcpanel-json-xs-perl:amd64 (4.39-1) ... Setting up binutils-common:amd64 (2.43.50.20250108-1) ... Installing new version of config file /etc/gprofng.rc ... Setting up libctf-nobfd0:amd64 (2.43.50.20250108-1) ... Setting up gettext-base (0.23.1-1) ... Setting up libtext-markdown-discount-perl (0.17-1) ... Setting up libcom-err2:amd64 (1.47.2-1) ... Setting up libgomp1:amd64 (14.2.0-14) ... Setting up libldap-common (2.6.9+dfsg-1) ... Setting up libtext-wrapi18n-perl (0.06-10) ... Setting up libsframe1:amd64 (2.43.50.20250108-1) ... Setting up libkrb5support0:amd64 (1.21.3-4) ... Setting up libsasl2-modules-db:amd64 (2.1.28+dfsg1-8+b1) ... Setting up tzdata (2024b-6) ... Current default time zone: 'Etc/UTC' Local time is now: Fri Jan 17 16:02:47 UTC 2025. Universal Time is now: Fri Jan 17 16:02:47 UTC 2025. Run 'dpkg-reconfigure tzdata' if you wish to change it. Setting up libxs-parse-keyword-perl (0.48-1) ... Setting up libatomic1:amd64 (14.2.0-14) ... Setting up libss2:amd64 (1.47.2-1) ... Setting up ucf (3.0048) ... Setting up libk5crypto3:amd64 (1.21.3-4) ... Setting up libdpkg-perl (1.22.14) ... Setting up logsave (1.47.2-1) ... Setting up libsasl2-2:amd64 (2.1.28+dfsg1-8+b1) ... Setting up mount (2.40.4-1) ... Setting up libhtml-parser-perl:amd64 (3.83-1+b2) ... Setting up gpgconf (2.2.46-1+b1) ... Setting up libkrb5-3:amd64 (1.21.3-4) ... Setting up libbinutils:amd64 (2.43.50.20250108-1) ... Setting up openssl (3.4.0-2) ... Setting up libldap2:amd64 (2.6.9+dfsg-1) ... Setting up gpg (2.2.46-1+b1) ... Setting up login (1:4.16.0-2+really2.40.4-1) ... Setting up libctf0:amd64 (2.43.50.20250108-1) ... Setting up gettext (0.23.1-1) ... Setting up libcgi-pm-perl (4.67-1) ... Setting up e2fsprogs (1.47.2-1) ... Setting up libglib2.0-0t64:amd64 (2.82.4-2) ... No schema files found: doing nothing. Setting up libgprofng0:amd64 (2.43.50.20250108-1) ... Setting up libgssapi-krb5-2:amd64 (1.21.3-4) ... Setting up binutils-x86-64-linux-gnu (2.43.50.20250108-1) ... Setting up libcurl3t64-gnutls:amd64 (8.11.1-1+b1) ... Setting up binutils (2.43.50.20250108-1) ... Setting up dpkg-dev (1.22.14) ... Processing triggers for libc-bin (2.40-5) ... Processing triggers for man-db (2.13.0-1) ... Processing triggers for debianutils (5.21) ... Reading package lists... Building dependency tree... Reading state information... The following packages will be REMOVED: libldap-2.5-0* 0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded. After this operation, 578 kB disk space will be freed. (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 ... 17092 files and directories currently installed.) Removing libldap-2.5-0:amd64 (2.5.19+dfsg-1) ... Processing triggers for libc-bin (2.40-5) ... autopkgtest [16:02:50]: testbed running kernel: Linux 6.1.0-29-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.123-1 (2025-01-02) autopkgtest [16:02:50]: @@@@@@@@@@@@@@@@@@@@ source /tmp/debusine-fetch-exec-upload-8nu7f5qq/python-inline-snapshot_0.19.3-1.dsc gpg: Signature made Thu Jan 16 17:58:09 2025 UTC gpg: using RSA key FC875C834BC71FB6546250A86E25BF686AA7D62A gpg: issuer "katharasasikumar007@gmail.com" gpg: Can't check signature: No public key dpkg-source: warning: cannot verify inline signature for /tmp/autopkgtest.ImMzGl/python-inline-snapshot_0.19.3-1.dsc: no acceptable signature found dpkg-source: info: extracting python-inline-snapshot in src dpkg-source: info: unpacking python-inline-snapshot_0.19.3.orig.tar.gz dpkg-source: info: unpacking python-inline-snapshot_0.19.3-1.debian.tar.xz dpkg-source: info: using patch list from debian/patches/series dpkg-source: info: applying docs-Ignore-some-plugins-which-are-not-packaged-yet.patch dpkg-source: info: applying docs-Remove-badge-linking.patch dpkg-source: info: applying docs-Don-t-use-mike-addon-for-MkDocs.patch dpkg-source: info: applying docs-Don-t-build-directory-URLs.patch dpkg-source: info: applying docs-Use-python3-in-example-as-interpreter-call.patch dpkg-source: info: applying docs-Ignore-added-validation-feature.patch dpkg-source: info: applying docs-Removed-link-to-external-graphic.patch autopkgtest [16:02:51]: testing package python-inline-snapshot version 0.19.3-1 autopkgtest [16:02:51]: build not needed autopkgtest [16:02:51]: test upstream-tests: preparing testbed Reading package lists... Building dependency tree... Reading state information... The following NEW packages will be installed: apt-utils 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. Need to get 329 kB of archives. After this operation, 1100 kB of additional disk space will be used. Get:1 http://deb.debian.org/debian sid/main amd64 apt-utils amd64 2.9.22 [329 kB] Fetched 329 kB in 0s (7628 kB/s) Selecting previously unselected package apt-utils. (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 ... 17082 files and directories currently installed.) Preparing to unpack .../apt-utils_2.9.22_amd64.deb ... Unpacking apt-utils (2.9.22) ... Setting up apt-utils (2.9.22) ... Processing triggers for man-db (2.13.0-1) ... Ign:1 file:/tmp/autopkgtest.ImMzGl/binaries InRelease Get:2 file:/tmp/autopkgtest.ImMzGl/binaries Release [816 B] Get:2 file:/tmp/autopkgtest.ImMzGl/binaries Release [816 B] Ign:3 file:/tmp/autopkgtest.ImMzGl/binaries Release.gpg Get:4 file:/tmp/autopkgtest.ImMzGl/binaries Packages [5454 B] Reading package lists... Reading package lists... Building dependency tree... Reading state information... Starting pkgProblemResolver with broken count: 0 Starting 2 pkgProblemResolver with broken count: 0 Done The following NEW packages will be installed: black libexpat1 libnsl2 libpython3-stdlib libpython3.12-minimal libpython3.12-stdlib libpython3.13-minimal libpython3.13-stdlib libtirpc-common libtirpc3t64 media-types python-inline-snapshot-doc python3 python3-all python3-annotated-types python3-asttokens python3-attr python3-click python3-dateutil python3-dirty-equals python3-dnspython python3-email-validator python3-executing python3-freezegun python3-hypothesis python3-idna python3-iniconfig python3-inline-snapshot python3-markdown-it python3-mdurl python3-minimal python3-mypy-extensions python3-packaging python3-pathspec python3-platformdirs python3-pluggy python3-pydantic python3-pydantic-core python3-pygments python3-pytest python3-pytest-freezer python3-pytest-mock python3-pytest-subtests python3-rich python3-sortedcontainers python3-time-machine python3-typing-extensions python3.12 python3.12-minimal python3.13 python3.13-minimal 0 upgraded, 51 newly installed, 0 to remove and 0 not upgraded. Need to get 17.9 MB/18.6 MB of archives. After this operation, 86.8 MB of additional disk space will be used. Get:1 file:/tmp/autopkgtest.ImMzGl/binaries python3-click 8.2.0-1 [98.6 kB] Get:2 file:/tmp/autopkgtest.ImMzGl/binaries python-inline-snapshot-doc 0.19.3-1 [536 kB] Get:3 file:/tmp/autopkgtest.ImMzGl/binaries python3-inline-snapshot 0.19.3-1 [36.5 kB] Get:4 http://deb.debian.org/debian sid/main amd64 libpython3.13-minimal amd64 3.13.1-3 [858 kB] Get:5 http://deb.debian.org/debian sid/main amd64 libexpat1 amd64 2.6.4-1 [106 kB] Get:6 http://deb.debian.org/debian sid/main amd64 python3.13-minimal amd64 3.13.1-3 [2202 kB] Get:7 http://deb.debian.org/debian sid/main amd64 python3-minimal amd64 3.13.1-2 [27.0 kB] Get:8 http://deb.debian.org/debian sid/main amd64 media-types all 10.1.0 [26.9 kB] Get:9 http://deb.debian.org/debian sid/main amd64 libpython3.13-stdlib amd64 3.13.1-3 [1973 kB] Get:10 http://deb.debian.org/debian sid/main amd64 python3.13 amd64 3.13.1-3 [740 kB] Get:11 http://deb.debian.org/debian sid/main amd64 libpython3-stdlib amd64 3.13.1-2 [9952 B] Get:12 http://deb.debian.org/debian sid/main amd64 python3 amd64 3.13.1-2 [28.0 kB] Get:13 http://deb.debian.org/debian sid/main amd64 libpython3.12-minimal amd64 3.12.8-5 [817 kB] Get:14 http://deb.debian.org/debian sid/main amd64 python3.12-minimal amd64 3.12.8-5 [2164 kB] Get:15 http://deb.debian.org/debian sid/main amd64 python3-mypy-extensions all 1.0.0-1 [6064 B] Get:16 http://deb.debian.org/debian sid/main amd64 python3-packaging all 24.2-1 [55.3 kB] Get:17 http://deb.debian.org/debian sid/main amd64 python3-pathspec all 0.12.1-1 [28.1 kB] Get:18 http://deb.debian.org/debian sid/main amd64 python3-platformdirs all 4.3.6-1 [16.6 kB] Get:19 http://deb.debian.org/debian sid/main amd64 python3-typing-extensions all 4.12.2-2 [73.0 kB] Get:20 http://deb.debian.org/debian sid/main amd64 black amd64 24.10.0-3 [1670 kB] Get:21 http://deb.debian.org/debian sid/main amd64 libtirpc-common all 1.3.4+ds-1.3 [10.9 kB] Get:22 http://deb.debian.org/debian sid/main amd64 libtirpc3t64 amd64 1.3.4+ds-1.3+b1 [83.1 kB] Get:23 http://deb.debian.org/debian sid/main amd64 libnsl2 amd64 1.3.0-3+b3 [40.6 kB] Get:24 http://deb.debian.org/debian sid/main amd64 libpython3.12-stdlib amd64 3.12.8-5 [1971 kB] Get:25 http://deb.debian.org/debian sid/main amd64 python3.12 amd64 3.12.8-5 [677 kB] Get:26 http://deb.debian.org/debian sid/main amd64 python3-all amd64 3.13.1-2 [1056 B] Get:27 http://deb.debian.org/debian sid/main amd64 python3-annotated-types all 0.7.0-1 [18.8 kB] Get:28 http://deb.debian.org/debian sid/main amd64 python3-asttokens all 3.0.0-1 [20.1 kB] Get:29 http://deb.debian.org/debian sid/main amd64 python3-attr all 24.3.0-1 [68.8 kB] Get:30 http://deb.debian.org/debian sid/main amd64 python3-dateutil all 2.9.0-3 [79.3 kB] Get:31 http://deb.debian.org/debian sid/main amd64 python3-dirty-equals all 0.9.0-1 [22.8 kB] Get:32 http://deb.debian.org/debian sid/main amd64 python3-dnspython all 2.7.0-1 [164 kB] Get:33 http://deb.debian.org/debian sid/main amd64 python3-idna all 3.8-2 [41.6 kB] Get:34 http://deb.debian.org/debian sid/main amd64 python3-email-validator all 2.2.0-1 [31.6 kB] Get:35 http://deb.debian.org/debian sid/main amd64 python3-executing all 2.1.0-0.1 [23.9 kB] Get:36 http://deb.debian.org/debian sid/main amd64 python3-freezegun all 1.5.1-1.1 [17.1 kB] Get:37 http://deb.debian.org/debian sid/main amd64 python3-sortedcontainers all 2.4.0-2 [31.9 kB] Get:38 http://deb.debian.org/debian sid/main amd64 python3-hypothesis all 6.124.0-1 [330 kB] Get:39 http://deb.debian.org/debian sid/main amd64 python3-iniconfig all 1.1.1-2 [6396 B] Get:40 http://deb.debian.org/debian sid/main amd64 python3-mdurl all 0.1.2-1 [9444 B] Get:41 http://deb.debian.org/debian sid/main amd64 python3-markdown-it all 3.0.0-2 [62.5 kB] Get:42 http://deb.debian.org/debian sid/main amd64 python3-pygments all 2.18.0+dfsg-2 [836 kB] Get:43 http://deb.debian.org/debian sid/main amd64 python3-rich all 13.9.4-1 [203 kB] Get:44 http://deb.debian.org/debian sid/main amd64 python3-pluggy all 1.5.0-1 [26.9 kB] Get:45 http://deb.debian.org/debian sid/main amd64 python3-pydantic-core amd64 2.27.2-1 [1706 kB] Get:46 http://deb.debian.org/debian sid/main amd64 python3-pydantic amd64 2.10.5-1 [346 kB] Get:47 http://deb.debian.org/debian sid/main amd64 python3-pytest all 8.3.4-1 [250 kB] Get:48 http://deb.debian.org/debian sid/main amd64 python3-pytest-freezer all 0.4.9-1 [4544 B] Get:49 http://deb.debian.org/debian sid/main amd64 python3-pytest-mock all 3.14.0-2 [18.3 kB] Get:50 http://deb.debian.org/debian sid/main amd64 python3-pytest-subtests all 0.13.1-1 [11.9 kB] Get:51 http://deb.debian.org/debian sid/main amd64 python3-time-machine amd64 2.16.0-1 [26.4 kB] Fetched 17.9 MB in 0s (45.3 MB/s) Selecting previously unselected package libpython3.13-minimal:amd64. (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 ... 17164 files and directories currently installed.) Preparing to unpack .../libpython3.13-minimal_3.13.1-3_amd64.deb ... Unpacking libpython3.13-minimal:amd64 (3.13.1-3) ... Selecting previously unselected package libexpat1:amd64. Preparing to unpack .../libexpat1_2.6.4-1_amd64.deb ... Unpacking libexpat1:amd64 (2.6.4-1) ... Selecting previously unselected package python3.13-minimal. Preparing to unpack .../python3.13-minimal_3.13.1-3_amd64.deb ... Unpacking python3.13-minimal (3.13.1-3) ... Setting up libpython3.13-minimal:amd64 (3.13.1-3) ... Setting up libexpat1:amd64 (2.6.4-1) ... Setting up python3.13-minimal (3.13.1-3) ... Selecting previously unselected package python3-minimal. (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 ... 17498 files and directories currently installed.) Preparing to unpack .../python3-minimal_3.13.1-2_amd64.deb ... Unpacking python3-minimal (3.13.1-2) ... Selecting previously unselected package media-types. Preparing to unpack .../media-types_10.1.0_all.deb ... Unpacking media-types (10.1.0) ... Selecting previously unselected package libpython3.13-stdlib:amd64. Preparing to unpack .../libpython3.13-stdlib_3.13.1-3_amd64.deb ... Unpacking libpython3.13-stdlib:amd64 (3.13.1-3) ... Selecting previously unselected package python3.13. Preparing to unpack .../python3.13_3.13.1-3_amd64.deb ... Unpacking python3.13 (3.13.1-3) ... Selecting previously unselected package libpython3-stdlib:amd64. Preparing to unpack .../libpython3-stdlib_3.13.1-2_amd64.deb ... Unpacking libpython3-stdlib:amd64 (3.13.1-2) ... Setting up python3-minimal (3.13.1-2) ... Selecting previously unselected package python3. (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 ... 17948 files and directories currently installed.) Preparing to unpack .../00-python3_3.13.1-2_amd64.deb ... Unpacking python3 (3.13.1-2) ... Selecting previously unselected package libpython3.12-minimal:amd64. Preparing to unpack .../01-libpython3.12-minimal_3.12.8-5_amd64.deb ... Unpacking libpython3.12-minimal:amd64 (3.12.8-5) ... Selecting previously unselected package python3.12-minimal. Preparing to unpack .../02-python3.12-minimal_3.12.8-5_amd64.deb ... Unpacking python3.12-minimal (3.12.8-5) ... Selecting previously unselected package python3-click. Preparing to unpack .../03-python3-click.deb ... Unpacking python3-click (8.2.0-1) ... Selecting previously unselected package python3-mypy-extensions. Preparing to unpack .../04-python3-mypy-extensions_1.0.0-1_all.deb ... Unpacking python3-mypy-extensions (1.0.0-1) ... Selecting previously unselected package python3-packaging. Preparing to unpack .../05-python3-packaging_24.2-1_all.deb ... Unpacking python3-packaging (24.2-1) ... Selecting previously unselected package python3-pathspec. Preparing to unpack .../06-python3-pathspec_0.12.1-1_all.deb ... Unpacking python3-pathspec (0.12.1-1) ... Selecting previously unselected package python3-platformdirs. Preparing to unpack .../07-python3-platformdirs_4.3.6-1_all.deb ... Unpacking python3-platformdirs (4.3.6-1) ... Selecting previously unselected package python3-typing-extensions. Preparing to unpack .../08-python3-typing-extensions_4.12.2-2_all.deb ... Unpacking python3-typing-extensions (4.12.2-2) ... Selecting previously unselected package black. Preparing to unpack .../09-black_24.10.0-3_amd64.deb ... Unpacking black (24.10.0-3) ... Selecting previously unselected package libtirpc-common. Preparing to unpack .../10-libtirpc-common_1.3.4+ds-1.3_all.deb ... Unpacking libtirpc-common (1.3.4+ds-1.3) ... Selecting previously unselected package libtirpc3t64:amd64. Preparing to unpack .../11-libtirpc3t64_1.3.4+ds-1.3+b1_amd64.deb ... Adding 'diversion of /lib/x86_64-linux-gnu/libtirpc.so.3 to /lib/x86_64-linux-gnu/libtirpc.so.3.usr-is-merged by libtirpc3t64' Adding 'diversion of /lib/x86_64-linux-gnu/libtirpc.so.3.0.0 to /lib/x86_64-linux-gnu/libtirpc.so.3.0.0.usr-is-merged by libtirpc3t64' Unpacking libtirpc3t64:amd64 (1.3.4+ds-1.3+b1) ... Selecting previously unselected package libnsl2:amd64. Preparing to unpack .../12-libnsl2_1.3.0-3+b3_amd64.deb ... Unpacking libnsl2:amd64 (1.3.0-3+b3) ... Selecting previously unselected package libpython3.12-stdlib:amd64. Preparing to unpack .../13-libpython3.12-stdlib_3.12.8-5_amd64.deb ... Unpacking libpython3.12-stdlib:amd64 (3.12.8-5) ... Selecting previously unselected package python-inline-snapshot-doc. Preparing to unpack .../14-python-inline-snapshot-doc.deb ... Unpacking python-inline-snapshot-doc (0.19.3-1) ... Selecting previously unselected package python3.12. Preparing to unpack .../15-python3.12_3.12.8-5_amd64.deb ... Unpacking python3.12 (3.12.8-5) ... Selecting previously unselected package python3-all. Preparing to unpack .../16-python3-all_3.13.1-2_amd64.deb ... Unpacking python3-all (3.13.1-2) ... Selecting previously unselected package python3-annotated-types. Preparing to unpack .../17-python3-annotated-types_0.7.0-1_all.deb ... Unpacking python3-annotated-types (0.7.0-1) ... Selecting previously unselected package python3-asttokens. Preparing to unpack .../18-python3-asttokens_3.0.0-1_all.deb ... Unpacking python3-asttokens (3.0.0-1) ... Selecting previously unselected package python3-attr. Preparing to unpack .../19-python3-attr_24.3.0-1_all.deb ... Unpacking python3-attr (24.3.0-1) ... Selecting previously unselected package python3-dateutil. Preparing to unpack .../20-python3-dateutil_2.9.0-3_all.deb ... Unpacking python3-dateutil (2.9.0-3) ... Selecting previously unselected package python3-dirty-equals. Preparing to unpack .../21-python3-dirty-equals_0.9.0-1_all.deb ... Unpacking python3-dirty-equals (0.9.0-1) ... Selecting previously unselected package python3-dnspython. Preparing to unpack .../22-python3-dnspython_2.7.0-1_all.deb ... Unpacking python3-dnspython (2.7.0-1) ... Selecting previously unselected package python3-idna. Preparing to unpack .../23-python3-idna_3.8-2_all.deb ... Unpacking python3-idna (3.8-2) ... Selecting previously unselected package python3-email-validator. Preparing to unpack .../24-python3-email-validator_2.2.0-1_all.deb ... Unpacking python3-email-validator (2.2.0-1) ... Selecting previously unselected package python3-executing. Preparing to unpack .../25-python3-executing_2.1.0-0.1_all.deb ... Unpacking python3-executing (2.1.0-0.1) ... Selecting previously unselected package python3-freezegun. Preparing to unpack .../26-python3-freezegun_1.5.1-1.1_all.deb ... Unpacking python3-freezegun (1.5.1-1.1) ... Selecting previously unselected package python3-sortedcontainers. Preparing to unpack .../27-python3-sortedcontainers_2.4.0-2_all.deb ... Unpacking python3-sortedcontainers (2.4.0-2) ... Selecting previously unselected package python3-hypothesis. Preparing to unpack .../28-python3-hypothesis_6.124.0-1_all.deb ... Unpacking python3-hypothesis (6.124.0-1) ... Selecting previously unselected package python3-iniconfig. Preparing to unpack .../29-python3-iniconfig_1.1.1-2_all.deb ... Unpacking python3-iniconfig (1.1.1-2) ... Selecting previously unselected package python3-mdurl. Preparing to unpack .../30-python3-mdurl_0.1.2-1_all.deb ... Unpacking python3-mdurl (0.1.2-1) ... Selecting previously unselected package python3-markdown-it. Preparing to unpack .../31-python3-markdown-it_3.0.0-2_all.deb ... Unpacking python3-markdown-it (3.0.0-2) ... Selecting previously unselected package python3-pygments. Preparing to unpack .../32-python3-pygments_2.18.0+dfsg-2_all.deb ... Unpacking python3-pygments (2.18.0+dfsg-2) ... Selecting previously unselected package python3-rich. Preparing to unpack .../33-python3-rich_13.9.4-1_all.deb ... Unpacking python3-rich (13.9.4-1) ... Selecting previously unselected package python3-inline-snapshot. Preparing to unpack .../34-python3-inline-snapshot.deb ... Unpacking python3-inline-snapshot (0.19.3-1) ... Selecting previously unselected package python3-pluggy. Preparing to unpack .../35-python3-pluggy_1.5.0-1_all.deb ... Unpacking python3-pluggy (1.5.0-1) ... Selecting previously unselected package python3-pydantic-core. Preparing to unpack .../36-python3-pydantic-core_2.27.2-1_amd64.deb ... Unpacking python3-pydantic-core (2.27.2-1) ... Selecting previously unselected package python3-pydantic. Preparing to unpack .../37-python3-pydantic_2.10.5-1_amd64.deb ... Unpacking python3-pydantic (2.10.5-1) ... Selecting previously unselected package python3-pytest. Preparing to unpack .../38-python3-pytest_8.3.4-1_all.deb ... Unpacking python3-pytest (8.3.4-1) ... Selecting previously unselected package python3-pytest-freezer. Preparing to unpack .../39-python3-pytest-freezer_0.4.9-1_all.deb ... Unpacking python3-pytest-freezer (0.4.9-1) ... Selecting previously unselected package python3-pytest-mock. Preparing to unpack .../40-python3-pytest-mock_3.14.0-2_all.deb ... Unpacking python3-pytest-mock (3.14.0-2) ... Selecting previously unselected package python3-pytest-subtests. Preparing to unpack .../41-python3-pytest-subtests_0.13.1-1_all.deb ... Unpacking python3-pytest-subtests (0.13.1-1) ... Selecting previously unselected package python3-time-machine. Preparing to unpack .../42-python3-time-machine_2.16.0-1_amd64.deb ... Unpacking python3-time-machine (2.16.0-1) ... Setting up media-types (10.1.0) ... Setting up libtirpc-common (1.3.4+ds-1.3) ... Setting up libpython3.12-minimal:amd64 (3.12.8-5) ... Setting up python-inline-snapshot-doc (0.19.3-1) ... Setting up libpython3.13-stdlib:amd64 (3.13.1-3) ... Setting up libpython3-stdlib:amd64 (3.13.1-2) ... Setting up python3.12-minimal (3.12.8-5) ... Setting up libtirpc3t64:amd64 (1.3.4+ds-1.3+b1) ... Setting up python3.13 (3.13.1-3) ... Setting up python3 (3.13.1-2) ... Setting up python3-sortedcontainers (2.4.0-2) ... Setting up python3-click (8.2.0-1) ... Setting up python3-annotated-types (0.7.0-1) ... Setting up python3-platformdirs (4.3.6-1) ... Setting up python3-pygments (2.18.0+dfsg-2) ... Setting up python3-packaging (24.2-1) ... Setting up python3-mdurl (0.1.2-1) ... Setting up python3-idna (3.8-2) ... Setting up python3-typing-extensions (4.12.2-2) ... Setting up python3-pluggy (1.5.0-1) ... Setting up python3-markdown-it (3.0.0-2) ... Setting up python3-dnspython (2.7.0-1) ... Setting up libnsl2:amd64 (1.3.0-3+b3) ... Setting up python3-dateutil (2.9.0-3) ... Setting up python3-email-validator (2.2.0-1) ... Setting up python3-pathspec (0.12.1-1) ... Setting up python3-freezegun (1.5.1-1.1) ... Setting up python3-iniconfig (1.1.1-2) ... Setting up python3-attr (24.3.0-1) ... Setting up python3-pydantic-core (2.27.2-1) ... Setting up libpython3.12-stdlib:amd64 (3.12.8-5) ... Setting up python3-rich (13.9.4-1) ... Setting up python3-asttokens (3.0.0-1) ... Setting up python3-pytest (8.3.4-1) ... Setting up python3-mypy-extensions (1.0.0-1) ... Setting up python3.12 (3.12.8-5) ... Setting up python3-hypothesis (6.124.0-1) ... Setting up python3-dirty-equals (0.9.0-1) ... Setting up python3-all (3.13.1-2) ... Setting up black (24.10.0-3) ... Setting up python3-time-machine (2.16.0-1) ... Setting up python3-executing (2.1.0-0.1) ... Setting up python3-pydantic (2.10.5-1) ... Setting up python3-pytest-freezer (0.4.9-1) ... Setting up python3-pytest-mock (3.14.0-2) ... Setting up python3-pytest-subtests (0.13.1-1) ... Setting up python3-inline-snapshot (0.19.3-1) ... Processing triggers for man-db (2.13.0-1) ... Processing triggers for libc-bin (2.40-5) ... autopkgtest [16:03:12]: test upstream-tests: [----------------------- *************************** *** Testing with python3.12 *************************** Content of current working folder: total 12 drwxr-xr-x 3 unshare unshare 4096 Jan 17 16:03 . drwxrwxrwt 6 root root 4096 Jan 17 16:03 .. drwxrwxr-x 3 unshare unshare 4096 Jan 15 18:43 tests Running tests... ============================= test session starts ============================== platform linux -- Python 3.12.8, pytest-8.3.4, pluggy-1.5.0 rootdir: /tmp/autopkgtest.ImMzGl/autopkgtest_tmp plugins: inline-snapshot-0.19.3, mock-3.14.0, hypothesis-6.124.0, time-machine-2.16.0, subtests-0.13.1, pytest_freezer-0.4.9 collected 392 items / 10 deselected / 382 selected tests/adapter/test_dataclass.py FFFFEFE.FF.F.FEFEFEFF [ 4%] tests/adapter/test_dict.py F [ 4%] tests/adapter/test_general.py F. [ 4%] tests/adapter/test_sequence.py FF..F [ 6%] tests/test_align.py . [ 6%] tests/test_change.py F [ 6%] tests/test_code_repr.py FF.FFFF.............................F [ 16%] tests/test_config.py FEFEFEFE [ 17%] tests/test_dirty_equals.py xF..F [ 18%] tests/test_docs.py .s [ 19%] tests/test_example.py FE [ 19%] tests/test_external.py F..FFFFFFF..FFFF [ 23%] tests/test_formating.py FF.. [ 24%] tests/test_fstring.py .. [ 25%] tests/test_hasrepr.py . [ 25%] tests/test_inline_snapshot.py ..uuuuuuuuuuuuuuuuuuuuuuuuuuuuuu.,,,,,,,,, [ 26%] ,,,,,,,,,,,,,,,,,,,,,.FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF [ 39%] FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF,,.,,.,,,.,,.,,., [ 55%] ,.,,,.,,.,,.,,.,,,.,,.,,.,,.,,.,,.,,.,,,.,,.,,.,,.,,,.,,.,,.,,.,,,.,,.,, [ 61%] .,,.,,.,,,.,,.,,.,,.,,,.,,.,,.,,.,,,.,,.,,.,,.,,,.,,.,,.,,.,,,.,,.,,.,,. [ 67%] ,,.,,.,,.,,,.,,.,,.,,.,,,.,,.,,.,,.,,.,,.,,,.,,.,,.,,.,,,.,,.,,.,,.,,.,, [ 73%] ,.,,.,,.,,.,,,.,,.,,.,,.,,,.,,.,,.,,.,,.,,.,,.,,,.,,.,,.,,.,,.,,.,,,.,,. [ 79%] ,,.,,.,,.,,,.,,.,,.,,.,,.,,.,,.FFFFFFF...FF.FFFF..F [ 86%] tests/test_is.py F [ 87%] tests/test_is_normalized.py F [ 87%] tests/test_preserve_values.py FFFFFFFFFFuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu [ 90%] uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu,uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu [ 90%] uuuuuuuuuuuuuuuuuuuuuuu,uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu [ 90%] uuuuuuuuuuuuuuu,. [ 90%] tests/test_pydantic.py FEFEFE.FE [ 91%] tests/test_pypy.py F [ 91%] tests/test_pytest_plugin.py .FFFFF.FFFFF.F.FFF..FFFE [ 97%] tests/test_raises.py . [ 98%] tests/test_rewrite_code.py .F [ 98%] tests/test_string.py FFF. [ 99%] tests/test_warns.py . [100%] ==================================== ERRORS ==================================== ________________ ERROR at teardown of test_attrs_default_value _________________ some snapshots in this test have incorrect values. ----------------------------- Captured stdout call ----------------------------- file: test_something.py from inline_snapshot import snapshot,Is import attrs @attrs.define class A: a:int b:int=2 c:list=attrs.field(factory=list) d:int=attrs.field(default=attrs.Factory(lambda self:self.a+10,takes_self=True)) def test_something(): assert A(a=1) == snapshot(A(a=1,b=2,c=[],d=11)) assert A(a=2,b=3) == snapshot(A(a=1,b=2,c=[],d=11)) run> /usr/bin/python3.12 -m pytest --inline-snapshot=fix stdout: ============================= test session starts ============================== platform linux -- Python 3.12.8, pytest-8.3.4, pluggy-1.5.0 rootdir: /tmp/tmppfdewdp3 plugins: inline-snapshot-0.19.3, mock-3.14.0, hypothesis-6.124.0, time-machine-2.16.0, subtests-0.13.1, pytest_freezer-0.4.9 collected 1 item test_something.py F [100%] =================================== FAILURES =================================== ________________________________ test_something ________________________________ def test_something(): assert A(a=1) == snapshot(A(a=1,b=2,c=[],d=11)) > assert A(a=2,b=3) == snapshot(A(a=1,b=2,c=[],d=11)) test_something.py:13: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/generic_call_adapter.py:194: in assign result_kwargs[key] = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '2 ', filename = PosixPath('/tmp/tmppfdewdp3/test_something.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError =============================== inline snapshot ================================ =========================== short test summary info ============================ FAILED test_something.py::test_something - TypeError: CliRunner.__init__() go... ============================== 1 failed in 0.13s =============================== stderr: __________________ ERROR at teardown of test_attrs_field_repr __________________ some snapshots in this test have incorrect values. ----------------------------- Captured stdout call ----------------------------- file: test_something.py from inline_snapshot import snapshot import attrs @attrs.define class container: a: int b: int = attrs.field(default=5,repr=False) assert container(a=1,b=5) == snapshot() run> /usr/bin/python3.12 -m pytest --inline-snapshot=create stdout: ============================= test session starts ============================== platform linux -- Python 3.12.8, pytest-8.3.4, pluggy-1.5.0 rootdir: /tmp/tmpuztrgk7u plugins: inline-snapshot-0.19.3, mock-3.14.0, hypothesis-6.124.0, time-machine-2.16.0, subtests-0.13.1, pytest_freezer-0.4.9 collected 0 items / 1 error ==================================== ERRORS ==================================== ______________________ ERROR collecting test_something.py ______________________ test_something.py:9: in assert container(a=1,b=5) == snapshot() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: in format_code runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' =============================== inline snapshot ================================ =========================== short test summary info ============================ ERROR test_something.py - TypeError: CliRunner.__init__() got an unexpected k... !!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!! =============================== 1 error in 0.17s =============================== stderr: _____________ ERROR at teardown of test_remove_positional_argument _____________ some snapshots in this test have incorrect values. ----------------------------- Captured stdout call ----------------------------- file: test_something.py from inline_snapshot import snapshot from inline_snapshot._adapter.generic_call_adapter import GenericCallAdapter,Argument class L: def __init__(self,*l): self.l=l def __eq__(self,other): if not isinstance(other,L): return NotImplemented return other.l==self.l class LAdapter(GenericCallAdapter): @classmethod def check_type(cls, typ): return issubclass(typ,L) @classmethod def arguments(cls, value): return ([Argument(x) for x in value.l],{}) @classmethod def argument(cls, value, pos_or_name): assert isinstance(pos_or_name,int) return value.l[pos_or_name] def test_L1(): assert L(1,2) == snapshot(L(1)), "not equal" def test_L2(): assert L(1,2) == snapshot(L(1, 2, 3)), "not equal" run> /usr/bin/python3.12 -m pytest --inline-snapshot=fix stdout: ============================= test session starts ============================== platform linux -- Python 3.12.8, pytest-8.3.4, pluggy-1.5.0 rootdir: /tmp/tmpdx3quyv3 plugins: inline-snapshot-0.19.3, mock-3.14.0, hypothesis-6.124.0, time-machine-2.16.0, subtests-0.13.1, pytest_freezer-0.4.9 collected 2 items test_something.py F. [100%] =================================== FAILURES =================================== ___________________________________ test_L1 ____________________________________ def test_L1(): > assert L(1,2) == snapshot(L(1)), "not equal" test_something.py:30: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/generic_call_adapter.py:162: in assign new_code=self.context.file._value_to_code(value.value), /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code return self._token_to_code(value_to_token(value)) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '2 ', filename = PosixPath('/tmp/tmpdx3quyv3/test_something.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError =============================== inline snapshot ================================ ──────────────────────────────── Fix snapshots ───────────────────────────────── =========================== short test summary info ============================ FAILED test_something.py::test_L1 - TypeError: CliRunner.__init__() got an un... stderr: Traceback (most recent call last): File "", line 198, in _run_module_as_main File "", line 88, in _run_code File "/usr/lib/python3/dist-packages/pytest/__main__.py", line 9, in raise SystemExit(pytest.console_main()) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 201, in console_main code = main() ^^^^^^ File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 175, in main ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec return self._inner_hookexec(hook_name, methods, kwargs, firstresult) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall raise exception.with_traceback(exception.__traceback__) File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall res = hook_impl.function(*args) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/_pytest/main.py", line 330, in pytest_cmdline_main return wrap_session(config, _main) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/_pytest/main.py", line 318, in wrap_session config.hook.pytest_sessionfinish( File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec return self._inner_hookexec(hook_name, methods, kwargs, firstresult) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall raise exception.with_traceback(exception.__traceback__) File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall teardown.throw(exception) # type: ignore[union-attr] ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/_pytest/logging.py", line 868, in pytest_sessionfinish return (yield) ^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 124, in _multicall teardown.send(result) # type: ignore[union-attr] ^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 903, in pytest_sessionfinish self.config.hook.pytest_terminal_summary( File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec return self._inner_hookexec(hook_name, methods, kwargs, firstresult) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall raise exception.with_traceback(exception.__traceback__) File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall teardown.throw(exception) # type: ignore[union-attr] ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 925, in pytest_terminal_summary return (yield) ^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall teardown.throw(exception) # type: ignore[union-attr] ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/_pytest/warnings.py", line 132, in pytest_terminal_summary return (yield) ^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall res = hook_impl.function(*args) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/pytest_plugin.py", line 346, in pytest_terminal_summary diff = file.diff() ^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py", line 195, in diff unified_diff(self.source.splitlines(), self.new_code().splitlines()), ^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py", line 163, in new_code format_whole_file = enforce_formatting() or code == format_code( ^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code runner = CliRunner(mix_stderr=False) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' _____________________ ERROR at teardown of test_namedtuple _____________________ some snapshots in this test have incorrect values. ----------------------------- Captured stdout call ----------------------------- file: test_something.py from inline_snapshot import snapshot from collections import namedtuple T=namedtuple("T","a,b") def test_tuple(): assert T(a=1,b=2) == snapshot(T(a=1, b=3)), "not equal" run> /usr/bin/python3.12 -m pytest --inline-snapshot=fix stdout: ============================= test session starts ============================== platform linux -- Python 3.12.8, pytest-8.3.4, pluggy-1.5.0 rootdir: /tmp/tmpq2ezkcag plugins: inline-snapshot-0.19.3, mock-3.14.0, hypothesis-6.124.0, time-machine-2.16.0, subtests-0.13.1, pytest_freezer-0.4.9 collected 1 item test_something.py F [100%] =================================== FAILURES =================================== __________________________________ test_tuple __________________________________ def test_tuple(): > assert T(a=1,b=2) == snapshot(T(a=1, b=3)), "not equal" test_something.py:7: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/generic_call_adapter.py:194: in assign result_kwargs[key] = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '2 ', filename = PosixPath('/tmp/tmpq2ezkcag/test_something.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError =============================== inline snapshot ================================ =========================== short test summary info ============================ FAILED test_something.py::test_tuple - TypeError: CliRunner.__init__() got an... ============================== 1 failed in 0.12s =============================== stderr: ____________________ ERROR at teardown of test_defaultdict _____________________ some snapshots in this test have incorrect values. ----------------------------- Captured stdout call ----------------------------- file: test_something.py from inline_snapshot import snapshot from collections import defaultdict def test_tuple(): d=defaultdict(list) d[1].append(2) assert d == snapshot(defaultdict(list, {1: [3]})), "not equal" run> /usr/bin/python3.12 -m pytest --inline-snapshot=fix stdout: ============================= test session starts ============================== platform linux -- Python 3.12.8, pytest-8.3.4, pluggy-1.5.0 rootdir: /tmp/tmp1dvk2mrr plugins: inline-snapshot-0.19.3, mock-3.14.0, hypothesis-6.124.0, time-machine-2.16.0, subtests-0.13.1, pytest_freezer-0.4.9 collected 1 item test_something.py F [100%] =================================== FAILURES =================================== __________________________________ test_tuple __________________________________ def test_tuple(): d=defaultdict(list) d[1].append(2) > assert d == snapshot(defaultdict(list, {1: [3]})), "not equal" test_something.py:8: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/generic_call_adapter.py:140: in assign result = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign result[key] = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign v = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '2 ', filename = PosixPath('/tmp/tmp1dvk2mrr/test_something.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError =============================== inline snapshot ================================ =========================== short test summary info ============================ FAILED test_something.py::test_tuple - TypeError: CliRunner.__init__() got an... ============================== 1 failed in 0.13s =============================== stderr: __________________ ERROR at teardown of test_config_pyproject __________________ some snapshots in this test have incorrect values. ----------------------------- Captured stdout call ----------------------------- file: test_a.py from inline_snapshot import snapshot def test_a(): assert 1 <= snapshot(5) assert 1 == snapshot(2) file: pyproject.toml [tool.inline-snapshot] default-flags = ["trim"] run> /usr/bin/python3.12 -m pytest stdout: ============================= test session starts ============================== platform linux -- Python 3.12.8, pytest-8.3.4, pluggy-1.5.0 rootdir: /tmp/tmpwf9lr8xp configfile: pyproject.toml plugins: inline-snapshot-0.19.3, mock-3.14.0, hypothesis-6.124.0, time-machine-2.16.0, subtests-0.13.1, pytest_freezer-0.4.9 collected 1 item test_a.py F [100%] =================================== FAILURES =================================== ____________________________________ test_a ____________________________________ def test_a(): assert 1 <= snapshot(5) > assert 1 == snapshot(2) test_a.py:5: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '1 ', filename = PosixPath('/tmp/tmpwf9lr8xp/test_a.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError =============================== inline snapshot ================================ =========================== short test summary info ============================ FAILED test_a.py::test_a - TypeError: CliRunner.__init__() got an unexpected ... stderr: Traceback (most recent call last): File "", line 198, in _run_module_as_main File "", line 88, in _run_code File "/usr/lib/python3/dist-packages/pytest/__main__.py", line 9, in raise SystemExit(pytest.console_main()) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 201, in console_main code = main() ^^^^^^ File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 175, in main ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec return self._inner_hookexec(hook_name, methods, kwargs, firstresult) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall raise exception.with_traceback(exception.__traceback__) File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall res = hook_impl.function(*args) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/_pytest/main.py", line 330, in pytest_cmdline_main return wrap_session(config, _main) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/_pytest/main.py", line 318, in wrap_session config.hook.pytest_sessionfinish( File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec return self._inner_hookexec(hook_name, methods, kwargs, firstresult) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall raise exception.with_traceback(exception.__traceback__) File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall teardown.throw(exception) # type: ignore[union-attr] ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/_pytest/logging.py", line 868, in pytest_sessionfinish return (yield) ^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 124, in _multicall teardown.send(result) # type: ignore[union-attr] ^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 903, in pytest_sessionfinish self.config.hook.pytest_terminal_summary( File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec return self._inner_hookexec(hook_name, methods, kwargs, firstresult) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall raise exception.with_traceback(exception.__traceback__) File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall teardown.throw(exception) # type: ignore[union-attr] ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 925, in pytest_terminal_summary return (yield) ^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall teardown.throw(exception) # type: ignore[union-attr] ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/_pytest/warnings.py", line 132, in pytest_terminal_summary return (yield) ^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall res = hook_impl.function(*args) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/pytest_plugin.py", line 271, in pytest_terminal_summary for change in snapshot._changes(): ^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 671, in _changes yield from self._value._get_changes() File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 337, in _get_changes new_code = self._file._token_to_code(new_token) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format return format_code(text, Path(self._source.filename)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code runner = CliRunner(mix_stderr=False) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' _____________________ ERROR at teardown of test_config_env _____________________ some snapshots in this test have incorrect values. ----------------------------- Captured stdout call ----------------------------- file: test_a.py from inline_snapshot import snapshot def test_a(): assert 1 <= snapshot(5) assert 1 == snapshot(2) run> /usr/bin/python3.12 -m pytest stdout: ============================= test session starts ============================== platform linux -- Python 3.12.8, pytest-8.3.4, pluggy-1.5.0 rootdir: /tmp/tmpjx9omx7u plugins: inline-snapshot-0.19.3, mock-3.14.0, hypothesis-6.124.0, time-machine-2.16.0, subtests-0.13.1, pytest_freezer-0.4.9 collected 1 item test_a.py F [100%] =================================== FAILURES =================================== ____________________________________ test_a ____________________________________ def test_a(): assert 1 <= snapshot(5) > assert 1 == snapshot(2) test_a.py:5: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '1 ', filename = PosixPath('/tmp/tmpjx9omx7u/test_a.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError =============================== inline snapshot ================================ =========================== short test summary info ============================ FAILED test_a.py::test_a - TypeError: CliRunner.__init__() got an unexpected ... stderr: Traceback (most recent call last): File "", line 198, in _run_module_as_main File "", line 88, in _run_code File "/usr/lib/python3/dist-packages/pytest/__main__.py", line 9, in raise SystemExit(pytest.console_main()) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 201, in console_main code = main() ^^^^^^ File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 175, in main ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec return self._inner_hookexec(hook_name, methods, kwargs, firstresult) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall raise exception.with_traceback(exception.__traceback__) File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall res = hook_impl.function(*args) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/_pytest/main.py", line 330, in pytest_cmdline_main return wrap_session(config, _main) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/_pytest/main.py", line 318, in wrap_session config.hook.pytest_sessionfinish( File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec return self._inner_hookexec(hook_name, methods, kwargs, firstresult) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall raise exception.with_traceback(exception.__traceback__) File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall teardown.throw(exception) # type: ignore[union-attr] ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/_pytest/logging.py", line 868, in pytest_sessionfinish return (yield) ^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 124, in _multicall teardown.send(result) # type: ignore[union-attr] ^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 903, in pytest_sessionfinish self.config.hook.pytest_terminal_summary( File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec return self._inner_hookexec(hook_name, methods, kwargs, firstresult) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall raise exception.with_traceback(exception.__traceback__) File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall teardown.throw(exception) # type: ignore[union-attr] ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 925, in pytest_terminal_summary return (yield) ^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall teardown.throw(exception) # type: ignore[union-attr] ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/_pytest/warnings.py", line 132, in pytest_terminal_summary return (yield) ^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall res = hook_impl.function(*args) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/pytest_plugin.py", line 271, in pytest_terminal_summary for change in snapshot._changes(): ^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 671, in _changes yield from self._value._get_changes() File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 337, in _get_changes new_code = self._file._token_to_code(new_token) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format return format_code(text, Path(self._source.filename)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code runner = CliRunner(mix_stderr=False) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' _____________________ ERROR at teardown of test_shortcuts ______________________ some snapshots in this test have incorrect values. ----------------------------- Captured stdout call ----------------------------- file: test_a.py from inline_snapshot import snapshot def test_a(): assert 1 <= snapshot(5) assert 1 == snapshot(2) file: pyproject.toml [tool.inline-snapshot.shortcuts] strim=["trim"] run> /usr/bin/python3.12 -m pytest --strim stdout: ============================= test session starts ============================== platform linux -- Python 3.12.8, pytest-8.3.4, pluggy-1.5.0 rootdir: /tmp/tmp5fdylebu configfile: pyproject.toml plugins: inline-snapshot-0.19.3, mock-3.14.0, hypothesis-6.124.0, time-machine-2.16.0, subtests-0.13.1, pytest_freezer-0.4.9 collected 1 item test_a.py F [100%] =================================== FAILURES =================================== ____________________________________ test_a ____________________________________ def test_a(): assert 1 <= snapshot(5) > assert 1 == snapshot(2) test_a.py:5: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '1 ', filename = PosixPath('/tmp/tmp5fdylebu/test_a.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError =============================== inline snapshot ================================ =========================== short test summary info ============================ FAILED test_a.py::test_a - TypeError: CliRunner.__init__() got an unexpected ... stderr: Traceback (most recent call last): File "", line 198, in _run_module_as_main File "", line 88, in _run_code File "/usr/lib/python3/dist-packages/pytest/__main__.py", line 9, in raise SystemExit(pytest.console_main()) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 201, in console_main code = main() ^^^^^^ File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 175, in main ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec return self._inner_hookexec(hook_name, methods, kwargs, firstresult) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall raise exception.with_traceback(exception.__traceback__) File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall res = hook_impl.function(*args) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/_pytest/main.py", line 330, in pytest_cmdline_main return wrap_session(config, _main) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/_pytest/main.py", line 318, in wrap_session config.hook.pytest_sessionfinish( File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec return self._inner_hookexec(hook_name, methods, kwargs, firstresult) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall raise exception.with_traceback(exception.__traceback__) File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall teardown.throw(exception) # type: ignore[union-attr] ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/_pytest/logging.py", line 868, in pytest_sessionfinish return (yield) ^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 124, in _multicall teardown.send(result) # type: ignore[union-attr] ^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 903, in pytest_sessionfinish self.config.hook.pytest_terminal_summary( File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec return self._inner_hookexec(hook_name, methods, kwargs, firstresult) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall raise exception.with_traceback(exception.__traceback__) File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall teardown.throw(exception) # type: ignore[union-attr] ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 925, in pytest_terminal_summary return (yield) ^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall teardown.throw(exception) # type: ignore[union-attr] ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/_pytest/warnings.py", line 132, in pytest_terminal_summary return (yield) ^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall res = hook_impl.function(*args) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/pytest_plugin.py", line 271, in pytest_terminal_summary for change in snapshot._changes(): ^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 671, in _changes yield from self._value._get_changes() File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 337, in _get_changes new_code = self._file._token_to_code(new_token) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format return format_code(text, Path(self._source.filename)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code runner = CliRunner(mix_stderr=False) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' _________________ ERROR at teardown of test_default_shortcuts __________________ some snapshots in this test have incorrect values. ----------------------------- Captured stdout call ----------------------------- file: test_a.py from inline_snapshot import snapshot def test_a(): assert 1 <= snapshot(5) assert 1 == snapshot(2) file: pyproject.toml run> /usr/bin/python3.12 -m pytest --fix stdout: ============================= test session starts ============================== platform linux -- Python 3.12.8, pytest-8.3.4, pluggy-1.5.0 rootdir: /tmp/tmpc8da4y6p configfile: pyproject.toml plugins: inline-snapshot-0.19.3, mock-3.14.0, hypothesis-6.124.0, time-machine-2.16.0, subtests-0.13.1, pytest_freezer-0.4.9 collected 1 item test_a.py F [100%] =================================== FAILURES =================================== ____________________________________ test_a ____________________________________ def test_a(): assert 1 <= snapshot(5) > assert 1 == snapshot(2) test_a.py:5: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '1 ', filename = PosixPath('/tmp/tmpc8da4y6p/test_a.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError =============================== inline snapshot ================================ =========================== short test summary info ============================ FAILED test_a.py::test_a - TypeError: CliRunner.__init__() got an unexpected ... stderr: Traceback (most recent call last): File "", line 198, in _run_module_as_main File "", line 88, in _run_code File "/usr/lib/python3/dist-packages/pytest/__main__.py", line 9, in raise SystemExit(pytest.console_main()) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 201, in console_main code = main() ^^^^^^ File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 175, in main ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec return self._inner_hookexec(hook_name, methods, kwargs, firstresult) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall raise exception.with_traceback(exception.__traceback__) File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall res = hook_impl.function(*args) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/_pytest/main.py", line 330, in pytest_cmdline_main return wrap_session(config, _main) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/_pytest/main.py", line 318, in wrap_session config.hook.pytest_sessionfinish( File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec return self._inner_hookexec(hook_name, methods, kwargs, firstresult) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall raise exception.with_traceback(exception.__traceback__) File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall teardown.throw(exception) # type: ignore[union-attr] ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/_pytest/logging.py", line 868, in pytest_sessionfinish return (yield) ^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 124, in _multicall teardown.send(result) # type: ignore[union-attr] ^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 903, in pytest_sessionfinish self.config.hook.pytest_terminal_summary( File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec return self._inner_hookexec(hook_name, methods, kwargs, firstresult) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall raise exception.with_traceback(exception.__traceback__) File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall teardown.throw(exception) # type: ignore[union-attr] ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 925, in pytest_terminal_summary return (yield) ^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall teardown.throw(exception) # type: ignore[union-attr] ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/_pytest/warnings.py", line 132, in pytest_terminal_summary return (yield) ^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall res = hook_impl.function(*args) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/pytest_plugin.py", line 271, in pytest_terminal_summary for change in snapshot._changes(): ^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 671, in _changes yield from self._value._get_changes() File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 337, in _get_changes new_code = self._file._token_to_code(new_token) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format return format_code(text, Path(self._source.filename)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code runner = CliRunner(mix_stderr=False) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' ______________________ ERROR at teardown of test_example _______________________ some snapshots in this test have incorrect values. ----------------------------- Captured stdout call ----------------------------- file: test_a.py from inline_snapshot import snapshot def test_a(): assert 1==snapshot(2) file: test_b.py 1+1 run> /usr/bin/python3.12 -m pytest --inline-snapshot=create,fix stdout: ============================= test session starts ============================== platform linux -- Python 3.12.8, pytest-8.3.4, pluggy-1.5.0 rootdir: /tmp/tmpuxf0g1sl plugins: inline-snapshot-0.19.3, mock-3.14.0, hypothesis-6.124.0, time-machine-2.16.0, subtests-0.13.1, pytest_freezer-0.4.9 collected 1 item test_a.py F [100%] =================================== FAILURES =================================== ____________________________________ test_a ____________________________________ def test_a(): > assert 1==snapshot(2) test_a.py:5: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '1 ', filename = PosixPath('/tmp/tmpuxf0g1sl/test_a.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError =============================== inline snapshot ================================ =========================== short test summary info ============================ FAILED test_a.py::test_a - TypeError: CliRunner.__init__() got an unexpected ... ============================== 1 failed in 0.12s =============================== stderr: file: test_a.py from inline_snapshot import snapshot def test_a(): assert 1==snapshot(2) file: test_b.py 1+1 run> pytest /tmp/tmpi00mbcsr/test_a.py ----------------------------- Captured stderr call ----------------------------- Traceback (most recent call last): File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 193, in run_inline v() File "/tmp/tmpi00mbcsr/test_a.py", line 5, in test_a assert 1==snapshot(2) ^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ return self == other ^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ self._changes.append(next(it)) ^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign new_code = self.context.file._token_to_code(new_token) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format return format_code(text, Path(self._source.filename)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code runner = CliRunner(mix_stderr=False) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' ______________ ERROR at teardown of test_pydantic_create_snapshot ______________ some snapshots in this test have incorrect values. ----------------------------- Captured stdout call ----------------------------- file: test_something.py from pydantic import BaseModel from inline_snapshot import snapshot class M(BaseModel): size:int name:str age:int=4 def test_pydantic(): m=M(size=5,name="Tom") assert m==snapshot() assert m.dict()==snapshot() run> /usr/bin/python3.12 -m pytest --inline-snapshot=create stdout: ============================= test session starts ============================== platform linux -- Python 3.12.8, pytest-8.3.4, pluggy-1.5.0 rootdir: /tmp/tmpfuyda906 plugins: inline-snapshot-0.19.3, mock-3.14.0, hypothesis-6.124.0, time-machine-2.16.0, subtests-0.13.1, pytest_freezer-0.4.9 collected 1 item test_something.py F [100%] =================================== FAILURES =================================== ________________________________ test_pydantic _________________________________ def test_pydantic(): m=M(size=5,name="Tom") > assert m==snapshot() test_something.py:12: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '', filename = PosixPath('/tmp/tmpfuyda906/test_something.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError =============================== inline snapshot ================================ =========================== short test summary info ============================ FAILED test_something.py::test_pydantic - TypeError: CliRunner.__init__() got... ============================== 1 failed in 0.16s =============================== stderr: ________________ ERROR at teardown of test_pydantic_field_repr _________________ some snapshots in this test have incorrect values. ----------------------------- Captured stdout call ----------------------------- file: test_something.py from inline_snapshot import snapshot from pydantic import BaseModel,Field class container(BaseModel): a: int b: int = Field(default=5,repr=False) assert container(a=1,b=5) == snapshot() run> /usr/bin/python3.12 -m pytest --inline-snapshot=create stdout: ============================= test session starts ============================== platform linux -- Python 3.12.8, pytest-8.3.4, pluggy-1.5.0 rootdir: /tmp/tmp4dtawobv plugins: inline-snapshot-0.19.3, mock-3.14.0, hypothesis-6.124.0, time-machine-2.16.0, subtests-0.13.1, pytest_freezer-0.4.9 collected 0 items / 1 error ==================================== ERRORS ==================================== ______________________ ERROR collecting test_something.py ______________________ test_something.py:8: in assert container(a=1,b=5) == snapshot() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: in format_code runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' =============================== inline snapshot ================================ =========================== short test summary info ============================ ERROR test_something.py - TypeError: CliRunner.__init__() got an unexpected k... !!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!! =============================== 1 error in 0.21s =============================== stderr: _______________ ERROR at teardown of test_pydantic_default_value _______________ some snapshots in this test have incorrect values. ----------------------------- Captured stdout call ----------------------------- file: test_something.py from inline_snapshot import snapshot,Is from dataclasses import dataclass,field from pydantic import BaseModel,Field class A(BaseModel): a:int b:int=2 c:list=Field(default_factory=list) def test_something(): assert A(a=1) == snapshot(A(a=1,b=2,c=[])) run> /usr/bin/python3.12 -m pytest --inline-snapshot=update stdout: ============================= test session starts ============================== platform linux -- Python 3.12.8, pytest-8.3.4, pluggy-1.5.0 rootdir: /tmp/tmp4v47e54q plugins: inline-snapshot-0.19.3, mock-3.14.0, hypothesis-6.124.0, time-machine-2.16.0, subtests-0.13.1, pytest_freezer-0.4.9 collected 1 item test_something.py . [100%] =============================== inline snapshot ================================ ─────────────────────────────── Update snapshots ─────────────────────────────── stderr: Traceback (most recent call last): File "", line 198, in _run_module_as_main File "", line 88, in _run_code File "/usr/lib/python3/dist-packages/pytest/__main__.py", line 9, in raise SystemExit(pytest.console_main()) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 201, in console_main code = main() ^^^^^^ File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 175, in main ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec return self._inner_hookexec(hook_name, methods, kwargs, firstresult) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall raise exception.with_traceback(exception.__traceback__) File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall res = hook_impl.function(*args) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/_pytest/main.py", line 330, in pytest_cmdline_main return wrap_session(config, _main) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/_pytest/main.py", line 318, in wrap_session config.hook.pytest_sessionfinish( File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec return self._inner_hookexec(hook_name, methods, kwargs, firstresult) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall raise exception.with_traceback(exception.__traceback__) File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall teardown.throw(exception) # type: ignore[union-attr] ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/_pytest/logging.py", line 868, in pytest_sessionfinish return (yield) ^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 124, in _multicall teardown.send(result) # type: ignore[union-attr] ^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 903, in pytest_sessionfinish self.config.hook.pytest_terminal_summary( File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec return self._inner_hookexec(hook_name, methods, kwargs, firstresult) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall raise exception.with_traceback(exception.__traceback__) File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall teardown.throw(exception) # type: ignore[union-attr] ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 925, in pytest_terminal_summary return (yield) ^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall teardown.throw(exception) # type: ignore[union-attr] ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/_pytest/warnings.py", line 132, in pytest_terminal_summary return (yield) ^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall res = hook_impl.function(*args) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/pytest_plugin.py", line 346, in pytest_terminal_summary diff = file.diff() ^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py", line 195, in diff unified_diff(self.source.splitlines(), self.new_code().splitlines()), ^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py", line 163, in new_code format_whole_file = enforce_formatting() or code == format_code( ^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code runner = CliRunner(mix_stderr=False) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' ______________ ERROR at teardown of test_pydantic_factory_method _______________ some snapshots in this test have incorrect values. ----------------------------- Captured stdout call ----------------------------- file: test_something.py from inline_snapshot import snapshot from pydantic import BaseModel class A(BaseModel): a:int @classmethod def from_str(cls,s): return cls(a=int(s)) def test_something(): for a in [1,2]: assert A(a=2) == snapshot(A.from_str("1")) run> /usr/bin/python3.12 -m pytest --inline-snapshot=fix stdout: ============================= test session starts ============================== platform linux -- Python 3.12.8, pytest-8.3.4, pluggy-1.5.0 rootdir: /tmp/tmp8_20h979 plugins: inline-snapshot-0.19.3, mock-3.14.0, hypothesis-6.124.0, time-machine-2.16.0, subtests-0.13.1, pytest_freezer-0.4.9 collected 1 item test_something.py F [100%] =================================== FAILURES =================================== ________________________________ test_something ________________________________ def test_something(): for a in [1,2]: > assert A(a=2) == snapshot(A.from_str("1")) test_something.py:13: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/generic_call_adapter.py:107: in assign result = yield from self.value_assign(old_value, old_node, new_value) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/adapter.py:87: in value_assign result = yield from adapter.assign(old_value, old_node, new_value) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = 'A (a =2 )', filename = PosixPath('/tmp/tmp8_20h979/test_something.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError =============================== inline snapshot ================================ =========================== short test summary info ============================ FAILED test_something.py::test_something - TypeError: CliRunner.__init__() go... ============================== 1 failed in 0.16s =============================== stderr: ________ ERROR at teardown of test_find_pyproject_in_parent_directories ________ some snapshots in this test have incorrect values. ----------------------------- Captured stdout call ----------------------------- file: pyproject.toml [tool.inline-snapshot] hash-length=2 file: project/pytest.ini file: project/test_something.py from inline_snapshot import outsource,snapshot,external def test_something(): assert outsource("test") == snapshot() run> /usr/bin/python3.12 -m pytest --rootdir ./project --inline-snapshot=create stdout: ============================= test session starts ============================== platform linux -- Python 3.12.8, pytest-8.3.4, pluggy-1.5.0 rootdir: /tmp/tmpzhe0bl4m/project configfile: ../pyproject.toml plugins: inline-snapshot-0.19.3, mock-3.14.0, hypothesis-6.124.0, time-machine-2.16.0, subtests-0.13.1, pytest_freezer-0.4.9 collected 1 item project/test_something.py F [100%] =================================== FAILURES =================================== ________________________________ test_something ________________________________ def test_something(): > assert outsource("test") == snapshot() project/test_something.py:4: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '', filename = PosixPath('/tmp/tmpzhe0bl4m/project/test_something.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError =============================== inline snapshot ================================ =========================== short test summary info ============================ FAILED project/test_something.py::test_something - TypeError: CliRunner.__ini... ============================== 1 failed in 0.12s =============================== stderr: =================================== FAILURES =================================== ________________________________ test_unmanaged ________________________________ def test_unmanaged(): Example( """\ from inline_snapshot import snapshot,Is from dataclasses import dataclass @dataclass class A: a:int b:int def test_something(): assert A(a=2,b=4) == snapshot(A(a=1,b=Is(1))), "not equal" """ > ).run_inline( ["--inline-snapshot=fix"], changed_files=snapshot( { "test_something.py": """\ from inline_snapshot import snapshot,Is from dataclasses import dataclass @dataclass class A: a:int b:int def test_something(): assert A(a=2,b=4) == snapshot(A(a=2,b=Is(1))), "not equal" """ } ), raises=snapshot( """\ AssertionError: not equal\ """ ), ) tests/adapter/test_dataclass.py:21: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: in run_inline assert raises == f"{type(raised_exception).__name__}:\n" + str( /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '"""\\\nTypeError:\nCliRunner.__init__() got an unexpected keyword argument \'mix_stderr\'\\\n"""' filename = PosixPath('/tmp/autopkgtest.ImMzGl/autopkgtest_tmp/tests/adapter/test_dataclass.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- file: test_something.py from inline_snapshot import snapshot,Is from dataclasses import dataclass @dataclass class A: a:int b:int def test_something(): assert A(a=2,b=4) == snapshot(A(a=1,b=Is(1))), "not equal" run> pytest /tmp/tmp_0vv_wwj/test_something.py ----------------------------- Captured stderr call ----------------------------- Traceback (most recent call last): File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 193, in run_inline v() File "/tmp/tmp_0vv_wwj/test_something.py", line 10, in test_something assert A(a=2,b=4) == snapshot(A(a=1,b=Is(1))), "not equal" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ return self == other ^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ self._changes.append(next(it)) ^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/generic_call_adapter.py", line 194, in assign result_kwargs[key] = yield from self.get_adapter( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign new_code = self.context.file._token_to_code(new_token) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format return format_code(text, Path(self._source.filename)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code runner = CliRunner(mix_stderr=False) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' _________________________________ test_reeval __________________________________ def test_reeval(): Example( """\ from inline_snapshot import snapshot,Is from dataclasses import dataclass @dataclass class A: a:int b:int def test_something(): for c in "ab": assert A(a=1,b=c) == snapshot(A(a=2,b=Is(c))) """ > ).run_inline( ["--inline-snapshot=fix"], changed_files=snapshot( { "test_something.py": """\ from inline_snapshot import snapshot,Is from dataclasses import dataclass @dataclass class A: a:int b:int def test_something(): for c in "ab": assert A(a=1,b=c) == snapshot(A(a=1,b=Is(c))) """ } ), ) tests/adapter/test_dataclass.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = args = ['--inline-snapshot=fix'] def run_inline( self, args: list[str] = [], *, reported_categories: Snapshot[list[Category]] | None = None, changed_files: Snapshot[dict[str, str]] | None = None, report: Snapshot[str] | None = None, raises: Snapshot[str] | None = None, ) -> Example: """Execute the example files in process and run every `test_*` function. This is useful for fast test execution. Parameters: args: inline-snapshot arguments (supports only "--inline-snapshot=fix|create|..." ). reported_categories: snapshot of categories which inline-snapshot thinks could be applied. changed_files: snapshot of files which are changed by this run. raises: snapshot of the exception which is raised during the test execution. It is required if your code raises an exception. Returns: A new Example instance which contains the changed files. """ parser = ArgumentParser() parser.add_argument( "--inline-snapshot", metavar="(disable,short-report,report,review,create,update,trim,fix)*", dest="inline_snapshot", help="update specific snapshot values:\n" "disable: disable the snapshot logic\n" "short-report: show a short report\n" "report: show a longer report with a diff report\n" "review: allow to approve the changes interactive\n" "create: creates snapshots which are currently not defined\n" "update: update snapshots even if they are defined\n" "trim: changes the snapshot in a way which will make the snapshot more precise.\n" "fix: change snapshots which currently break your tests\n", ) parsed_args = parser.parse_args(args) flags = (parsed_args.inline_snapshot or "").split(",") with TemporaryDirectory() as dir: tmp_path = Path(dir) self._write_files(tmp_path) raised_exception = None with snapshot_env(): with ChangeRecorder().activate() as recorder: _inline_snapshot._update_flags = Flags({*flags}) inline_snapshot._external.storage = ( inline_snapshot._external.DiscStorage(tmp_path / ".storage") ) try: for filename in tmp_path.glob("*.py"): globals: dict[str, Any] = {} print("run> pytest", filename) exec( compile(filename.read_text("utf-8"), filename, "exec"), globals, ) # run all test_* functions for k, v in globals.items(): if k.startswith("test_") and callable(v): v() except Exception as e: traceback.print_exc() raised_exception = e finally: _inline_snapshot._active = False changes = [] for snapshot in _inline_snapshot.snapshots.values(): changes += snapshot._changes() snapshot_flags = {change.flag for change in changes} apply_all( [ change for change in changes if change.flag in _inline_snapshot._update_flags.to_set() ] ) recorder.fix_all() report_output = StringIO() console = Console(file=report_output) # TODO: add all the report output here report_problems(console) if reported_categories is not None: assert sorted(snapshot_flags) == reported_categories if raised_exception is not None: > assert raises == f"{type(raised_exception).__name__}:\n" + str( raised_exception ) E assert None == ('TypeError:\n' + "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'") E + where "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'" = str(TypeError("CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'")) /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: AssertionError ----------------------------- Captured stdout call ----------------------------- file: test_something.py from inline_snapshot import snapshot,Is from dataclasses import dataclass @dataclass class A: a:int b:int def test_something(): for c in "ab": assert A(a=1,b=c) == snapshot(A(a=2,b=Is(c))) run> pytest /tmp/tmpqjek7o2_/test_something.py ----------------------------- Captured stderr call ----------------------------- Traceback (most recent call last): File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 193, in run_inline v() File "/tmp/tmpqjek7o2_/test_something.py", line 11, in test_something assert A(a=1,b=c) == snapshot(A(a=2,b=Is(c))) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ return self == other ^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ self._changes.append(next(it)) ^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/generic_call_adapter.py", line 194, in assign result_kwargs[key] = yield from self.get_adapter( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign new_code = self.context.file._token_to_code(new_token) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format return format_code(text, Path(self._source.filename)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code runner = CliRunner(mix_stderr=False) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' _________________________ test_dataclass_default_value _________________________ def test_dataclass_default_value(): Example( """\ from inline_snapshot import snapshot,Is from dataclasses import dataclass,field @dataclass class A: a:int b:int=2 c:list=field(default_factory=list) def test_something(): assert A(a=1) == snapshot(A(a=1,b=2,c=[])) """ > ).run_inline( ["--inline-snapshot=update"], changed_files=snapshot( { "test_something.py": """\ from inline_snapshot import snapshot,Is from dataclasses import dataclass,field @dataclass class A: a:int b:int=2 c:list=field(default_factory=list) def test_something(): assert A(a=1) == snapshot(A(a=1)) """ } ), ) tests/adapter/test_dataclass.py:100: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:214: in run_inline recorder.fix_all() /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all file.rewrite() /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite new_code = self.new_code() /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code format_whole_file = enforce_formatting() or code == format_code( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 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' filename = PosixPath('/tmp/tmpwjb9cn23/test_something.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- file: test_something.py from inline_snapshot import snapshot,Is from dataclasses import dataclass,field @dataclass class A: a:int b:int=2 c:list=field(default_factory=list) def test_something(): assert A(a=1) == snapshot(A(a=1,b=2,c=[])) run> pytest /tmp/tmpwjb9cn23/test_something.py ___________________________ test_attrs_default_value ___________________________ def test_attrs_default_value(): Example( """\ from inline_snapshot import snapshot,Is import attrs @attrs.define class A: a:int b:int=2 c:list=attrs.field(factory=list) d:int=attrs.field(default=attrs.Factory(lambda self:self.a+10,takes_self=True)) def test_something(): assert A(a=1) == snapshot(A(a=1,b=2,c=[],d=11)) assert A(a=2,b=3) == snapshot(A(a=1,b=2,c=[],d=11)) """ > ).run_pytest( ["--inline-snapshot=fix"], changed_files=snapshot( { "test_something.py": """\ from inline_snapshot import snapshot,Is import attrs @attrs.define class A: a:int b:int=2 c:list=attrs.field(factory=list) d:int=attrs.field(default=attrs.Factory(lambda self:self.a+10,takes_self=True)) def test_something(): assert A(a=1) == snapshot(A(a=1,b=2,c=[],d=11)) assert A(a=2,b=3) == snapshot(A(a=2,b=3,c=[],d=11)) """ } ), ).run_pytest( ["--inline-snapshot=update"], changed_files=snapshot( { "test_something.py": """\ from inline_snapshot import snapshot,Is import attrs @attrs.define class A: a:int b:int=2 c:list=attrs.field(factory=list) d:int=attrs.field(default=attrs.Factory(lambda self:self.a+10,takes_self=True)) def test_something(): assert A(a=1) == snapshot(A(a=1)) assert A(a=2,b=3) == snapshot(A(a=2,b=3)) """ } ), ) tests/adapter/test_dataclass.py:139: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = args = ['--inline-snapshot=fix'] def run_pytest( self, args: list[str] = [], *, term_columns=80, env: dict[str, str] = {}, changed_files: Snapshot[dict[str, str]] | None = None, report: Snapshot[str] | None = None, stderr: Snapshot[str] | None = None, returncode: Snapshot[int] | None = None, ) -> Example: """Run pytest with the given args and env variables in an seperate process. It can be used to test the interaction between your code and pytest, but it is a bit slower than `run_inline` Parameters: args: pytest arguments like "--inline-snapshot=fix" env: dict of environment variables changed_files: snapshot of files which are changed by this run. report: snapshot of the report at the end of the pytest run. stderr: pytest stderr output returncode: snapshot of the pytest returncode. Returns: A new Example instance which contains the changed files. """ with TemporaryDirectory() as dir: tmp_path = Path(dir) self._write_files(tmp_path) cmd = [sys.executable, "-m", "pytest", *args] command_env = dict(os.environ) command_env["TERM"] = "unknown" command_env["COLUMNS"] = str( term_columns + 1 if platform.system() == "Windows" else term_columns ) command_env.pop("CI", None) command_env.update(env) result = sp.run(cmd, cwd=tmp_path, capture_output=True, env=command_env) print("run>", *cmd) print("stdout:") print(result.stdout.decode()) print("stderr:") print(result.stderr.decode()) if returncode is not None: assert result.returncode == returncode if stderr is not None: assert result.stderr.decode() == stderr if report is not None: report_list = [] record = False for line in result.stdout.decode().splitlines(): line = line.strip() if line.startswith("===="): record = False if record and line: report_list.append(line) if line.startswith("====") and "inline snapshot" in line: record = True report_str = "\n".join(report_list) assert normalize(report_str) == report, repr(report_str) if changed_files is not None: current_files = {} for name, content in sorted(self._read_files(tmp_path).items()): if name not in self.files or self.files[name] != content: current_files[name] = content > assert changed_files == current_files E AssertionError: assert {'test_someth...=[],d=11))\n'} == {} E E Left contains 1 more item: E {'test_something.py': 'from inline_snapshot import snapshot,Is\n' E 'import attrs\n' E '\n' E '@attrs.define\n' E 'class A:\n'... E E ...Full output truncated (11 lines hidden), use '-vv' to show /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:327: AssertionError ----------------------------- Captured stdout call ----------------------------- file: test_something.py from inline_snapshot import snapshot,Is import attrs @attrs.define class A: a:int b:int=2 c:list=attrs.field(factory=list) d:int=attrs.field(default=attrs.Factory(lambda self:self.a+10,takes_self=True)) def test_something(): assert A(a=1) == snapshot(A(a=1,b=2,c=[],d=11)) assert A(a=2,b=3) == snapshot(A(a=1,b=2,c=[],d=11)) run> /usr/bin/python3.12 -m pytest --inline-snapshot=fix stdout: ============================= test session starts ============================== platform linux -- Python 3.12.8, pytest-8.3.4, pluggy-1.5.0 rootdir: /tmp/tmppfdewdp3 plugins: inline-snapshot-0.19.3, mock-3.14.0, hypothesis-6.124.0, time-machine-2.16.0, subtests-0.13.1, pytest_freezer-0.4.9 collected 1 item test_something.py F [100%] =================================== FAILURES =================================== ________________________________ test_something ________________________________ def test_something(): assert A(a=1) == snapshot(A(a=1,b=2,c=[],d=11)) > assert A(a=2,b=3) == snapshot(A(a=1,b=2,c=[],d=11)) test_something.py:13: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/generic_call_adapter.py:194: in assign result_kwargs[key] = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '2 ', filename = PosixPath('/tmp/tmppfdewdp3/test_something.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError =============================== inline snapshot ================================ =========================== short test summary info ============================ FAILED test_something.py::test_something - TypeError: CliRunner.__init__() go... ============================== 1 failed in 0.13s =============================== stderr: ____________________________ test_attrs_field_repr _____________________________ def test_attrs_field_repr(): Example( """\ from inline_snapshot import snapshot import attrs @attrs.define class container: a: int b: int = attrs.field(default=5,repr=False) assert container(a=1,b=5) == snapshot() """ > ).run_pytest( ["--inline-snapshot=create"], changed_files=snapshot( { "test_something.py": """\ from inline_snapshot import snapshot import attrs @attrs.define class container: a: int b: int = attrs.field(default=5,repr=False) assert container(a=1,b=5) == snapshot(container(a=1)) """ } ), ).run_pytest() tests/adapter/test_dataclass.py:198: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = args = ['--inline-snapshot=create'] def run_pytest( self, args: list[str] = [], *, term_columns=80, env: dict[str, str] = {}, changed_files: Snapshot[dict[str, str]] | None = None, report: Snapshot[str] | None = None, stderr: Snapshot[str] | None = None, returncode: Snapshot[int] | None = None, ) -> Example: """Run pytest with the given args and env variables in an seperate process. It can be used to test the interaction between your code and pytest, but it is a bit slower than `run_inline` Parameters: args: pytest arguments like "--inline-snapshot=fix" env: dict of environment variables changed_files: snapshot of files which are changed by this run. report: snapshot of the report at the end of the pytest run. stderr: pytest stderr output returncode: snapshot of the pytest returncode. Returns: A new Example instance which contains the changed files. """ with TemporaryDirectory() as dir: tmp_path = Path(dir) self._write_files(tmp_path) cmd = [sys.executable, "-m", "pytest", *args] command_env = dict(os.environ) command_env["TERM"] = "unknown" command_env["COLUMNS"] = str( term_columns + 1 if platform.system() == "Windows" else term_columns ) command_env.pop("CI", None) command_env.update(env) result = sp.run(cmd, cwd=tmp_path, capture_output=True, env=command_env) print("run>", *cmd) print("stdout:") print(result.stdout.decode()) print("stderr:") print(result.stderr.decode()) if returncode is not None: assert result.returncode == returncode if stderr is not None: assert result.stderr.decode() == stderr if report is not None: report_list = [] record = False for line in result.stdout.decode().splitlines(): line = line.strip() if line.startswith("===="): record = False if record and line: report_list.append(line) if line.startswith("====") and "inline snapshot" in line: record = True report_str = "\n".join(report_list) assert normalize(report_str) == report, repr(report_str) if changed_files is not None: current_files = {} for name, content in sorted(self._read_files(tmp_path).items()): if name not in self.files or self.files[name] != content: current_files[name] = content > assert changed_files == current_files E AssertionError: assert {'test_someth...iner(a=1))\n'} == {} E E Left contains 1 more item: E {'test_something.py': 'from inline_snapshot import snapshot\n' E 'import attrs\n' E '\n' E '@attrs.define\n' E 'class container:\n'... E E ...Full output truncated (5 lines hidden), use '-vv' to show /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:327: AssertionError ----------------------------- Captured stdout call ----------------------------- file: test_something.py from inline_snapshot import snapshot import attrs @attrs.define class container: a: int b: int = attrs.field(default=5,repr=False) assert container(a=1,b=5) == snapshot() run> /usr/bin/python3.12 -m pytest --inline-snapshot=create stdout: ============================= test session starts ============================== platform linux -- Python 3.12.8, pytest-8.3.4, pluggy-1.5.0 rootdir: /tmp/tmpuztrgk7u plugins: inline-snapshot-0.19.3, mock-3.14.0, hypothesis-6.124.0, time-machine-2.16.0, subtests-0.13.1, pytest_freezer-0.4.9 collected 0 items / 1 error ==================================== ERRORS ==================================== ______________________ ERROR collecting test_something.py ______________________ test_something.py:9: in assert container(a=1,b=5) == snapshot() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: in format_code runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' =============================== inline snapshot ================================ =========================== short test summary info ============================ ERROR test_something.py - TypeError: CliRunner.__init__() got an unexpected k... !!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!! =============================== 1 error in 0.17s =============================== stderr: ___________________________ test_disabled[executing] ___________________________ executing_used = True def test_disabled(executing_used): Example( """\ from inline_snapshot import snapshot from dataclasses import dataclass @dataclass class A: a:int def test_something(): assert A(a=3) == snapshot(A(a=5)),"not equal" """ > ).run_inline( changed_files=snapshot({}), raises=snapshot( """\ AssertionError: not equal\ """ ), ) tests/adapter/test_dataclass.py:261: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: in run_inline assert raises == f"{type(raised_exception).__name__}:\n" + str( /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '"""\\\nTypeError:\nCliRunner.__init__() got an unexpected keyword argument \'mix_stderr\'\\\n"""' filename = PosixPath('/tmp/autopkgtest.ImMzGl/autopkgtest_tmp/tests/adapter/test_dataclass.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- file: test_something.py from inline_snapshot import snapshot from dataclasses import dataclass @dataclass class A: a:int def test_something(): assert A(a=3) == snapshot(A(a=5)),"not equal" run> pytest /tmp/tmpw51cuawc/test_something.py ----------------------------- Captured stderr call ----------------------------- Traceback (most recent call last): File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 193, in run_inline v() File "/tmp/tmpw51cuawc/test_something.py", line 9, in test_something assert A(a=3) == snapshot(A(a=5)),"not equal" ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ return self == other ^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ self._changes.append(next(it)) ^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/generic_call_adapter.py", line 194, in assign result_kwargs[key] = yield from self.get_adapter( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign new_code = self.context.file._token_to_code(new_token) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format return format_code(text, Path(self._source.filename)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code runner = CliRunner(mix_stderr=False) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' _______________________ test_disabled[without-executing] _______________________ executing_used = False def test_disabled(executing_used): Example( """\ from inline_snapshot import snapshot from dataclasses import dataclass @dataclass class A: a:int def test_something(): assert A(a=3) == snapshot(A(a=5)),"not equal" """ > ).run_inline( changed_files=snapshot({}), raises=snapshot( """\ AssertionError: not equal\ """ ), ) tests/adapter/test_dataclass.py:261: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: in run_inline assert raises == f"{type(raised_exception).__name__}:\n" + str( /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:53: in assign and self.context.file._token_of_node(old_node) != new_token _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = node = def _token_of_node(self, node): return list( normalize( [ simple_token(t.type, t.string) > for t in self._source.asttokens().get_tokens(node) if t.type not in ignore_tokens ] ) ) E AttributeError: 'NoneType' object has no attribute 'asttokens' /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:45: AttributeError ----------------------------- Captured stdout call ----------------------------- file: test_something.py from inline_snapshot import snapshot from dataclasses import dataclass @dataclass class A: a:int def test_something(): assert A(a=3) == snapshot(A(a=5)),"not equal" run> pytest /tmp/tmpr_kmvj5n/test_something.py ----------------------------- Captured stderr call ----------------------------- Traceback (most recent call last): File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 193, in run_inline v() File "/tmp/tmpr_kmvj5n/test_something.py", line 9, in test_something assert A(a=3) == snapshot(A(a=5)),"not equal" ^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError: not equal ______________________________ test_add_argument _______________________________ def test_add_argument(): Example( """\ from inline_snapshot import snapshot from dataclasses import dataclass @dataclass class A: a:int=0 b:int=0 c:int=0 def test_something(): assert A(a=3,b=3,c=3) == snapshot(A(b=3)),"not equal" """ > ).run_inline( ["--inline-snapshot=fix"], changed_files=snapshot( { "test_something.py": """\ from inline_snapshot import snapshot from dataclasses import dataclass @dataclass class A: a:int=0 b:int=0 c:int=0 def test_something(): assert A(a=3,b=3,c=3) == snapshot(A(a = 3, b=3, c = 3)),"not equal" """ } ), raises=snapshot(None), ) tests/adapter/test_dataclass.py:322: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: in run_inline assert raises == f"{type(raised_exception).__name__}:\n" + str( /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '"""\\\nTypeError:\nCliRunner.__init__() got an unexpected keyword argument \'mix_stderr\'\\\n"""' filename = PosixPath('/tmp/autopkgtest.ImMzGl/autopkgtest_tmp/tests/adapter/test_dataclass.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- file: test_something.py from inline_snapshot import snapshot from dataclasses import dataclass @dataclass class A: a:int=0 b:int=0 c:int=0 def test_something(): assert A(a=3,b=3,c=3) == snapshot(A(b=3)),"not equal" run> pytest /tmp/tmp2decwxf_/test_something.py ----------------------------- Captured stderr call ----------------------------- Traceback (most recent call last): File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 193, in run_inline v() File "/tmp/tmp2decwxf_/test_something.py", line 11, in test_something assert A(a=3,b=3,c=3) == snapshot(A(b=3)),"not equal" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ return self == other ^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ self._changes.append(next(it)) ^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/generic_call_adapter.py", line 207, in assign new_code=self.context.file._value_to_code(value), ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 37, in _value_to_code return self._token_to_code(value_to_token(value)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format return format_code(text, Path(self._source.filename)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code runner = CliRunner(mix_stderr=False) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' _______________________ test_remove_positional_argument ________________________ def test_remove_positional_argument(): Example( """\ from inline_snapshot import snapshot from inline_snapshot._adapter.generic_call_adapter import GenericCallAdapter,Argument class L: def __init__(self,*l): self.l=l def __eq__(self,other): if not isinstance(other,L): return NotImplemented return other.l==self.l class LAdapter(GenericCallAdapter): @classmethod def check_type(cls, typ): return issubclass(typ,L) @classmethod def arguments(cls, value): return ([Argument(x) for x in value.l],{}) @classmethod def argument(cls, value, pos_or_name): assert isinstance(pos_or_name,int) return value.l[pos_or_name] def test_L1(): assert L(1,2) == snapshot(L(1)), "not equal" def test_L2(): assert L(1,2) == snapshot(L(1, 2, 3)), "not equal" """ > ).run_pytest( ["--inline-snapshot=fix"], changed_files=snapshot( { "test_something.py": """\ from inline_snapshot import snapshot from inline_snapshot._adapter.generic_call_adapter import GenericCallAdapter,Argument class L: def __init__(self,*l): self.l=l def __eq__(self,other): if not isinstance(other,L): return NotImplemented return other.l==self.l class LAdapter(GenericCallAdapter): @classmethod def check_type(cls, typ): return issubclass(typ,L) @classmethod def arguments(cls, value): return ([Argument(x) for x in value.l],{}) @classmethod def argument(cls, value, pos_or_name): assert isinstance(pos_or_name,int) return value.l[pos_or_name] def test_L1(): assert L(1,2) == snapshot(L(1, 2)), "not equal" def test_L2(): assert L(1,2) == snapshot(L(1, 2)), "not equal" """ } ), ) tests/adapter/test_dataclass.py:408: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = args = ['--inline-snapshot=fix'] def run_pytest( self, args: list[str] = [], *, term_columns=80, env: dict[str, str] = {}, changed_files: Snapshot[dict[str, str]] | None = None, report: Snapshot[str] | None = None, stderr: Snapshot[str] | None = None, returncode: Snapshot[int] | None = None, ) -> Example: """Run pytest with the given args and env variables in an seperate process. It can be used to test the interaction between your code and pytest, but it is a bit slower than `run_inline` Parameters: args: pytest arguments like "--inline-snapshot=fix" env: dict of environment variables changed_files: snapshot of files which are changed by this run. report: snapshot of the report at the end of the pytest run. stderr: pytest stderr output returncode: snapshot of the pytest returncode. Returns: A new Example instance which contains the changed files. """ with TemporaryDirectory() as dir: tmp_path = Path(dir) self._write_files(tmp_path) cmd = [sys.executable, "-m", "pytest", *args] command_env = dict(os.environ) command_env["TERM"] = "unknown" command_env["COLUMNS"] = str( term_columns + 1 if platform.system() == "Windows" else term_columns ) command_env.pop("CI", None) command_env.update(env) result = sp.run(cmd, cwd=tmp_path, capture_output=True, env=command_env) print("run>", *cmd) print("stdout:") print(result.stdout.decode()) print("stderr:") print(result.stderr.decode()) if returncode is not None: assert result.returncode == returncode if stderr is not None: assert result.stderr.decode() == stderr if report is not None: report_list = [] record = False for line in result.stdout.decode().splitlines(): line = line.strip() if line.startswith("===="): record = False if record and line: report_list.append(line) if line.startswith("====") and "inline snapshot" in line: record = True report_str = "\n".join(report_list) assert normalize(report_str) == report, repr(report_str) if changed_files is not None: current_files = {} for name, content in sorted(self._read_files(tmp_path).items()): if name not in self.files or self.files[name] != content: current_files[name] = content > assert changed_files == current_files E assert {'test_someth...not equal"\n'} == {} E E Left contains 1 more item: E {'test_something.py': 'from inline_snapshot import snapshot\n' E '\n' E 'from inline_snapshot._adapter.generic_call_adapter ' E 'import GenericCallAdapter,Argument\n' E '\n'... E E ...Full output truncated (30 lines hidden), use '-vv' to show /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:327: AssertionError ----------------------------- Captured stdout call ----------------------------- file: test_something.py from inline_snapshot import snapshot from inline_snapshot._adapter.generic_call_adapter import GenericCallAdapter,Argument class L: def __init__(self,*l): self.l=l def __eq__(self,other): if not isinstance(other,L): return NotImplemented return other.l==self.l class LAdapter(GenericCallAdapter): @classmethod def check_type(cls, typ): return issubclass(typ,L) @classmethod def arguments(cls, value): return ([Argument(x) for x in value.l],{}) @classmethod def argument(cls, value, pos_or_name): assert isinstance(pos_or_name,int) return value.l[pos_or_name] def test_L1(): assert L(1,2) == snapshot(L(1)), "not equal" def test_L2(): assert L(1,2) == snapshot(L(1, 2, 3)), "not equal" run> /usr/bin/python3.12 -m pytest --inline-snapshot=fix stdout: ============================= test session starts ============================== platform linux -- Python 3.12.8, pytest-8.3.4, pluggy-1.5.0 rootdir: /tmp/tmpdx3quyv3 plugins: inline-snapshot-0.19.3, mock-3.14.0, hypothesis-6.124.0, time-machine-2.16.0, subtests-0.13.1, pytest_freezer-0.4.9 collected 2 items test_something.py F. [100%] =================================== FAILURES =================================== ___________________________________ test_L1 ____________________________________ def test_L1(): > assert L(1,2) == snapshot(L(1)), "not equal" test_something.py:30: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/generic_call_adapter.py:162: in assign new_code=self.context.file._value_to_code(value.value), /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code return self._token_to_code(value_to_token(value)) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '2 ', filename = PosixPath('/tmp/tmpdx3quyv3/test_something.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError =============================== inline snapshot ================================ ──────────────────────────────── Fix snapshots ───────────────────────────────── =========================== short test summary info ============================ FAILED test_something.py::test_L1 - TypeError: CliRunner.__init__() got an un... stderr: Traceback (most recent call last): File "", line 198, in _run_module_as_main File "", line 88, in _run_code File "/usr/lib/python3/dist-packages/pytest/__main__.py", line 9, in raise SystemExit(pytest.console_main()) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 201, in console_main code = main() ^^^^^^ File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 175, in main ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec return self._inner_hookexec(hook_name, methods, kwargs, firstresult) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall raise exception.with_traceback(exception.__traceback__) File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall res = hook_impl.function(*args) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/_pytest/main.py", line 330, in pytest_cmdline_main return wrap_session(config, _main) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/_pytest/main.py", line 318, in wrap_session config.hook.pytest_sessionfinish( File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec return self._inner_hookexec(hook_name, methods, kwargs, firstresult) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall raise exception.with_traceback(exception.__traceback__) File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall teardown.throw(exception) # type: ignore[union-attr] ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/_pytest/logging.py", line 868, in pytest_sessionfinish return (yield) ^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 124, in _multicall teardown.send(result) # type: ignore[union-attr] ^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 903, in pytest_sessionfinish self.config.hook.pytest_terminal_summary( File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec return self._inner_hookexec(hook_name, methods, kwargs, firstresult) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall raise exception.with_traceback(exception.__traceback__) File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall teardown.throw(exception) # type: ignore[union-attr] ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 925, in pytest_terminal_summary return (yield) ^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall teardown.throw(exception) # type: ignore[union-attr] ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/_pytest/warnings.py", line 132, in pytest_terminal_summary return (yield) ^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall res = hook_impl.function(*args) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/pytest_plugin.py", line 346, in pytest_terminal_summary diff = file.diff() ^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py", line 195, in diff unified_diff(self.source.splitlines(), self.new_code().splitlines()), ^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py", line 163, in new_code format_whole_file = enforce_formatting() or code == format_code( ^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code runner = CliRunner(mix_stderr=False) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' _______________________________ test_namedtuple ________________________________ def test_namedtuple(): Example( """\ from inline_snapshot import snapshot from collections import namedtuple T=namedtuple("T","a,b") def test_tuple(): assert T(a=1,b=2) == snapshot(T(a=1, b=3)), "not equal" """ > ).run_pytest( ["--inline-snapshot=fix"], changed_files=snapshot( { "test_something.py": """\ from inline_snapshot import snapshot from collections import namedtuple T=namedtuple("T","a,b") def test_tuple(): assert T(a=1,b=2) == snapshot(T(a=1, b=2)), "not equal" """ } ), ) tests/adapter/test_dataclass.py:463: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = args = ['--inline-snapshot=fix'] def run_pytest( self, args: list[str] = [], *, term_columns=80, env: dict[str, str] = {}, changed_files: Snapshot[dict[str, str]] | None = None, report: Snapshot[str] | None = None, stderr: Snapshot[str] | None = None, returncode: Snapshot[int] | None = None, ) -> Example: """Run pytest with the given args and env variables in an seperate process. It can be used to test the interaction between your code and pytest, but it is a bit slower than `run_inline` Parameters: args: pytest arguments like "--inline-snapshot=fix" env: dict of environment variables changed_files: snapshot of files which are changed by this run. report: snapshot of the report at the end of the pytest run. stderr: pytest stderr output returncode: snapshot of the pytest returncode. Returns: A new Example instance which contains the changed files. """ with TemporaryDirectory() as dir: tmp_path = Path(dir) self._write_files(tmp_path) cmd = [sys.executable, "-m", "pytest", *args] command_env = dict(os.environ) command_env["TERM"] = "unknown" command_env["COLUMNS"] = str( term_columns + 1 if platform.system() == "Windows" else term_columns ) command_env.pop("CI", None) command_env.update(env) result = sp.run(cmd, cwd=tmp_path, capture_output=True, env=command_env) print("run>", *cmd) print("stdout:") print(result.stdout.decode()) print("stderr:") print(result.stderr.decode()) if returncode is not None: assert result.returncode == returncode if stderr is not None: assert result.stderr.decode() == stderr if report is not None: report_list = [] record = False for line in result.stdout.decode().splitlines(): line = line.strip() if line.startswith("===="): record = False if record and line: report_list.append(line) if line.startswith("====") and "inline snapshot" in line: record = True report_str = "\n".join(report_list) assert normalize(report_str) == report, repr(report_str) if changed_files is not None: current_files = {} for name, content in sorted(self._read_files(tmp_path).items()): if name not in self.files or self.files[name] != content: current_files[name] = content > assert changed_files == current_files E assert {'test_someth...not equal"\n'} == {} E E Left contains 1 more item: E {'test_something.py': 'from inline_snapshot import snapshot\n' E 'from collections import namedtuple\n' E '\n' E 'T=namedtuple("T","a,b")\n' E '\n'... E E ...Full output truncated (4 lines hidden), use '-vv' to show /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:327: AssertionError ----------------------------- Captured stdout call ----------------------------- file: test_something.py from inline_snapshot import snapshot from collections import namedtuple T=namedtuple("T","a,b") def test_tuple(): assert T(a=1,b=2) == snapshot(T(a=1, b=3)), "not equal" run> /usr/bin/python3.12 -m pytest --inline-snapshot=fix stdout: ============================= test session starts ============================== platform linux -- Python 3.12.8, pytest-8.3.4, pluggy-1.5.0 rootdir: /tmp/tmpq2ezkcag plugins: inline-snapshot-0.19.3, mock-3.14.0, hypothesis-6.124.0, time-machine-2.16.0, subtests-0.13.1, pytest_freezer-0.4.9 collected 1 item test_something.py F [100%] =================================== FAILURES =================================== __________________________________ test_tuple __________________________________ def test_tuple(): > assert T(a=1,b=2) == snapshot(T(a=1, b=3)), "not equal" test_something.py:7: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/generic_call_adapter.py:194: in assign result_kwargs[key] = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '2 ', filename = PosixPath('/tmp/tmpq2ezkcag/test_something.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError =============================== inline snapshot ================================ =========================== short test summary info ============================ FAILED test_something.py::test_tuple - TypeError: CliRunner.__init__() got an... ============================== 1 failed in 0.12s =============================== stderr: _______________________________ test_defaultdict _______________________________ def test_defaultdict(): Example( """\ from inline_snapshot import snapshot from collections import defaultdict def test_tuple(): d=defaultdict(list) d[1].append(2) assert d == snapshot(defaultdict(list, {1: [3]})), "not equal" """ > ).run_pytest( ["--inline-snapshot=fix"], changed_files=snapshot( { "test_something.py": """\ from inline_snapshot import snapshot from collections import defaultdict def test_tuple(): d=defaultdict(list) d[1].append(2) assert d == snapshot(defaultdict(list, {1: [2]})), "not equal" """ } ), ) tests/adapter/test_dataclass.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = args = ['--inline-snapshot=fix'] def run_pytest( self, args: list[str] = [], *, term_columns=80, env: dict[str, str] = {}, changed_files: Snapshot[dict[str, str]] | None = None, report: Snapshot[str] | None = None, stderr: Snapshot[str] | None = None, returncode: Snapshot[int] | None = None, ) -> Example: """Run pytest with the given args and env variables in an seperate process. It can be used to test the interaction between your code and pytest, but it is a bit slower than `run_inline` Parameters: args: pytest arguments like "--inline-snapshot=fix" env: dict of environment variables changed_files: snapshot of files which are changed by this run. report: snapshot of the report at the end of the pytest run. stderr: pytest stderr output returncode: snapshot of the pytest returncode. Returns: A new Example instance which contains the changed files. """ with TemporaryDirectory() as dir: tmp_path = Path(dir) self._write_files(tmp_path) cmd = [sys.executable, "-m", "pytest", *args] command_env = dict(os.environ) command_env["TERM"] = "unknown" command_env["COLUMNS"] = str( term_columns + 1 if platform.system() == "Windows" else term_columns ) command_env.pop("CI", None) command_env.update(env) result = sp.run(cmd, cwd=tmp_path, capture_output=True, env=command_env) print("run>", *cmd) print("stdout:") print(result.stdout.decode()) print("stderr:") print(result.stderr.decode()) if returncode is not None: assert result.returncode == returncode if stderr is not None: assert result.stderr.decode() == stderr if report is not None: report_list = [] record = False for line in result.stdout.decode().splitlines(): line = line.strip() if line.startswith("===="): record = False if record and line: report_list.append(line) if line.startswith("====") and "inline snapshot" in line: record = True report_str = "\n".join(report_list) assert normalize(report_str) == report, repr(report_str) if changed_files is not None: current_files = {} for name, content in sorted(self._read_files(tmp_path).items()): if name not in self.files or self.files[name] != content: current_files[name] = content > assert changed_files == current_files E assert {'test_someth...not equal"\n'} == {} E E Left contains 1 more item: E {'test_something.py': 'from inline_snapshot import snapshot\n' E 'from collections import defaultdict\n' E '\n' E '\n' E 'def test_tuple():\n'... E E ...Full output truncated (5 lines hidden), use '-vv' to show /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:327: AssertionError ----------------------------- Captured stdout call ----------------------------- file: test_something.py from inline_snapshot import snapshot from collections import defaultdict def test_tuple(): d=defaultdict(list) d[1].append(2) assert d == snapshot(defaultdict(list, {1: [3]})), "not equal" run> /usr/bin/python3.12 -m pytest --inline-snapshot=fix stdout: ============================= test session starts ============================== platform linux -- Python 3.12.8, pytest-8.3.4, pluggy-1.5.0 rootdir: /tmp/tmp1dvk2mrr plugins: inline-snapshot-0.19.3, mock-3.14.0, hypothesis-6.124.0, time-machine-2.16.0, subtests-0.13.1, pytest_freezer-0.4.9 collected 1 item test_something.py F [100%] =================================== FAILURES =================================== __________________________________ test_tuple __________________________________ def test_tuple(): d=defaultdict(list) d[1].append(2) > assert d == snapshot(defaultdict(list, {1: [3]})), "not equal" test_something.py:8: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/generic_call_adapter.py:140: in assign result = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign result[key] = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign v = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '2 ', filename = PosixPath('/tmp/tmp1dvk2mrr/test_something.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError =============================== inline snapshot ================================ =========================== short test summary info ============================ FAILED test_something.py::test_tuple - TypeError: CliRunner.__init__() got an... ============================== 1 failed in 0.13s =============================== stderr: __________________________ test_dataclass_field_repr ___________________________ def test_dataclass_field_repr(): Example( """\ from inline_snapshot import snapshot from dataclasses import dataclass,field @dataclass class container: a: int b: int = field(default=5,repr=False) assert container(a=1,b=5) == snapshot() """ > ).run_inline( ["--inline-snapshot=create"], changed_files=snapshot( { "test_something.py": """\ from inline_snapshot import snapshot from dataclasses import dataclass,field @dataclass class container: a: int b: int = field(default=5,repr=False) assert container(a=1,b=5) == snapshot(container(a=1)) """ } ), ).run_inline() tests/adapter/test_dataclass.py:526: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = args = ['--inline-snapshot=create'] def run_inline( self, args: list[str] = [], *, reported_categories: Snapshot[list[Category]] | None = None, changed_files: Snapshot[dict[str, str]] | None = None, report: Snapshot[str] | None = None, raises: Snapshot[str] | None = None, ) -> Example: """Execute the example files in process and run every `test_*` function. This is useful for fast test execution. Parameters: args: inline-snapshot arguments (supports only "--inline-snapshot=fix|create|..." ). reported_categories: snapshot of categories which inline-snapshot thinks could be applied. changed_files: snapshot of files which are changed by this run. raises: snapshot of the exception which is raised during the test execution. It is required if your code raises an exception. Returns: A new Example instance which contains the changed files. """ parser = ArgumentParser() parser.add_argument( "--inline-snapshot", metavar="(disable,short-report,report,review,create,update,trim,fix)*", dest="inline_snapshot", help="update specific snapshot values:\n" "disable: disable the snapshot logic\n" "short-report: show a short report\n" "report: show a longer report with a diff report\n" "review: allow to approve the changes interactive\n" "create: creates snapshots which are currently not defined\n" "update: update snapshots even if they are defined\n" "trim: changes the snapshot in a way which will make the snapshot more precise.\n" "fix: change snapshots which currently break your tests\n", ) parsed_args = parser.parse_args(args) flags = (parsed_args.inline_snapshot or "").split(",") with TemporaryDirectory() as dir: tmp_path = Path(dir) self._write_files(tmp_path) raised_exception = None with snapshot_env(): with ChangeRecorder().activate() as recorder: _inline_snapshot._update_flags = Flags({*flags}) inline_snapshot._external.storage = ( inline_snapshot._external.DiscStorage(tmp_path / ".storage") ) try: for filename in tmp_path.glob("*.py"): globals: dict[str, Any] = {} print("run> pytest", filename) exec( compile(filename.read_text("utf-8"), filename, "exec"), globals, ) # run all test_* functions for k, v in globals.items(): if k.startswith("test_") and callable(v): v() except Exception as e: traceback.print_exc() raised_exception = e finally: _inline_snapshot._active = False changes = [] for snapshot in _inline_snapshot.snapshots.values(): changes += snapshot._changes() snapshot_flags = {change.flag for change in changes} apply_all( [ change for change in changes if change.flag in _inline_snapshot._update_flags.to_set() ] ) recorder.fix_all() report_output = StringIO() console = Console(file=report_output) # TODO: add all the report output here report_problems(console) if reported_categories is not None: assert sorted(snapshot_flags) == reported_categories if raised_exception is not None: > assert raises == f"{type(raised_exception).__name__}:\n" + str( raised_exception ) E assert None == ('TypeError:\n' + "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'") E + where "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'" = str(TypeError("CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'")) /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: AssertionError ----------------------------- Captured stdout call ----------------------------- file: test_something.py from inline_snapshot import snapshot from dataclasses import dataclass,field @dataclass class container: a: int b: int = field(default=5,repr=False) assert container(a=1,b=5) == snapshot() run> pytest /tmp/tmp8ulr3p8s/test_something.py ----------------------------- Captured stderr call ----------------------------- Traceback (most recent call last): File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 185, in run_inline exec( File "/tmp/tmp8ulr3p8s/test_something.py", line 9, in assert container(a=1,b=5) == snapshot() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ return self == other ^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ self._changes.append(next(it)) ^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign new_code = self.context.file._token_to_code(new_token) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format return format_code(text, Path(self._source.filename)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code runner = CliRunner(mix_stderr=False) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' ______________________________ test_dataclass_var ______________________________ def test_dataclass_var(): Example( """\ from inline_snapshot import snapshot,Is from dataclasses import dataclass,field @dataclass class container: a: int def test_list(): l=container(5) assert l == snapshot(l), "not equal" """ > ).run_inline( ["--inline-snapshot=update"], changed_files=snapshot( { "test_something.py": """\ from inline_snapshot import snapshot,Is from dataclasses import dataclass,field @dataclass class container: a: int def test_list(): l=container(5) assert l == snapshot(container(a=5)), "not equal" """ } ), ) tests/adapter/test_dataclass.py:561: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = args = ['--inline-snapshot=update'] def run_inline( self, args: list[str] = [], *, reported_categories: Snapshot[list[Category]] | None = None, changed_files: Snapshot[dict[str, str]] | None = None, report: Snapshot[str] | None = None, raises: Snapshot[str] | None = None, ) -> Example: """Execute the example files in process and run every `test_*` function. This is useful for fast test execution. Parameters: args: inline-snapshot arguments (supports only "--inline-snapshot=fix|create|..." ). reported_categories: snapshot of categories which inline-snapshot thinks could be applied. changed_files: snapshot of files which are changed by this run. raises: snapshot of the exception which is raised during the test execution. It is required if your code raises an exception. Returns: A new Example instance which contains the changed files. """ parser = ArgumentParser() parser.add_argument( "--inline-snapshot", metavar="(disable,short-report,report,review,create,update,trim,fix)*", dest="inline_snapshot", help="update specific snapshot values:\n" "disable: disable the snapshot logic\n" "short-report: show a short report\n" "report: show a longer report with a diff report\n" "review: allow to approve the changes interactive\n" "create: creates snapshots which are currently not defined\n" "update: update snapshots even if they are defined\n" "trim: changes the snapshot in a way which will make the snapshot more precise.\n" "fix: change snapshots which currently break your tests\n", ) parsed_args = parser.parse_args(args) flags = (parsed_args.inline_snapshot or "").split(",") with TemporaryDirectory() as dir: tmp_path = Path(dir) self._write_files(tmp_path) raised_exception = None with snapshot_env(): with ChangeRecorder().activate() as recorder: _inline_snapshot._update_flags = Flags({*flags}) inline_snapshot._external.storage = ( inline_snapshot._external.DiscStorage(tmp_path / ".storage") ) try: for filename in tmp_path.glob("*.py"): globals: dict[str, Any] = {} print("run> pytest", filename) exec( compile(filename.read_text("utf-8"), filename, "exec"), globals, ) # run all test_* functions for k, v in globals.items(): if k.startswith("test_") and callable(v): v() except Exception as e: traceback.print_exc() raised_exception = e finally: _inline_snapshot._active = False changes = [] for snapshot in _inline_snapshot.snapshots.values(): changes += snapshot._changes() snapshot_flags = {change.flag for change in changes} apply_all( [ change for change in changes if change.flag in _inline_snapshot._update_flags.to_set() ] ) recorder.fix_all() report_output = StringIO() console = Console(file=report_output) # TODO: add all the report output here report_problems(console) if reported_categories is not None: assert sorted(snapshot_flags) == reported_categories if raised_exception is not None: > assert raises == f"{type(raised_exception).__name__}:\n" + str( raised_exception ) E assert None == ('TypeError:\n' + "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'") E + where "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'" = str(TypeError("CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'")) /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: AssertionError ----------------------------- Captured stdout call ----------------------------- file: test_something.py from inline_snapshot import snapshot,Is from dataclasses import dataclass,field @dataclass class container: a: int def test_list(): l=container(5) assert l == snapshot(l), "not equal" run> pytest /tmp/tmpnss1p7k6/test_something.py ----------------------------- Captured stderr call ----------------------------- Traceback (most recent call last): File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 193, in run_inline v() File "/tmp/tmpnss1p7k6/test_something.py", line 10, in test_list assert l == snapshot(l), "not equal" ^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ return self == other ^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ self._changes.append(next(it)) ^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/generic_call_adapter.py", line 101, in assign result = yield from self.value_assign(old_value, old_node, new_value) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/adapter.py", line 87, in value_assign result = yield from adapter.assign(old_value, old_node, new_value) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign new_code = self.context.file._token_to_code(new_token) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format return format_code(text, Path(self._source.filename)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code runner = CliRunner(mix_stderr=False) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' ________________________________ test_dict_var _________________________________ def test_dict_var(): Example( """\ from inline_snapshot import snapshot,Is def test_list(): l={1:2} assert l == snapshot(l), "not equal" """ > ).run_inline( ["--inline-snapshot=update"], changed_files=snapshot( { "test_something.py": """\ from inline_snapshot import snapshot,Is def test_list(): l={1:2} assert l == snapshot({1: 2}), "not equal" """ } ), ) tests/adapter/test_dict.py:15: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = args = ['--inline-snapshot=update'] def run_inline( self, args: list[str] = [], *, reported_categories: Snapshot[list[Category]] | None = None, changed_files: Snapshot[dict[str, str]] | None = None, report: Snapshot[str] | None = None, raises: Snapshot[str] | None = None, ) -> Example: """Execute the example files in process and run every `test_*` function. This is useful for fast test execution. Parameters: args: inline-snapshot arguments (supports only "--inline-snapshot=fix|create|..." ). reported_categories: snapshot of categories which inline-snapshot thinks could be applied. changed_files: snapshot of files which are changed by this run. raises: snapshot of the exception which is raised during the test execution. It is required if your code raises an exception. Returns: A new Example instance which contains the changed files. """ parser = ArgumentParser() parser.add_argument( "--inline-snapshot", metavar="(disable,short-report,report,review,create,update,trim,fix)*", dest="inline_snapshot", help="update specific snapshot values:\n" "disable: disable the snapshot logic\n" "short-report: show a short report\n" "report: show a longer report with a diff report\n" "review: allow to approve the changes interactive\n" "create: creates snapshots which are currently not defined\n" "update: update snapshots even if they are defined\n" "trim: changes the snapshot in a way which will make the snapshot more precise.\n" "fix: change snapshots which currently break your tests\n", ) parsed_args = parser.parse_args(args) flags = (parsed_args.inline_snapshot or "").split(",") with TemporaryDirectory() as dir: tmp_path = Path(dir) self._write_files(tmp_path) raised_exception = None with snapshot_env(): with ChangeRecorder().activate() as recorder: _inline_snapshot._update_flags = Flags({*flags}) inline_snapshot._external.storage = ( inline_snapshot._external.DiscStorage(tmp_path / ".storage") ) try: for filename in tmp_path.glob("*.py"): globals: dict[str, Any] = {} print("run> pytest", filename) exec( compile(filename.read_text("utf-8"), filename, "exec"), globals, ) # run all test_* functions for k, v in globals.items(): if k.startswith("test_") and callable(v): v() except Exception as e: traceback.print_exc() raised_exception = e finally: _inline_snapshot._active = False changes = [] for snapshot in _inline_snapshot.snapshots.values(): changes += snapshot._changes() snapshot_flags = {change.flag for change in changes} apply_all( [ change for change in changes if change.flag in _inline_snapshot._update_flags.to_set() ] ) recorder.fix_all() report_output = StringIO() console = Console(file=report_output) # TODO: add all the report output here report_problems(console) if reported_categories is not None: assert sorted(snapshot_flags) == reported_categories if raised_exception is not None: > assert raises == f"{type(raised_exception).__name__}:\n" + str( raised_exception ) E assert None == ('TypeError:\n' + "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'") E + where "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'" = str(TypeError("CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'")) /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: AssertionError ----------------------------- Captured stdout call ----------------------------- file: test_something.py from inline_snapshot import snapshot,Is def test_list(): l={1:2} assert l == snapshot(l), "not equal" run> pytest /tmp/tmppwtn7klh/test_something.py ----------------------------- Captured stderr call ----------------------------- Traceback (most recent call last): File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 193, in run_inline v() File "/tmp/tmppwtn7klh/test_something.py", line 5, in test_list assert l == snapshot(l), "not equal" ^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ return self == other ^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ self._changes.append(next(it)) ^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py", line 62, in assign result = yield from self.value_assign(old_value, old_node, new_value) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/adapter.py", line 87, in value_assign result = yield from adapter.assign(old_value, old_node, new_value) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign new_code = self.context.file._token_to_code(new_token) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format return format_code(text, Path(self._source.filename)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code runner = CliRunner(mix_stderr=False) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' ____________________________ test_adapter_mismatch _____________________________ def test_adapter_mismatch(): Example( """\ from inline_snapshot import snapshot def test_thing(): assert [1,2] == snapshot({1:2}) """ > ).run_inline( ["--inline-snapshot=fix"], changed_files=snapshot( { "test_something.py": """\ from inline_snapshot import snapshot def test_thing(): assert [1,2] == snapshot([1, 2]) \ """ } ), ) tests/adapter/test_general.py:16: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = args = ['--inline-snapshot=fix'] def run_inline( self, args: list[str] = [], *, reported_categories: Snapshot[list[Category]] | None = None, changed_files: Snapshot[dict[str, str]] | None = None, report: Snapshot[str] | None = None, raises: Snapshot[str] | None = None, ) -> Example: """Execute the example files in process and run every `test_*` function. This is useful for fast test execution. Parameters: args: inline-snapshot arguments (supports only "--inline-snapshot=fix|create|..." ). reported_categories: snapshot of categories which inline-snapshot thinks could be applied. changed_files: snapshot of files which are changed by this run. raises: snapshot of the exception which is raised during the test execution. It is required if your code raises an exception. Returns: A new Example instance which contains the changed files. """ parser = ArgumentParser() parser.add_argument( "--inline-snapshot", metavar="(disable,short-report,report,review,create,update,trim,fix)*", dest="inline_snapshot", help="update specific snapshot values:\n" "disable: disable the snapshot logic\n" "short-report: show a short report\n" "report: show a longer report with a diff report\n" "review: allow to approve the changes interactive\n" "create: creates snapshots which are currently not defined\n" "update: update snapshots even if they are defined\n" "trim: changes the snapshot in a way which will make the snapshot more precise.\n" "fix: change snapshots which currently break your tests\n", ) parsed_args = parser.parse_args(args) flags = (parsed_args.inline_snapshot or "").split(",") with TemporaryDirectory() as dir: tmp_path = Path(dir) self._write_files(tmp_path) raised_exception = None with snapshot_env(): with ChangeRecorder().activate() as recorder: _inline_snapshot._update_flags = Flags({*flags}) inline_snapshot._external.storage = ( inline_snapshot._external.DiscStorage(tmp_path / ".storage") ) try: for filename in tmp_path.glob("*.py"): globals: dict[str, Any] = {} print("run> pytest", filename) exec( compile(filename.read_text("utf-8"), filename, "exec"), globals, ) # run all test_* functions for k, v in globals.items(): if k.startswith("test_") and callable(v): v() except Exception as e: traceback.print_exc() raised_exception = e finally: _inline_snapshot._active = False changes = [] for snapshot in _inline_snapshot.snapshots.values(): changes += snapshot._changes() snapshot_flags = {change.flag for change in changes} apply_all( [ change for change in changes if change.flag in _inline_snapshot._update_flags.to_set() ] ) recorder.fix_all() report_output = StringIO() console = Console(file=report_output) # TODO: add all the report output here report_problems(console) if reported_categories is not None: assert sorted(snapshot_flags) == reported_categories if raised_exception is not None: > assert raises == f"{type(raised_exception).__name__}:\n" + str( raised_exception ) E assert None == ('TypeError:\n' + "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'") E + where "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'" = str(TypeError("CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'")) /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: AssertionError ----------------------------- Captured stdout call ----------------------------- file: test_something.py from inline_snapshot import snapshot def test_thing(): assert [1,2] == snapshot({1:2}) run> pytest /tmp/tmp4zw31s9u/test_something.py ----------------------------- Captured stderr call ----------------------------- Traceback (most recent call last): File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 193, in run_inline v() File "/tmp/tmp4zw31s9u/test_something.py", line 5, in test_thing assert [1,2] == snapshot({1:2}) ^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ return self == other ^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ self._changes.append(next(it)) ^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign new_code = self.context.file._token_to_code(new_token) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format return format_code(text, Path(self._source.filename)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code runner = CliRunner(mix_stderr=False) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' ___________________ test_list_adapter_create_inner_snapshot ____________________ def test_list_adapter_create_inner_snapshot(): Example( """\ from inline_snapshot import snapshot from dirty_equals import IsInt def test_list(): assert [1,2,3,4] == snapshot([1,IsInt(),snapshot(),4]),"not equal" """ > ).run_inline( ["--inline-snapshot=create"], changed_files=snapshot( { "test_something.py": """\ from inline_snapshot import snapshot from dirty_equals import IsInt def test_list(): assert [1,2,3,4] == snapshot([1,IsInt(),snapshot(3),4]),"not equal" """ } ), raises=snapshot(None), ) tests/adapter/test_sequence.py:17: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: in run_inline assert raises == f"{type(raised_exception).__name__}:\n" + str( /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '"""\\\nTypeError:\nCliRunner.__init__() got an unexpected keyword argument \'mix_stderr\'\\\n"""' filename = PosixPath('/tmp/autopkgtest.ImMzGl/autopkgtest_tmp/tests/adapter/test_sequence.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- file: test_something.py from inline_snapshot import snapshot from dirty_equals import IsInt def test_list(): assert [1,2,3,4] == snapshot([1,IsInt(),snapshot(),4]),"not equal" run> pytest /tmp/tmpbbu9v_gl/test_something.py ----------------------------- Captured stderr call ----------------------------- Traceback (most recent call last): File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 193, in run_inline v() File "/tmp/tmpbbu9v_gl/test_something.py", line 6, in test_list assert [1,2,3,4] == snapshot([1,IsInt(),snapshot(),4]),"not equal" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ return self == other ^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 280, in __eq__ return _return(self._visible_value() == other) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_unmanaged.py", line 44, in __eq__ return self.value == other ^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ self._changes.append(next(it)) ^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign new_code = self.context.file._token_to_code(new_token) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format return format_code(text, Path(self._source.filename)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code runner = CliRunner(mix_stderr=False) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' _____________________ test_list_adapter_fix_inner_snapshot _____________________ def test_list_adapter_fix_inner_snapshot(): Example( """\ from inline_snapshot import snapshot from dirty_equals import IsInt def test_list(): assert [1,2,3,4] == snapshot([1,IsInt(),snapshot(8),4]),"not equal" """ > ).run_inline( ["--inline-snapshot=fix"], changed_files=snapshot( { "test_something.py": """\ from inline_snapshot import snapshot from dirty_equals import IsInt def test_list(): assert [1,2,3,4] == snapshot([1,IsInt(),snapshot(3),4]),"not equal" """ } ), raises=snapshot(None), ) tests/adapter/test_sequence.py:46: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: in run_inline assert raises == f"{type(raised_exception).__name__}:\n" + str( /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '"""\\\nTypeError:\nCliRunner.__init__() got an unexpected keyword argument \'mix_stderr\'\\\n"""' filename = PosixPath('/tmp/autopkgtest.ImMzGl/autopkgtest_tmp/tests/adapter/test_sequence.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- file: test_something.py from inline_snapshot import snapshot from dirty_equals import IsInt def test_list(): assert [1,2,3,4] == snapshot([1,IsInt(),snapshot(8),4]),"not equal" run> pytest /tmp/tmp96vlgc41/test_something.py ----------------------------- Captured stderr call ----------------------------- Traceback (most recent call last): File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 193, in run_inline v() File "/tmp/tmp96vlgc41/test_something.py", line 6, in test_list assert [1,2,3,4] == snapshot([1,IsInt(),snapshot(8),4]),"not equal" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ return self == other ^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 280, in __eq__ return _return(self._visible_value() == other) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_unmanaged.py", line 44, in __eq__ return self.value == other ^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ self._changes.append(next(it)) ^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign new_code = self.context.file._token_to_code(new_token) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format return format_code(text, Path(self._source.filename)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code runner = CliRunner(mix_stderr=False) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' ________________________________ test_list_var _________________________________ def test_list_var(): Example( """\ from inline_snapshot import snapshot,Is def test_list(): l=[1] assert l == snapshot(l), "not equal" """ > ).run_inline( ["--inline-snapshot=update"], changed_files=snapshot( { "test_something.py": """\ from inline_snapshot import snapshot,Is def test_list(): l=[1] assert l == snapshot([1]), "not equal" """ } ), ) tests/adapter/test_sequence.py:92: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = args = ['--inline-snapshot=update'] def run_inline( self, args: list[str] = [], *, reported_categories: Snapshot[list[Category]] | None = None, changed_files: Snapshot[dict[str, str]] | None = None, report: Snapshot[str] | None = None, raises: Snapshot[str] | None = None, ) -> Example: """Execute the example files in process and run every `test_*` function. This is useful for fast test execution. Parameters: args: inline-snapshot arguments (supports only "--inline-snapshot=fix|create|..." ). reported_categories: snapshot of categories which inline-snapshot thinks could be applied. changed_files: snapshot of files which are changed by this run. raises: snapshot of the exception which is raised during the test execution. It is required if your code raises an exception. Returns: A new Example instance which contains the changed files. """ parser = ArgumentParser() parser.add_argument( "--inline-snapshot", metavar="(disable,short-report,report,review,create,update,trim,fix)*", dest="inline_snapshot", help="update specific snapshot values:\n" "disable: disable the snapshot logic\n" "short-report: show a short report\n" "report: show a longer report with a diff report\n" "review: allow to approve the changes interactive\n" "create: creates snapshots which are currently not defined\n" "update: update snapshots even if they are defined\n" "trim: changes the snapshot in a way which will make the snapshot more precise.\n" "fix: change snapshots which currently break your tests\n", ) parsed_args = parser.parse_args(args) flags = (parsed_args.inline_snapshot or "").split(",") with TemporaryDirectory() as dir: tmp_path = Path(dir) self._write_files(tmp_path) raised_exception = None with snapshot_env(): with ChangeRecorder().activate() as recorder: _inline_snapshot._update_flags = Flags({*flags}) inline_snapshot._external.storage = ( inline_snapshot._external.DiscStorage(tmp_path / ".storage") ) try: for filename in tmp_path.glob("*.py"): globals: dict[str, Any] = {} print("run> pytest", filename) exec( compile(filename.read_text("utf-8"), filename, "exec"), globals, ) # run all test_* functions for k, v in globals.items(): if k.startswith("test_") and callable(v): v() except Exception as e: traceback.print_exc() raised_exception = e finally: _inline_snapshot._active = False changes = [] for snapshot in _inline_snapshot.snapshots.values(): changes += snapshot._changes() snapshot_flags = {change.flag for change in changes} apply_all( [ change for change in changes if change.flag in _inline_snapshot._update_flags.to_set() ] ) recorder.fix_all() report_output = StringIO() console = Console(file=report_output) # TODO: add all the report output here report_problems(console) if reported_categories is not None: assert sorted(snapshot_flags) == reported_categories if raised_exception is not None: > assert raises == f"{type(raised_exception).__name__}:\n" + str( raised_exception ) E assert None == ('TypeError:\n' + "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'") E + where "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'" = str(TypeError("CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'")) /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: AssertionError ----------------------------- Captured stdout call ----------------------------- file: test_something.py from inline_snapshot import snapshot,Is def test_list(): l=[1] assert l == snapshot(l), "not equal" run> pytest /tmp/tmpgi4j9zut/test_something.py ----------------------------- Captured stderr call ----------------------------- Traceback (most recent call last): File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 193, in run_inline v() File "/tmp/tmpgi4j9zut/test_something.py", line 5, in test_list assert l == snapshot(l), "not equal" ^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ return self == other ^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ self._changes.append(next(it)) ^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py", line 52, in assign result = yield from self.value_assign(old_value, old_node, new_value) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/adapter.py", line 87, in value_assign result = yield from adapter.assign(old_value, old_node, new_value) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign new_code = self.context.file._token_to_code(new_token) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format return format_code(text, Path(self._source.filename)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code runner = CliRunner(mix_stderr=False) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' __________________________ test_change_function_args ___________________________ check_change = .w at 0x7f6a3fa7f7e0> def test_change_function_args(check_change): > check_change( "f(a,b=2)", lambda source, call: [ Replace( flag="fix", file=source, node=call.args[0], new_code="22", old_value=0, new_value=0, ) ], snapshot("f(22,b=2)"), ) tests/test_change.py:48: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/test_change.py:37: in w cr.virtual_write() /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:244: in virtual_write file.virtual_write() /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:141: in virtual_write self.source = self.new_code() /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code format_whole_file = enforce_formatting() or code == format_code( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = 'f(a,b=2)' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_change_function_args0/test_0.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- test: f(a,b=2) __________________________________ test_enum ___________________________________ check_update = .w at 0x7f6a3fa7c860> def test_enum(check_update): assert ( > check_update( """ from enum import Enum class color(Enum): val="val" assert [color.val] == snapshot() """, flags="create", ) == snapshot( """\ from enum import Enum class color(Enum): val="val" assert [color.val] == snapshot([color.val]) """ ) ) tests/test_code_repr.py:15: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:49: in w s = source(source_code) tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_enum0/test_1.py:16: in assert [color.val] == snapshot() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_enum0/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | | |from enum import Enum | |class color(Enum): | val="val" | | |assert [color.val] == snapshot() | _______________________ test_snapshot_generates_hasrepr ________________________ def test_snapshot_generates_hasrepr(): Example( """\ from inline_snapshot import snapshot class Thing: def __repr__(self): return "" def __eq__(self,other): if not isinstance(other,Thing): return NotImplemented return True def test_thing(): assert Thing() == snapshot() """ > ).run_pytest( ["--inline-snapshot=create"], returncode=snapshot(0), changed_files=snapshot( { "test_something.py": """\ from inline_snapshot import snapshot from inline_snapshot import HasRepr class Thing: def __repr__(self): return "" def __eq__(self,other): if not isinstance(other,Thing): return NotImplemented return True def test_thing(): assert Thing() == snapshot(HasRepr(Thing, "")) \ """ } ), ).run_pytest( ["--inline-snapshot=disable"], returncode=0 ).run_pytest( returncode=0 ) tests/test_code_repr.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:297: in run_pytest assert result.returncode == returncode /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '1 ' filename = PosixPath('/tmp/autopkgtest.ImMzGl/autopkgtest_tmp/tests/test_code_repr.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- file: test_something.py from inline_snapshot import snapshot class Thing: def __repr__(self): return "" def __eq__(self,other): if not isinstance(other,Thing): return NotImplemented return True def test_thing(): assert Thing() == snapshot() run> /usr/bin/python3.12 -m pytest --inline-snapshot=create stdout: ============================= test session starts ============================== platform linux -- Python 3.12.8, pytest-8.3.4, pluggy-1.5.0 rootdir: /tmp/tmpkotk7kg8 plugins: inline-snapshot-0.19.3, mock-3.14.0, hypothesis-6.124.0, time-machine-2.16.0, subtests-0.13.1, pytest_freezer-0.4.9 collected 1 item test_something.py F [100%] =================================== FAILURES =================================== __________________________________ test_thing __________________________________ def test_thing(): > assert Thing() == snapshot() test_something.py:13: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '', filename = PosixPath('/tmp/tmpkotk7kg8/test_something.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError =============================== inline snapshot ================================ =========================== short test summary info ============================ FAILED test_something.py::test_thing - TypeError: CliRunner.__init__() got an... ============================== 1 failed in 0.12s =============================== stderr: ____________________________ test_enum_in_dataclass ____________________________ check_update = .w at 0x7f6a3fa7e2a0> def test_enum_in_dataclass(check_update): assert ( > check_update( """ from enum import Enum from dataclasses import dataclass class color(Enum): red="red" blue="blue" @dataclass class container: bg: color=color.red fg: color=color.blue assert container(bg=color.red,fg=color.red) == snapshot() """, flags="create", ) == snapshot( """\ from enum import Enum from dataclasses import dataclass class color(Enum): red="red" blue="blue" @dataclass class container: bg: color=color.red fg: color=color.blue assert container(bg=color.red,fg=color.red) == snapshot(container(fg=color.red)) """ ) ) tests/test_code_repr.py:106: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:49: in w s = source(source_code) tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_enum_in_dataclass0/test_1.py:22: in assert container(bg=color.red,fg=color.red) == snapshot() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_enum_in_dataclass0/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | | |from enum import Enum |from dataclasses import dataclass | |class color(Enum): | red="red" | blue="blue" | |@dataclass |class container: | bg: color=color.red | fg: color=color.blue | |assert container(bg=color.red,fg=color.red) == snapshot() | __________________________________ test_flag ___________________________________ check_update = .w at 0x7f6a3fa7cb80> def test_flag(check_update): assert ( > check_update( """ from enum import Flag, auto class Color(Flag): red = auto() green = auto() blue = auto() assert Color.red | Color.blue == snapshot() """, flags="create", ) == snapshot( """\ from enum import Flag, auto class Color(Flag): red = auto() green = auto() blue = auto() assert Color.red | Color.blue == snapshot(Color.red | Color.blue) """ ) ) tests/test_code_repr.py:150: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:49: in w s = source(source_code) tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_flag0/test_1.py:17: in assert Color.red | Color.blue == snapshot() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_flag0/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | | |from enum import Flag, auto | |class Color(Flag): | red = auto() | green = auto() | blue = auto() | |assert Color.red | Color.blue == snapshot() | __________________________________ test_type ___________________________________ check_update = .w at 0x7f6a3fa7fd80> def test_type(check_update): assert ( > check_update( """\ class Color: pass assert [Color,int] == snapshot() """, flags="create", ) == snapshot( """\ class Color: pass assert [Color,int] == snapshot([Color, int]) """ ) ) tests/test_code_repr.py:184: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:49: in w s = source(source_code) tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_type0/test_1.py:12: in assert [Color,int] == snapshot() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_type0/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |class Color: | pass | |assert [Color,int] == snapshot() | ________________________________ test_qualname _________________________________ def test_qualname(): Example( """\ from enum import Enum from inline_snapshot import snapshot class Namespace: class Color(Enum): red="red" assert Namespace.Color.red == snapshot() """ > ).run_inline( ["--inline-snapshot=create"], changed_files=snapshot( { "test_something.py": """\ from enum import Enum from inline_snapshot import snapshot class Namespace: class Color(Enum): red="red" assert Namespace.Color.red == snapshot(Namespace.Color.red) \ """ } ), ).run_inline() tests/test_code_repr.py:221: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = args = ['--inline-snapshot=create'] def run_inline( self, args: list[str] = [], *, reported_categories: Snapshot[list[Category]] | None = None, changed_files: Snapshot[dict[str, str]] | None = None, report: Snapshot[str] | None = None, raises: Snapshot[str] | None = None, ) -> Example: """Execute the example files in process and run every `test_*` function. This is useful for fast test execution. Parameters: args: inline-snapshot arguments (supports only "--inline-snapshot=fix|create|..." ). reported_categories: snapshot of categories which inline-snapshot thinks could be applied. changed_files: snapshot of files which are changed by this run. raises: snapshot of the exception which is raised during the test execution. It is required if your code raises an exception. Returns: A new Example instance which contains the changed files. """ parser = ArgumentParser() parser.add_argument( "--inline-snapshot", metavar="(disable,short-report,report,review,create,update,trim,fix)*", dest="inline_snapshot", help="update specific snapshot values:\n" "disable: disable the snapshot logic\n" "short-report: show a short report\n" "report: show a longer report with a diff report\n" "review: allow to approve the changes interactive\n" "create: creates snapshots which are currently not defined\n" "update: update snapshots even if they are defined\n" "trim: changes the snapshot in a way which will make the snapshot more precise.\n" "fix: change snapshots which currently break your tests\n", ) parsed_args = parser.parse_args(args) flags = (parsed_args.inline_snapshot or "").split(",") with TemporaryDirectory() as dir: tmp_path = Path(dir) self._write_files(tmp_path) raised_exception = None with snapshot_env(): with ChangeRecorder().activate() as recorder: _inline_snapshot._update_flags = Flags({*flags}) inline_snapshot._external.storage = ( inline_snapshot._external.DiscStorage(tmp_path / ".storage") ) try: for filename in tmp_path.glob("*.py"): globals: dict[str, Any] = {} print("run> pytest", filename) exec( compile(filename.read_text("utf-8"), filename, "exec"), globals, ) # run all test_* functions for k, v in globals.items(): if k.startswith("test_") and callable(v): v() except Exception as e: traceback.print_exc() raised_exception = e finally: _inline_snapshot._active = False changes = [] for snapshot in _inline_snapshot.snapshots.values(): changes += snapshot._changes() snapshot_flags = {change.flag for change in changes} apply_all( [ change for change in changes if change.flag in _inline_snapshot._update_flags.to_set() ] ) recorder.fix_all() report_output = StringIO() console = Console(file=report_output) # TODO: add all the report output here report_problems(console) if reported_categories is not None: assert sorted(snapshot_flags) == reported_categories if raised_exception is not None: > assert raises == f"{type(raised_exception).__name__}:\n" + str( raised_exception ) E assert None == ('TypeError:\n' + "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'") E + where "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'" = str(TypeError("CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'")) /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: AssertionError ----------------------------- Captured stdout call ----------------------------- file: test_something.py from enum import Enum from inline_snapshot import snapshot class Namespace: class Color(Enum): red="red" assert Namespace.Color.red == snapshot() run> pytest /tmp/tmpo6wxwbzz/test_something.py ----------------------------- Captured stderr call ----------------------------- Traceback (most recent call last): File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 185, in run_inline exec( File "/tmp/tmpo6wxwbzz/test_something.py", line 9, in assert Namespace.Color.red == snapshot() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ return self == other ^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ self._changes.append(next(it)) ^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign new_code = self.context.file._token_to_code(new_token) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format return format_code(text, Path(self._source.filename)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code runner = CliRunner(mix_stderr=False) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' ______________________________ test_invalid_repr _______________________________ check_update = .w at 0x7f6a3f91ee80> def test_invalid_repr(check_update): assert ( > check_update( """\ class Thing: def __repr__(self): return "+++" def __eq__(self,other): if not isinstance(other,Thing): return NotImplemented return True assert Thing() == snapshot() """, flags="create", ) == snapshot( """\ class Thing: def __repr__(self): return "+++" def __eq__(self,other): if not isinstance(other,Thing): return NotImplemented return True assert Thing() == snapshot(HasRepr(Thing, "+++")) """ ) ) tests/test_code_repr.py:351: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:49: in w s = source(source_code) tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_invalid_repr0/test_1.py:18: in assert Thing() == snapshot() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_invalid_repr0/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |class Thing: | def __repr__(self): | return "+++" | | def __eq__(self,other): | if not isinstance(other,Thing): | return NotImplemented | return True | |assert Thing() == snapshot() ____________________________ test_config_pyproject _____________________________ def test_config_pyproject(): Example( { **file_to_trim, "pyproject.toml": """ [tool.inline-snapshot] default-flags = ["trim"] """, } > ).run_pytest(changed_files=trimmed_files) tests/test_config.py:37: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = args = [] def run_pytest( self, args: list[str] = [], *, term_columns=80, env: dict[str, str] = {}, changed_files: Snapshot[dict[str, str]] | None = None, report: Snapshot[str] | None = None, stderr: Snapshot[str] | None = None, returncode: Snapshot[int] | None = None, ) -> Example: """Run pytest with the given args and env variables in an seperate process. It can be used to test the interaction between your code and pytest, but it is a bit slower than `run_inline` Parameters: args: pytest arguments like "--inline-snapshot=fix" env: dict of environment variables changed_files: snapshot of files which are changed by this run. report: snapshot of the report at the end of the pytest run. stderr: pytest stderr output returncode: snapshot of the pytest returncode. Returns: A new Example instance which contains the changed files. """ with TemporaryDirectory() as dir: tmp_path = Path(dir) self._write_files(tmp_path) cmd = [sys.executable, "-m", "pytest", *args] command_env = dict(os.environ) command_env["TERM"] = "unknown" command_env["COLUMNS"] = str( term_columns + 1 if platform.system() == "Windows" else term_columns ) command_env.pop("CI", None) command_env.update(env) result = sp.run(cmd, cwd=tmp_path, capture_output=True, env=command_env) print("run>", *cmd) print("stdout:") print(result.stdout.decode()) print("stderr:") print(result.stderr.decode()) if returncode is not None: assert result.returncode == returncode if stderr is not None: assert result.stderr.decode() == stderr if report is not None: report_list = [] record = False for line in result.stdout.decode().splitlines(): line = line.strip() if line.startswith("===="): record = False if record and line: report_list.append(line) if line.startswith("====") and "inline snapshot" in line: record = True report_str = "\n".join(report_list) assert normalize(report_str) == report, repr(report_str) if changed_files is not None: current_files = {} for name, content in sorted(self._read_files(tmp_path).items()): if name not in self.files or self.files[name] != content: current_files[name] = content > assert changed_files == current_files E AssertionError: assert {'test_a.py':...napshot(2)\n'} == {} E E Left contains 1 more item: E {'test_a.py': 'from inline_snapshot import snapshot\n' E '\n' E 'def test_a():\n' E ' assert 1 <= snapshot(1)\n' E ' assert 1 == snapshot(2)\n'} E Use -v to get more diff /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:327: AssertionError ----------------------------- Captured stdout call ----------------------------- file: test_a.py from inline_snapshot import snapshot def test_a(): assert 1 <= snapshot(5) assert 1 == snapshot(2) file: pyproject.toml [tool.inline-snapshot] default-flags = ["trim"] run> /usr/bin/python3.12 -m pytest stdout: ============================= test session starts ============================== platform linux -- Python 3.12.8, pytest-8.3.4, pluggy-1.5.0 rootdir: /tmp/tmpwf9lr8xp configfile: pyproject.toml plugins: inline-snapshot-0.19.3, mock-3.14.0, hypothesis-6.124.0, time-machine-2.16.0, subtests-0.13.1, pytest_freezer-0.4.9 collected 1 item test_a.py F [100%] =================================== FAILURES =================================== ____________________________________ test_a ____________________________________ def test_a(): assert 1 <= snapshot(5) > assert 1 == snapshot(2) test_a.py:5: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '1 ', filename = PosixPath('/tmp/tmpwf9lr8xp/test_a.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError =============================== inline snapshot ================================ =========================== short test summary info ============================ FAILED test_a.py::test_a - TypeError: CliRunner.__init__() got an unexpected ... stderr: Traceback (most recent call last): File "", line 198, in _run_module_as_main File "", line 88, in _run_code File "/usr/lib/python3/dist-packages/pytest/__main__.py", line 9, in raise SystemExit(pytest.console_main()) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 201, in console_main code = main() ^^^^^^ File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 175, in main ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec return self._inner_hookexec(hook_name, methods, kwargs, firstresult) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall raise exception.with_traceback(exception.__traceback__) File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall res = hook_impl.function(*args) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/_pytest/main.py", line 330, in pytest_cmdline_main return wrap_session(config, _main) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/_pytest/main.py", line 318, in wrap_session config.hook.pytest_sessionfinish( File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec return self._inner_hookexec(hook_name, methods, kwargs, firstresult) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall raise exception.with_traceback(exception.__traceback__) File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall teardown.throw(exception) # type: ignore[union-attr] ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/_pytest/logging.py", line 868, in pytest_sessionfinish return (yield) ^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 124, in _multicall teardown.send(result) # type: ignore[union-attr] ^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 903, in pytest_sessionfinish self.config.hook.pytest_terminal_summary( File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec return self._inner_hookexec(hook_name, methods, kwargs, firstresult) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall raise exception.with_traceback(exception.__traceback__) File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall teardown.throw(exception) # type: ignore[union-attr] ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 925, in pytest_terminal_summary return (yield) ^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall teardown.throw(exception) # type: ignore[union-attr] ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/_pytest/warnings.py", line 132, in pytest_terminal_summary return (yield) ^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall res = hook_impl.function(*args) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/pytest_plugin.py", line 271, in pytest_terminal_summary for change in snapshot._changes(): ^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 671, in _changes yield from self._value._get_changes() File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 337, in _get_changes new_code = self._file._token_to_code(new_token) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format return format_code(text, Path(self._source.filename)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code runner = CliRunner(mix_stderr=False) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' _______________________________ test_config_env ________________________________ def test_config_env(): > Example(file_to_trim).run_pytest( env={"INLINE_SNAPSHOT_DEFAULT_FLAGS": "trim"}, changed_files=trimmed_files ) tests/test_config.py:41: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = args = [] def run_pytest( self, args: list[str] = [], *, term_columns=80, env: dict[str, str] = {}, changed_files: Snapshot[dict[str, str]] | None = None, report: Snapshot[str] | None = None, stderr: Snapshot[str] | None = None, returncode: Snapshot[int] | None = None, ) -> Example: """Run pytest with the given args and env variables in an seperate process. It can be used to test the interaction between your code and pytest, but it is a bit slower than `run_inline` Parameters: args: pytest arguments like "--inline-snapshot=fix" env: dict of environment variables changed_files: snapshot of files which are changed by this run. report: snapshot of the report at the end of the pytest run. stderr: pytest stderr output returncode: snapshot of the pytest returncode. Returns: A new Example instance which contains the changed files. """ with TemporaryDirectory() as dir: tmp_path = Path(dir) self._write_files(tmp_path) cmd = [sys.executable, "-m", "pytest", *args] command_env = dict(os.environ) command_env["TERM"] = "unknown" command_env["COLUMNS"] = str( term_columns + 1 if platform.system() == "Windows" else term_columns ) command_env.pop("CI", None) command_env.update(env) result = sp.run(cmd, cwd=tmp_path, capture_output=True, env=command_env) print("run>", *cmd) print("stdout:") print(result.stdout.decode()) print("stderr:") print(result.stderr.decode()) if returncode is not None: assert result.returncode == returncode if stderr is not None: assert result.stderr.decode() == stderr if report is not None: report_list = [] record = False for line in result.stdout.decode().splitlines(): line = line.strip() if line.startswith("===="): record = False if record and line: report_list.append(line) if line.startswith("====") and "inline snapshot" in line: record = True report_str = "\n".join(report_list) assert normalize(report_str) == report, repr(report_str) if changed_files is not None: current_files = {} for name, content in sorted(self._read_files(tmp_path).items()): if name not in self.files or self.files[name] != content: current_files[name] = content > assert changed_files == current_files E AssertionError: assert {'test_a.py':...napshot(2)\n'} == {} E E Left contains 1 more item: E {'test_a.py': 'from inline_snapshot import snapshot\n' E '\n' E 'def test_a():\n' E ' assert 1 <= snapshot(1)\n' E ' assert 1 == snapshot(2)\n'} E Use -v to get more diff /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:327: AssertionError ----------------------------- Captured stdout call ----------------------------- file: test_a.py from inline_snapshot import snapshot def test_a(): assert 1 <= snapshot(5) assert 1 == snapshot(2) run> /usr/bin/python3.12 -m pytest stdout: ============================= test session starts ============================== platform linux -- Python 3.12.8, pytest-8.3.4, pluggy-1.5.0 rootdir: /tmp/tmpjx9omx7u plugins: inline-snapshot-0.19.3, mock-3.14.0, hypothesis-6.124.0, time-machine-2.16.0, subtests-0.13.1, pytest_freezer-0.4.9 collected 1 item test_a.py F [100%] =================================== FAILURES =================================== ____________________________________ test_a ____________________________________ def test_a(): assert 1 <= snapshot(5) > assert 1 == snapshot(2) test_a.py:5: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '1 ', filename = PosixPath('/tmp/tmpjx9omx7u/test_a.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError =============================== inline snapshot ================================ =========================== short test summary info ============================ FAILED test_a.py::test_a - TypeError: CliRunner.__init__() got an unexpected ... stderr: Traceback (most recent call last): File "", line 198, in _run_module_as_main File "", line 88, in _run_code File "/usr/lib/python3/dist-packages/pytest/__main__.py", line 9, in raise SystemExit(pytest.console_main()) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 201, in console_main code = main() ^^^^^^ File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 175, in main ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec return self._inner_hookexec(hook_name, methods, kwargs, firstresult) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall raise exception.with_traceback(exception.__traceback__) File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall res = hook_impl.function(*args) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/_pytest/main.py", line 330, in pytest_cmdline_main return wrap_session(config, _main) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/_pytest/main.py", line 318, in wrap_session config.hook.pytest_sessionfinish( File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec return self._inner_hookexec(hook_name, methods, kwargs, firstresult) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall raise exception.with_traceback(exception.__traceback__) File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall teardown.throw(exception) # type: ignore[union-attr] ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/_pytest/logging.py", line 868, in pytest_sessionfinish return (yield) ^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 124, in _multicall teardown.send(result) # type: ignore[union-attr] ^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 903, in pytest_sessionfinish self.config.hook.pytest_terminal_summary( File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec return self._inner_hookexec(hook_name, methods, kwargs, firstresult) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall raise exception.with_traceback(exception.__traceback__) File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall teardown.throw(exception) # type: ignore[union-attr] ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 925, in pytest_terminal_summary return (yield) ^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall teardown.throw(exception) # type: ignore[union-attr] ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/_pytest/warnings.py", line 132, in pytest_terminal_summary return (yield) ^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall res = hook_impl.function(*args) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/pytest_plugin.py", line 271, in pytest_terminal_summary for change in snapshot._changes(): ^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 671, in _changes yield from self._value._get_changes() File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 337, in _get_changes new_code = self._file._token_to_code(new_token) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format return format_code(text, Path(self._source.filename)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code runner = CliRunner(mix_stderr=False) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' ________________________________ test_shortcuts ________________________________ def test_shortcuts(): Example( { **file_to_trim, "pyproject.toml": """ [tool.inline-snapshot.shortcuts] strim=["trim"] """, } > ).run_pytest(["--strim"], changed_files=trimmed_files) tests/test_config.py:56: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = args = ['--strim'] def run_pytest( self, args: list[str] = [], *, term_columns=80, env: dict[str, str] = {}, changed_files: Snapshot[dict[str, str]] | None = None, report: Snapshot[str] | None = None, stderr: Snapshot[str] | None = None, returncode: Snapshot[int] | None = None, ) -> Example: """Run pytest with the given args and env variables in an seperate process. It can be used to test the interaction between your code and pytest, but it is a bit slower than `run_inline` Parameters: args: pytest arguments like "--inline-snapshot=fix" env: dict of environment variables changed_files: snapshot of files which are changed by this run. report: snapshot of the report at the end of the pytest run. stderr: pytest stderr output returncode: snapshot of the pytest returncode. Returns: A new Example instance which contains the changed files. """ with TemporaryDirectory() as dir: tmp_path = Path(dir) self._write_files(tmp_path) cmd = [sys.executable, "-m", "pytest", *args] command_env = dict(os.environ) command_env["TERM"] = "unknown" command_env["COLUMNS"] = str( term_columns + 1 if platform.system() == "Windows" else term_columns ) command_env.pop("CI", None) command_env.update(env) result = sp.run(cmd, cwd=tmp_path, capture_output=True, env=command_env) print("run>", *cmd) print("stdout:") print(result.stdout.decode()) print("stderr:") print(result.stderr.decode()) if returncode is not None: assert result.returncode == returncode if stderr is not None: assert result.stderr.decode() == stderr if report is not None: report_list = [] record = False for line in result.stdout.decode().splitlines(): line = line.strip() if line.startswith("===="): record = False if record and line: report_list.append(line) if line.startswith("====") and "inline snapshot" in line: record = True report_str = "\n".join(report_list) assert normalize(report_str) == report, repr(report_str) if changed_files is not None: current_files = {} for name, content in sorted(self._read_files(tmp_path).items()): if name not in self.files or self.files[name] != content: current_files[name] = content > assert changed_files == current_files E AssertionError: assert {'test_a.py':...napshot(2)\n'} == {} E E Left contains 1 more item: E {'test_a.py': 'from inline_snapshot import snapshot\n' E '\n' E 'def test_a():\n' E ' assert 1 <= snapshot(1)\n' E ' assert 1 == snapshot(2)\n'} E Use -v to get more diff /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:327: AssertionError ----------------------------- Captured stdout call ----------------------------- file: test_a.py from inline_snapshot import snapshot def test_a(): assert 1 <= snapshot(5) assert 1 == snapshot(2) file: pyproject.toml [tool.inline-snapshot.shortcuts] strim=["trim"] run> /usr/bin/python3.12 -m pytest --strim stdout: ============================= test session starts ============================== platform linux -- Python 3.12.8, pytest-8.3.4, pluggy-1.5.0 rootdir: /tmp/tmp5fdylebu configfile: pyproject.toml plugins: inline-snapshot-0.19.3, mock-3.14.0, hypothesis-6.124.0, time-machine-2.16.0, subtests-0.13.1, pytest_freezer-0.4.9 collected 1 item test_a.py F [100%] =================================== FAILURES =================================== ____________________________________ test_a ____________________________________ def test_a(): assert 1 <= snapshot(5) > assert 1 == snapshot(2) test_a.py:5: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '1 ', filename = PosixPath('/tmp/tmp5fdylebu/test_a.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError =============================== inline snapshot ================================ =========================== short test summary info ============================ FAILED test_a.py::test_a - TypeError: CliRunner.__init__() got an unexpected ... stderr: Traceback (most recent call last): File "", line 198, in _run_module_as_main File "", line 88, in _run_code File "/usr/lib/python3/dist-packages/pytest/__main__.py", line 9, in raise SystemExit(pytest.console_main()) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 201, in console_main code = main() ^^^^^^ File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 175, in main ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec return self._inner_hookexec(hook_name, methods, kwargs, firstresult) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall raise exception.with_traceback(exception.__traceback__) File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall res = hook_impl.function(*args) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/_pytest/main.py", line 330, in pytest_cmdline_main return wrap_session(config, _main) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/_pytest/main.py", line 318, in wrap_session config.hook.pytest_sessionfinish( File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec return self._inner_hookexec(hook_name, methods, kwargs, firstresult) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall raise exception.with_traceback(exception.__traceback__) File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall teardown.throw(exception) # type: ignore[union-attr] ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/_pytest/logging.py", line 868, in pytest_sessionfinish return (yield) ^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 124, in _multicall teardown.send(result) # type: ignore[union-attr] ^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 903, in pytest_sessionfinish self.config.hook.pytest_terminal_summary( File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec return self._inner_hookexec(hook_name, methods, kwargs, firstresult) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall raise exception.with_traceback(exception.__traceback__) File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall teardown.throw(exception) # type: ignore[union-attr] ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 925, in pytest_terminal_summary return (yield) ^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall teardown.throw(exception) # type: ignore[union-attr] ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/_pytest/warnings.py", line 132, in pytest_terminal_summary return (yield) ^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall res = hook_impl.function(*args) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/pytest_plugin.py", line 271, in pytest_terminal_summary for change in snapshot._changes(): ^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 671, in _changes yield from self._value._get_changes() File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 337, in _get_changes new_code = self._file._token_to_code(new_token) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format return format_code(text, Path(self._source.filename)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code runner = CliRunner(mix_stderr=False) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' ____________________________ test_default_shortcuts ____________________________ def test_default_shortcuts(): Example( { **file_to_trim, "pyproject.toml": """ """, } > ).run_pytest( ["--fix"], changed_files=snapshot( { "test_a.py": """\ from inline_snapshot import snapshot def test_a(): assert 1 <= snapshot(5) assert 1 == snapshot(1) """ } ), ) tests/test_config.py:67: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = args = ['--fix'] def run_pytest( self, args: list[str] = [], *, term_columns=80, env: dict[str, str] = {}, changed_files: Snapshot[dict[str, str]] | None = None, report: Snapshot[str] | None = None, stderr: Snapshot[str] | None = None, returncode: Snapshot[int] | None = None, ) -> Example: """Run pytest with the given args and env variables in an seperate process. It can be used to test the interaction between your code and pytest, but it is a bit slower than `run_inline` Parameters: args: pytest arguments like "--inline-snapshot=fix" env: dict of environment variables changed_files: snapshot of files which are changed by this run. report: snapshot of the report at the end of the pytest run. stderr: pytest stderr output returncode: snapshot of the pytest returncode. Returns: A new Example instance which contains the changed files. """ with TemporaryDirectory() as dir: tmp_path = Path(dir) self._write_files(tmp_path) cmd = [sys.executable, "-m", "pytest", *args] command_env = dict(os.environ) command_env["TERM"] = "unknown" command_env["COLUMNS"] = str( term_columns + 1 if platform.system() == "Windows" else term_columns ) command_env.pop("CI", None) command_env.update(env) result = sp.run(cmd, cwd=tmp_path, capture_output=True, env=command_env) print("run>", *cmd) print("stdout:") print(result.stdout.decode()) print("stderr:") print(result.stderr.decode()) if returncode is not None: assert result.returncode == returncode if stderr is not None: assert result.stderr.decode() == stderr if report is not None: report_list = [] record = False for line in result.stdout.decode().splitlines(): line = line.strip() if line.startswith("===="): record = False if record and line: report_list.append(line) if line.startswith("====") and "inline snapshot" in line: record = True report_str = "\n".join(report_list) assert normalize(report_str) == report, repr(report_str) if changed_files is not None: current_files = {} for name, content in sorted(self._read_files(tmp_path).items()): if name not in self.files or self.files[name] != content: current_files[name] = content > assert changed_files == current_files E AssertionError: assert {'test_a.py':...napshot(1)\n'} == {} E E Left contains 1 more item: E {'test_a.py': 'from inline_snapshot import snapshot\n' E '\n' E 'def test_a():\n' E ' assert 1 <= snapshot(5)\n' E ' assert 1 == snapshot(1)\n'} E Use -v to get more diff /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:327: AssertionError ----------------------------- Captured stdout call ----------------------------- file: test_a.py from inline_snapshot import snapshot def test_a(): assert 1 <= snapshot(5) assert 1 == snapshot(2) file: pyproject.toml run> /usr/bin/python3.12 -m pytest --fix stdout: ============================= test session starts ============================== platform linux -- Python 3.12.8, pytest-8.3.4, pluggy-1.5.0 rootdir: /tmp/tmpc8da4y6p configfile: pyproject.toml plugins: inline-snapshot-0.19.3, mock-3.14.0, hypothesis-6.124.0, time-machine-2.16.0, subtests-0.13.1, pytest_freezer-0.4.9 collected 1 item test_a.py F [100%] =================================== FAILURES =================================== ____________________________________ test_a ____________________________________ def test_a(): assert 1 <= snapshot(5) > assert 1 == snapshot(2) test_a.py:5: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '1 ', filename = PosixPath('/tmp/tmpc8da4y6p/test_a.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError =============================== inline snapshot ================================ =========================== short test summary info ============================ FAILED test_a.py::test_a - TypeError: CliRunner.__init__() got an unexpected ... stderr: Traceback (most recent call last): File "", line 198, in _run_module_as_main File "", line 88, in _run_code File "/usr/lib/python3/dist-packages/pytest/__main__.py", line 9, in raise SystemExit(pytest.console_main()) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 201, in console_main code = main() ^^^^^^ File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 175, in main ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec return self._inner_hookexec(hook_name, methods, kwargs, firstresult) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall raise exception.with_traceback(exception.__traceback__) File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall res = hook_impl.function(*args) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/_pytest/main.py", line 330, in pytest_cmdline_main return wrap_session(config, _main) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/_pytest/main.py", line 318, in wrap_session config.hook.pytest_sessionfinish( File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec return self._inner_hookexec(hook_name, methods, kwargs, firstresult) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall raise exception.with_traceback(exception.__traceback__) File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall teardown.throw(exception) # type: ignore[union-attr] ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/_pytest/logging.py", line 868, in pytest_sessionfinish return (yield) ^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 124, in _multicall teardown.send(result) # type: ignore[union-attr] ^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 903, in pytest_sessionfinish self.config.hook.pytest_terminal_summary( File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec return self._inner_hookexec(hook_name, methods, kwargs, firstresult) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall raise exception.with_traceback(exception.__traceback__) File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall teardown.throw(exception) # type: ignore[union-attr] ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 925, in pytest_terminal_summary return (yield) ^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall teardown.throw(exception) # type: ignore[union-attr] ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/_pytest/warnings.py", line 132, in pytest_terminal_summary return (yield) ^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall res = hook_impl.function(*args) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/pytest_plugin.py", line 271, in pytest_terminal_summary for change in snapshot._changes(): ^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 671, in _changes yield from self._value._get_changes() File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 337, in _get_changes new_code = self._file._token_to_code(new_token) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format return format_code(text, Path(self._source.filename)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code runner = CliRunner(mix_stderr=False) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' _______________________ test_compare_dirty_equals_twice ________________________ def test_compare_dirty_equals_twice() -> None: Example( """ from dirty_equals import IsStr from inline_snapshot import snapshot for x in 'ab': assert x == snapshot(IsStr()) assert [x,5] == snapshot([IsStr(),3]) assert {'a':x,'b':5} == snapshot({'a':IsStr(),'b':3}) """ > ).run_inline( ["--inline-snapshot=fix"], changed_files=snapshot( { "test_something.py": """\ from dirty_equals import IsStr from inline_snapshot import snapshot for x in 'ab': assert x == snapshot(IsStr()) assert [x,5] == snapshot([IsStr(),5]) assert {'a':x,'b':5} == snapshot({'a':IsStr(),'b':5}) """ } ), ) tests/test_dirty_equals.py:47: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = args = ['--inline-snapshot=fix'] def run_inline( self, args: list[str] = [], *, reported_categories: Snapshot[list[Category]] | None = None, changed_files: Snapshot[dict[str, str]] | None = None, report: Snapshot[str] | None = None, raises: Snapshot[str] | None = None, ) -> Example: """Execute the example files in process and run every `test_*` function. This is useful for fast test execution. Parameters: args: inline-snapshot arguments (supports only "--inline-snapshot=fix|create|..." ). reported_categories: snapshot of categories which inline-snapshot thinks could be applied. changed_files: snapshot of files which are changed by this run. raises: snapshot of the exception which is raised during the test execution. It is required if your code raises an exception. Returns: A new Example instance which contains the changed files. """ parser = ArgumentParser() parser.add_argument( "--inline-snapshot", metavar="(disable,short-report,report,review,create,update,trim,fix)*", dest="inline_snapshot", help="update specific snapshot values:\n" "disable: disable the snapshot logic\n" "short-report: show a short report\n" "report: show a longer report with a diff report\n" "review: allow to approve the changes interactive\n" "create: creates snapshots which are currently not defined\n" "update: update snapshots even if they are defined\n" "trim: changes the snapshot in a way which will make the snapshot more precise.\n" "fix: change snapshots which currently break your tests\n", ) parsed_args = parser.parse_args(args) flags = (parsed_args.inline_snapshot or "").split(",") with TemporaryDirectory() as dir: tmp_path = Path(dir) self._write_files(tmp_path) raised_exception = None with snapshot_env(): with ChangeRecorder().activate() as recorder: _inline_snapshot._update_flags = Flags({*flags}) inline_snapshot._external.storage = ( inline_snapshot._external.DiscStorage(tmp_path / ".storage") ) try: for filename in tmp_path.glob("*.py"): globals: dict[str, Any] = {} print("run> pytest", filename) exec( compile(filename.read_text("utf-8"), filename, "exec"), globals, ) # run all test_* functions for k, v in globals.items(): if k.startswith("test_") and callable(v): v() except Exception as e: traceback.print_exc() raised_exception = e finally: _inline_snapshot._active = False changes = [] for snapshot in _inline_snapshot.snapshots.values(): changes += snapshot._changes() snapshot_flags = {change.flag for change in changes} apply_all( [ change for change in changes if change.flag in _inline_snapshot._update_flags.to_set() ] ) recorder.fix_all() report_output = StringIO() console = Console(file=report_output) # TODO: add all the report output here report_problems(console) if reported_categories is not None: assert sorted(snapshot_flags) == reported_categories if raised_exception is not None: > assert raises == f"{type(raised_exception).__name__}:\n" + str( raised_exception ) E assert None == ('TypeError:\n' + "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'") E + where "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'" = str(TypeError("CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'")) /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: AssertionError ----------------------------- Captured stdout call ----------------------------- file: test_something.py from dirty_equals import IsStr from inline_snapshot import snapshot for x in 'ab': assert x == snapshot(IsStr()) assert [x,5] == snapshot([IsStr(),3]) assert {'a':x,'b':5} == snapshot({'a':IsStr(),'b':3}) run> pytest /tmp/tmplg94q7do/test_something.py ----------------------------- Captured stderr call ----------------------------- Traceback (most recent call last): File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 185, in run_inline exec( File "/tmp/tmplg94q7do/test_something.py", line 7, in assert [x,5] == snapshot([IsStr(),3]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ return self == other ^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ self._changes.append(next(it)) ^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py", line 79, in assign v = yield from self.get_adapter( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign new_code = self.context.file._token_to_code(new_token) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format return format_code(text, Path(self._source.filename)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code runner = CliRunner(mix_stderr=False) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' _____________________ test_dirty_equals_with_changing_args _____________________ def test_dirty_equals_with_changing_args() -> None: Example( """\ from dirty_equals import IsInt from inline_snapshot import snapshot def test_number(): for i in range(5): assert ["a",i] == snapshot(["e",IsInt(gt=i-1,lt=i+1)]) """ > ).run_inline( ["--inline-snapshot=fix"], changed_files=snapshot( { "test_something.py": """\ from dirty_equals import IsInt from inline_snapshot import snapshot def test_number(): for i in range(5): assert ["a",i] == snapshot(["a",IsInt(gt=i-1,lt=i+1)]) """ } ), ) tests/test_dirty_equals.py:138: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = args = ['--inline-snapshot=fix'] def run_inline( self, args: list[str] = [], *, reported_categories: Snapshot[list[Category]] | None = None, changed_files: Snapshot[dict[str, str]] | None = None, report: Snapshot[str] | None = None, raises: Snapshot[str] | None = None, ) -> Example: """Execute the example files in process and run every `test_*` function. This is useful for fast test execution. Parameters: args: inline-snapshot arguments (supports only "--inline-snapshot=fix|create|..." ). reported_categories: snapshot of categories which inline-snapshot thinks could be applied. changed_files: snapshot of files which are changed by this run. raises: snapshot of the exception which is raised during the test execution. It is required if your code raises an exception. Returns: A new Example instance which contains the changed files. """ parser = ArgumentParser() parser.add_argument( "--inline-snapshot", metavar="(disable,short-report,report,review,create,update,trim,fix)*", dest="inline_snapshot", help="update specific snapshot values:\n" "disable: disable the snapshot logic\n" "short-report: show a short report\n" "report: show a longer report with a diff report\n" "review: allow to approve the changes interactive\n" "create: creates snapshots which are currently not defined\n" "update: update snapshots even if they are defined\n" "trim: changes the snapshot in a way which will make the snapshot more precise.\n" "fix: change snapshots which currently break your tests\n", ) parsed_args = parser.parse_args(args) flags = (parsed_args.inline_snapshot or "").split(",") with TemporaryDirectory() as dir: tmp_path = Path(dir) self._write_files(tmp_path) raised_exception = None with snapshot_env(): with ChangeRecorder().activate() as recorder: _inline_snapshot._update_flags = Flags({*flags}) inline_snapshot._external.storage = ( inline_snapshot._external.DiscStorage(tmp_path / ".storage") ) try: for filename in tmp_path.glob("*.py"): globals: dict[str, Any] = {} print("run> pytest", filename) exec( compile(filename.read_text("utf-8"), filename, "exec"), globals, ) # run all test_* functions for k, v in globals.items(): if k.startswith("test_") and callable(v): v() except Exception as e: traceback.print_exc() raised_exception = e finally: _inline_snapshot._active = False changes = [] for snapshot in _inline_snapshot.snapshots.values(): changes += snapshot._changes() snapshot_flags = {change.flag for change in changes} apply_all( [ change for change in changes if change.flag in _inline_snapshot._update_flags.to_set() ] ) recorder.fix_all() report_output = StringIO() console = Console(file=report_output) # TODO: add all the report output here report_problems(console) if reported_categories is not None: assert sorted(snapshot_flags) == reported_categories if raised_exception is not None: > assert raises == f"{type(raised_exception).__name__}:\n" + str( raised_exception ) E assert None == ('TypeError:\n' + "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'") E + where "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'" = str(TypeError("CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'")) /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: AssertionError ----------------------------- Captured stdout call ----------------------------- file: test_something.py from dirty_equals import IsInt from inline_snapshot import snapshot def test_number(): for i in range(5): assert ["a",i] == snapshot(["e",IsInt(gt=i-1,lt=i+1)]) run> pytest /tmp/tmp6kgfrxa7/test_something.py ----------------------------- Captured stderr call ----------------------------- Traceback (most recent call last): File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 193, in run_inline v() File "/tmp/tmp6kgfrxa7/test_something.py", line 7, in test_number assert ["a",i] == snapshot(["e",IsInt(gt=i-1,lt=i+1)]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ return self == other ^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ self._changes.append(next(it)) ^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py", line 79, in assign v = yield from self.get_adapter( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign new_code = self.context.file._token_to_code(new_token) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format return format_code(text, Path(self._source.filename)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code runner = CliRunner(mix_stderr=False) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' _________________________________ test_example _________________________________ def test_example(): e = Example( { "test_a.py": """ from inline_snapshot import snapshot def test_a(): assert 1==snapshot(2) """, "test_b.py": "1+1", }, ) e.run_pytest( ["--inline-snapshot=create,fix"], ) > e.run_inline( ["--inline-snapshot=fix"], reported_categories=snapshot(["fix"]), ).run_inline( ["--inline-snapshot=fix"], changed_files=snapshot({}), ) tests/test_example.py:23: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = args = ['--inline-snapshot=fix'] def run_inline( self, args: list[str] = [], *, reported_categories: Snapshot[list[Category]] | None = None, changed_files: Snapshot[dict[str, str]] | None = None, report: Snapshot[str] | None = None, raises: Snapshot[str] | None = None, ) -> Example: """Execute the example files in process and run every `test_*` function. This is useful for fast test execution. Parameters: args: inline-snapshot arguments (supports only "--inline-snapshot=fix|create|..." ). reported_categories: snapshot of categories which inline-snapshot thinks could be applied. changed_files: snapshot of files which are changed by this run. raises: snapshot of the exception which is raised during the test execution. It is required if your code raises an exception. Returns: A new Example instance which contains the changed files. """ parser = ArgumentParser() parser.add_argument( "--inline-snapshot", metavar="(disable,short-report,report,review,create,update,trim,fix)*", dest="inline_snapshot", help="update specific snapshot values:\n" "disable: disable the snapshot logic\n" "short-report: show a short report\n" "report: show a longer report with a diff report\n" "review: allow to approve the changes interactive\n" "create: creates snapshots which are currently not defined\n" "update: update snapshots even if they are defined\n" "trim: changes the snapshot in a way which will make the snapshot more precise.\n" "fix: change snapshots which currently break your tests\n", ) parsed_args = parser.parse_args(args) flags = (parsed_args.inline_snapshot or "").split(",") with TemporaryDirectory() as dir: tmp_path = Path(dir) self._write_files(tmp_path) raised_exception = None with snapshot_env(): with ChangeRecorder().activate() as recorder: _inline_snapshot._update_flags = Flags({*flags}) inline_snapshot._external.storage = ( inline_snapshot._external.DiscStorage(tmp_path / ".storage") ) try: for filename in tmp_path.glob("*.py"): globals: dict[str, Any] = {} print("run> pytest", filename) exec( compile(filename.read_text("utf-8"), filename, "exec"), globals, ) # run all test_* functions for k, v in globals.items(): if k.startswith("test_") and callable(v): v() except Exception as e: traceback.print_exc() raised_exception = e finally: _inline_snapshot._active = False changes = [] for snapshot in _inline_snapshot.snapshots.values(): changes += snapshot._changes() snapshot_flags = {change.flag for change in changes} apply_all( [ change for change in changes if change.flag in _inline_snapshot._update_flags.to_set() ] ) recorder.fix_all() report_output = StringIO() console = Console(file=report_output) # TODO: add all the report output here report_problems(console) if reported_categories is not None: > assert sorted(snapshot_flags) == reported_categories E AssertionError: assert [] == ['fix'] E E Right contains one more item: 'fix' E Use -v to get more diff /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:223: AssertionError ----------------------------- Captured stdout call ----------------------------- file: test_a.py from inline_snapshot import snapshot def test_a(): assert 1==snapshot(2) file: test_b.py 1+1 run> /usr/bin/python3.12 -m pytest --inline-snapshot=create,fix stdout: ============================= test session starts ============================== platform linux -- Python 3.12.8, pytest-8.3.4, pluggy-1.5.0 rootdir: /tmp/tmpuxf0g1sl plugins: inline-snapshot-0.19.3, mock-3.14.0, hypothesis-6.124.0, time-machine-2.16.0, subtests-0.13.1, pytest_freezer-0.4.9 collected 1 item test_a.py F [100%] =================================== FAILURES =================================== ____________________________________ test_a ____________________________________ def test_a(): > assert 1==snapshot(2) test_a.py:5: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '1 ', filename = PosixPath('/tmp/tmpuxf0g1sl/test_a.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError =============================== inline snapshot ================================ =========================== short test summary info ============================ FAILED test_a.py::test_a - TypeError: CliRunner.__init__() got an unexpected ... ============================== 1 failed in 0.12s =============================== stderr: file: test_a.py from inline_snapshot import snapshot def test_a(): assert 1==snapshot(2) file: test_b.py 1+1 run> pytest /tmp/tmpi00mbcsr/test_a.py ----------------------------- Captured stderr call ----------------------------- Traceback (most recent call last): File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 193, in run_inline v() File "/tmp/tmpi00mbcsr/test_a.py", line 5, in test_a assert 1==snapshot(2) ^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ return self == other ^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ self._changes.append(next(it)) ^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign new_code = self.context.file._token_to_code(new_token) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format return format_code(text, Path(self._source.filename)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code runner = CliRunner(mix_stderr=False) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' __________________________________ test_basic __________________________________ check_update = .w at 0x7f6a3f85b1a0> def test_basic(check_update): > assert check_update( "assert outsource('text') == snapshot()", flags="create" ) == snapshot( "assert outsource('text') == snapshot(external(\"982d9e3eb996*.txt\"))" ) tests/test_external.py:12: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:49: in w s = source(source_code) tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_basic0/test_1.py:9: in assert outsource('text') == snapshot() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_basic0/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert outsource('text') == snapshot() _________________________________ test_persist _________________________________ project = .Project object at 0x7f6a3f5edf40> def test_persist(project): project.setup( """\ from inline_snapshot import external def test_something(): assert "hello" == snapshot(external("bbbbb*.txt")) assert 2 == snapshot(1+1) """ ) result = project.run("--inline-snapshot=update") assert project.storage() == snapshot([]) > assert project.source == snapshot( """\ from inline_snapshot import external def test_something(): assert "hello" == snapshot(external("bbbbb*.txt")) assert 2 == snapshot(2) """ ) /tmp/autopkgtest.ImMzGl/autopkgtest_tmp/tests/test_external.py:78: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '"""\\\nfrom inline_snapshot import external\n\ndef test_something():\n assert "hello" == snapshot(external("bbbbb*.txt"))\n assert 2 == snapshot(1+1)\n"""' filename = PosixPath('/tmp/autopkgtest.ImMzGl/autopkgtest_tmp/tests/test_external.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- write code: # äöß 🐍 from inline_snapshot import snapshot from inline_snapshot import outsource from inline_snapshot import external def test_something(): assert "hello" == snapshot(external("bbbbb*.txt")) assert 2 == snapshot(1+1) running: pytest --inline-snapshot=update in: /tmp/pytest-of-unshare/pytest-0/test_persist0 ============================= test session starts ============================== platform linux -- Python 3.13.1, pytest-8.3.4, pluggy-1.5.0 rootdir: /tmp/pytest-of-unshare/pytest-0/test_persist0 plugins: inline-snapshot-0.19.3, mock-3.14.0, hypothesis-6.124.0, time-machine-2.16.0, subtests-0.13.1, pytest_freezer-0.4.9 collected 1 item test_file.py F [100%] =================================== FAILURES =================================== ________________________________ test_something ________________________________ def test_something(): > assert "hello" == snapshot(external("bbbbb*.txt")) test_file.py:7: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = "'hello'" filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_persist0/test_file.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError =============================== inline snapshot ================================ =========================== short test summary info ============================ FAILED test_file.py::test_something - TypeError: CliRunner.__init__() got an ... ============================== 1 failed in 0.16s =============================== _________________________ test_pytest_compare_external _________________________ project = .Project object at 0x7f6a3f5ef9b0> def test_pytest_compare_external(project): project.setup( """\ from inline_snapshot import external def test_a(): assert outsource("test") == snapshot( external("9f86d081884c*.txt") ) assert outsource("test2") == snapshot( external("9f86d081884c*.txt") ) """ ) result = project.run() > assert result.errorLines() == snapshot( """\ > assert outsource("test2") == snapshot( E AssertionError: assert 'test2' == 'test' E ⏎ E - test E + test2 E ? + """ ) /tmp/autopkgtest.ImMzGl/autopkgtest_tmp/tests/test_external.py:123: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '"""\\\n> assert outsource("test2") == snapshot(\n> runner = CliRunner(mix_stderr=False)\nE TypeError: CliRunner.__init__() got an unexpected keyword argument \'mix_stderr\'\n"""' filename = PosixPath('/tmp/autopkgtest.ImMzGl/autopkgtest_tmp/tests/test_external.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- write code: # äöß 🐍 from inline_snapshot import snapshot from inline_snapshot import outsource from inline_snapshot import external def test_a(): assert outsource("test") == snapshot( external("9f86d081884c*.txt") ) assert outsource("test2") == snapshot( external("9f86d081884c*.txt") ) running: pytest in: /tmp/pytest-of-unshare/pytest-0/test_pytest_compare_external0 ============================= test session starts ============================== platform linux -- Python 3.13.1, pytest-8.3.4, pluggy-1.5.0 rootdir: /tmp/pytest-of-unshare/pytest-0/test_pytest_compare_external0 plugins: inline-snapshot-0.19.3, mock-3.14.0, hypothesis-6.124.0, time-machine-2.16.0, subtests-0.13.1, pytest_freezer-0.4.9 collected 1 item test_file.py F [100%] =================================== FAILURES =================================== ____________________________________ test_a ____________________________________ def test_a(): assert outsource("test") == snapshot( external("9f86d081884c*.txt") ) > assert outsource("test2") == snapshot( external("9f86d081884c*.txt") ) test_file.py:11: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = 'external ("60303ae22b99*.txt")' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_pytest_compare_external0/test_file.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError =============================== inline snapshot ================================ =========================== short test summary info ============================ FAILED test_file.py::test_a - TypeError: CliRunner.__init__() got an unexpect... ============================== 1 failed in 0.18s =============================== ______________________ test_pytest_compare_external_bytes ______________________ project = .Project object at 0x7f6a3f437230> def test_pytest_compare_external_bytes(project): project.setup( """\ from inline_snapshot import external def test_a(): assert outsource(b"test") == snapshot( external("9f86d081884c*.bin") ) assert outsource(b"test2") == snapshot( external("9f86d081884c*.bin") ) """ ) result = project.run() > assert result.errorLines() == snapshot( """\ > assert outsource(b"test2") == snapshot( E AssertionError: assert b'test2' == b'test' E ⏎ E Use -v to get more diff """ ) /tmp/autopkgtest.ImMzGl/autopkgtest_tmp/tests/test_external.py:153: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 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"""' filename = PosixPath('/tmp/autopkgtest.ImMzGl/autopkgtest_tmp/tests/test_external.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- write code: # äöß 🐍 from inline_snapshot import snapshot from inline_snapshot import outsource from inline_snapshot import external def test_a(): assert outsource(b"test") == snapshot( external("9f86d081884c*.bin") ) assert outsource(b"test2") == snapshot( external("9f86d081884c*.bin") ) running: pytest in: /tmp/pytest-of-unshare/pytest-0/test_pytest_compare_external_bytes0 ============================= test session starts ============================== platform linux -- Python 3.13.1, pytest-8.3.4, pluggy-1.5.0 rootdir: /tmp/pytest-of-unshare/pytest-0/test_pytest_compare_external_bytes0 plugins: inline-snapshot-0.19.3, mock-3.14.0, hypothesis-6.124.0, time-machine-2.16.0, subtests-0.13.1, pytest_freezer-0.4.9 collected 1 item test_file.py F [100%] =================================== FAILURES =================================== ____________________________________ test_a ____________________________________ def test_a(): assert outsource(b"test") == snapshot( external("9f86d081884c*.bin") ) > assert outsource(b"test2") == snapshot( external("9f86d081884c*.bin") ) test_file.py:11: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = 'external ("60303ae22b99*.bin")' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_pytest_compare_external_bytes0/test_file.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError =============================== inline snapshot ================================ =========================== short test summary info ============================ FAILED test_file.py::test_a - TypeError: CliRunner.__init__() got an unexpect... ============================== 1 failed in 0.18s =============================== _____________________ test_pytest_existing_external_import _____________________ project = .Project object at 0x7f6a3f437ec0> def test_pytest_existing_external_import(project): project.setup( """\ from inline_snapshot import external def test_a(): assert outsource("test") == snapshot() """ ) result = project.run("--inline-snapshot=create") > assert project.source == snapshot( """\ from inline_snapshot import external def test_a(): assert outsource("test") == snapshot(external("9f86d081884c*.txt")) """ ) /tmp/autopkgtest.ImMzGl/autopkgtest_tmp/tests/test_external.py:175: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '"""\\\nfrom inline_snapshot import external\n\ndef test_a():\n assert outsource("test") == snapshot()\n"""' filename = PosixPath('/tmp/autopkgtest.ImMzGl/autopkgtest_tmp/tests/test_external.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- write code: # äöß 🐍 from inline_snapshot import snapshot from inline_snapshot import outsource from inline_snapshot import external def test_a(): assert outsource("test") == snapshot() running: pytest --inline-snapshot=create in: /tmp/pytest-of-unshare/pytest-0/test_pytest_existing_external_import0 ============================= test session starts ============================== platform linux -- Python 3.13.1, pytest-8.3.4, pluggy-1.5.0 rootdir: /tmp/pytest-of-unshare/pytest-0/test_pytest_existing_external_import0 plugins: inline-snapshot-0.19.3, mock-3.14.0, hypothesis-6.124.0, time-machine-2.16.0, subtests-0.13.1, pytest_freezer-0.4.9 collected 1 item test_file.py F [100%] =================================== FAILURES =================================== ____________________________________ test_a ____________________________________ def test_a(): > assert outsource("test") == snapshot() test_file.py:7: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_pytest_existing_external_import0/test_file.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError =============================== inline snapshot ================================ =========================== short test summary info ============================ FAILED test_file.py::test_a - TypeError: CliRunner.__init__() got an unexpect... ============================== 1 failed in 0.16s =============================== __________________________ test_pytest_trim_external ___________________________ project = .Project object at 0x7f6a3f4658b0> def test_pytest_trim_external(project): project.setup( """\ def test_a(): assert outsource("test") == snapshot() # split assert outsource("test2") == snapshot() """ ) project.run("--inline-snapshot=create") > assert project.storage() == snapshot( [ "60303ae22b998861bce3b28f33eec1be758a213c86c93c076dbe9f558c11c752.txt", "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08.txt", ] ) /tmp/autopkgtest.ImMzGl/autopkgtest_tmp/tests/test_external.py:199: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign new_code = self.context.file._value_to_code(new_value_element) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code return self._token_to_code(value_to_token(value)) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = "'9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08-new.txt'" filename = PosixPath('/tmp/autopkgtest.ImMzGl/autopkgtest_tmp/tests/test_external.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- write code: # äöß 🐍 from inline_snapshot import snapshot from inline_snapshot import outsource def test_a(): assert outsource("test") == snapshot() # split assert outsource("test2") == snapshot() running: pytest --inline-snapshot=create in: /tmp/pytest-of-unshare/pytest-0/test_pytest_trim_external0 ============================= test session starts ============================== platform linux -- Python 3.13.1, pytest-8.3.4, pluggy-1.5.0 rootdir: /tmp/pytest-of-unshare/pytest-0/test_pytest_trim_external0 plugins: inline-snapshot-0.19.3, mock-3.14.0, hypothesis-6.124.0, time-machine-2.16.0, subtests-0.13.1, pytest_freezer-0.4.9 collected 1 item test_file.py F [100%] =================================== FAILURES =================================== ____________________________________ test_a ____________________________________ def test_a(): > assert outsource("test") == snapshot() test_file.py:7: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_pytest_trim_external0/test_file.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError =============================== inline snapshot ================================ =========================== short test summary info ============================ FAILED test_file.py::test_a - TypeError: CliRunner.__init__() got an unexpect... ============================== 1 failed in 0.16s =============================== ___________________________ test_pytest_new_external ___________________________ project = .Project object at 0x7f6a3f4678c0> def test_pytest_new_external(project): project.setup( """\ def test_a(): assert outsource("test") == snapshot() """ ) project.run() assert project.storage() == snapshot( ["9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08-new.txt"] ) project.run("--inline-snapshot=create") > assert project.storage() == snapshot( ["9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08.txt"] ) /tmp/autopkgtest.ImMzGl/autopkgtest_tmp/tests/test_external.py:255: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign v = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = "'9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08-new.txt'" filename = PosixPath('/tmp/autopkgtest.ImMzGl/autopkgtest_tmp/tests/test_external.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- write code: # äöß 🐍 from inline_snapshot import snapshot from inline_snapshot import outsource def test_a(): assert outsource("test") == snapshot() running: pytest in: /tmp/pytest-of-unshare/pytest-0/test_pytest_new_external0 ============================= test session starts ============================== platform linux -- Python 3.13.1, pytest-8.3.4, pluggy-1.5.0 rootdir: /tmp/pytest-of-unshare/pytest-0/test_pytest_new_external0 plugins: inline-snapshot-0.19.3, mock-3.14.0, hypothesis-6.124.0, time-machine-2.16.0, subtests-0.13.1, pytest_freezer-0.4.9 collected 1 item test_file.py FE [100%] ==================================== ERRORS ==================================== _________________________ ERROR at teardown of test_a __________________________ your snapshot is missing one value. =================================== FAILURES =================================== ____________________________________ test_a ____________________________________ def test_a(): > assert outsource("test") == snapshot() test_file.py:7: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_pytest_new_external0/test_file.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError =============================== inline snapshot ================================ =========================== short test summary info ============================ FAILED test_file.py::test_a - TypeError: CliRunner.__init__() got an unexpect... ERROR test_file.py::test_a - Failed: your snapshot is missing one value. ========================== 1 failed, 1 error in 0.17s ========================== running: pytest --inline-snapshot=create in: /tmp/pytest-of-unshare/pytest-0/test_pytest_new_external0 ============================= test session starts ============================== platform linux -- Python 3.13.1, pytest-8.3.4, pluggy-1.5.0 rootdir: /tmp/pytest-of-unshare/pytest-0/test_pytest_new_external0 plugins: inline-snapshot-0.19.3, mock-3.14.0, hypothesis-6.124.0, time-machine-2.16.0, subtests-0.13.1, pytest_freezer-0.4.9 collected 1 item test_file.py F [100%] =================================== FAILURES =================================== ____________________________________ test_a ____________________________________ def test_a(): > assert outsource("test") == snapshot() test_file.py:7: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_pytest_new_external0/test_file.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError =============================== inline snapshot ================================ =========================== short test summary info ============================ FAILED test_file.py::test_a - TypeError: CliRunner.__init__() got an unexpect... ============================== 1 failed in 0.16s =============================== ________________________ test_pytest_config_hash_length ________________________ project = .Project object at 0x7f6a3f467f50> def test_pytest_config_hash_length(project): project.setup( """\ def test_a(): assert outsource("test") == snapshot() """ ) project.run("--inline-snapshot=create") default_result = project.source # default config project.pyproject( """ [tool.inline-snapshot] """ ) project.run("--inline-snapshot=create") assert default_result == project.source # set hash_length project.pyproject( """ [tool.inline-snapshot] hash-length=5 """ ) project.run("--inline-snapshot=create") > assert project.source == snapshot( """\ from inline_snapshot import external def test_a(): assert outsource("test") == snapshot(external("9f86d081884c*.txt")) """ ) /tmp/autopkgtest.ImMzGl/autopkgtest_tmp/tests/test_external.py:287: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '"""\\\ndef test_a():\n assert outsource("test") == snapshot()\n"""' filename = PosixPath('/tmp/autopkgtest.ImMzGl/autopkgtest_tmp/tests/test_external.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- write code: # äöß 🐍 from inline_snapshot import snapshot from inline_snapshot import outsource def test_a(): assert outsource("test") == snapshot() running: pytest --inline-snapshot=create in: /tmp/pytest-of-unshare/pytest-0/test_pytest_config_hash_length0 ============================= test session starts ============================== platform linux -- Python 3.13.1, pytest-8.3.4, pluggy-1.5.0 rootdir: /tmp/pytest-of-unshare/pytest-0/test_pytest_config_hash_length0 plugins: inline-snapshot-0.19.3, mock-3.14.0, hypothesis-6.124.0, time-machine-2.16.0, subtests-0.13.1, pytest_freezer-0.4.9 collected 1 item test_file.py F [100%] =================================== FAILURES =================================== ____________________________________ test_a ____________________________________ def test_a(): > assert outsource("test") == snapshot() test_file.py:7: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_pytest_config_hash_length0/test_file.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError =============================== inline snapshot ================================ =========================== short test summary info ============================ FAILED test_file.py::test_a - TypeError: CliRunner.__init__() got an unexpect... ============================== 1 failed in 0.16s =============================== running: pytest --inline-snapshot=create in: /tmp/pytest-of-unshare/pytest-0/test_pytest_config_hash_length0 ============================= test session starts ============================== platform linux -- Python 3.13.1, pytest-8.3.4, pluggy-1.5.0 rootdir: /tmp/pytest-of-unshare/pytest-0/test_pytest_config_hash_length0 configfile: pyproject.toml plugins: inline-snapshot-0.19.3, mock-3.14.0, hypothesis-6.124.0, time-machine-2.16.0, subtests-0.13.1, pytest_freezer-0.4.9 collected 1 item test_file.py F [100%] =================================== FAILURES =================================== ____________________________________ test_a ____________________________________ def test_a(): > assert outsource("test") == snapshot() test_file.py:7: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_pytest_config_hash_length0/test_file.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError =============================== inline snapshot ================================ =========================== short test summary info ============================ FAILED test_file.py::test_a - TypeError: CliRunner.__init__() got an unexpect... ============================== 1 failed in 0.16s =============================== running: pytest --inline-snapshot=create in: /tmp/pytest-of-unshare/pytest-0/test_pytest_config_hash_length0 ============================= test session starts ============================== platform linux -- Python 3.13.1, pytest-8.3.4, pluggy-1.5.0 rootdir: /tmp/pytest-of-unshare/pytest-0/test_pytest_config_hash_length0 configfile: pyproject.toml plugins: inline-snapshot-0.19.3, mock-3.14.0, hypothesis-6.124.0, time-machine-2.16.0, subtests-0.13.1, pytest_freezer-0.4.9 collected 1 item test_file.py F [100%] =================================== FAILURES =================================== ____________________________________ test_a ____________________________________ def test_a(): > assert outsource("test") == snapshot() test_file.py:7: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_pytest_config_hash_length0/test_file.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError =============================== inline snapshot ================================ =========================== short test summary info ============================ FAILED test_file.py::test_a - TypeError: CliRunner.__init__() got an unexpect... ============================== 1 failed in 0.16s =============================== _______________________________ test_no_imports ________________________________ project = .Project object at 0x7f6a3f4976e0> def test_no_imports(project): project.setup( """\ # no imports def test_something(): from inline_snapshot import outsource,snapshot assert outsource("test") == snapshot() test_something() """ ) result = project.run("--inline-snapshot=create") > result.assert_outcomes(passed=1) E AssertionError: assert {'errors': 1,...pped': 0, ...} == {'errors': 0,...pped': 0, ...} E E Omitting 4 identical items, use -vv to show E Differing items: E {'passed': 0} != {'passed': 1} E {'errors': 1} != {'errors': 0} E Use -v to get more diff /tmp/autopkgtest.ImMzGl/autopkgtest_tmp/tests/test_external.py:340: AssertionError ----------------------------- Captured stdout call ----------------------------- write code: # äöß 🐍 # no imports def test_something(): from inline_snapshot import outsource,snapshot assert outsource("test") == snapshot() test_something() running: pytest --inline-snapshot=create in: /tmp/pytest-of-unshare/pytest-0/test_no_imports0 ============================= test session starts ============================== platform linux -- Python 3.13.1, pytest-8.3.4, pluggy-1.5.0 rootdir: /tmp/pytest-of-unshare/pytest-0/test_no_imports0 plugins: inline-snapshot-0.19.3, mock-3.14.0, hypothesis-6.124.0, time-machine-2.16.0, subtests-0.13.1, pytest_freezer-0.4.9 collected 0 items / 1 error ==================================== ERRORS ==================================== ________________________ ERROR collecting test_file.py _________________________ test_file.py:9: in test_something() test_file.py:8: in test_something assert outsource("test") == snapshot() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: in format_code runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' =============================== inline snapshot ================================ =========================== short test summary info ============================ ERROR test_file.py - TypeError: CliRunner.__init__() got an unexpected keywor... !!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!! =============================== 1 error in 0.14s =============================== _____________________________ test_ensure_imports ______________________________ tmp_path = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_ensure_imports0') def test_ensure_imports(tmp_path): file = tmp_path / "file.py" file.write_text( """\ from os import environ from os import getcwd """, "utf-8", ) > with apply_changes(): tests/test_external.py:372: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3.12/contextlib.py:144: in __exit__ next(self.gen) tests/utils.py:32: in apply_changes recorder.fix_all() /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all file.rewrite() /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite new_code = self.new_code() /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code format_whole_file = enforce_formatting() or code == format_code( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = 'from os import environ\nfrom os import getcwd\n' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_ensure_imports0/file.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError _______________________ test_ensure_imports_with_comment _______________________ tmp_path = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_ensure_imports_with_comme0') def test_ensure_imports_with_comment(tmp_path): file = tmp_path / "file.py" file.write_text( """\ from os import environ # comment """, "utf-8", ) > with apply_changes(): tests/test_external.py:394: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3.12/contextlib.py:144: in __exit__ next(self.gen) tests/utils.py:32: in apply_changes recorder.fix_all() /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all file.rewrite() /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite new_code = self.new_code() /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code format_whole_file = enforce_formatting() or code == format_code( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = 'from os import environ # comment\n' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_ensure_imports_with_comme0/file.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ______________________________ test_new_externals ______________________________ project = .Project object at 0x7f6a3f3cacf0> def test_new_externals(project): project.setup( """ def test_something(): outsource("blub") assert outsource("foo") == snapshot() """ ) project.run("--inline-snapshot=create") > assert project.storage() == snapshot( [ "2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae.txt", "8dc140e6fe831481a2005ae152ffe32a9974aa92a260dfbac780d6a87154bb0b-new.txt", ] ) /tmp/autopkgtest.ImMzGl/autopkgtest_tmp/tests/test_external.py:420: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign v = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = "'2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae-new.txt'" filename = PosixPath('/tmp/autopkgtest.ImMzGl/autopkgtest_tmp/tests/test_external.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- write code: # äöß 🐍 from inline_snapshot import snapshot from inline_snapshot import outsource def test_something(): outsource("blub") assert outsource("foo") == snapshot() running: pytest --inline-snapshot=create in: /tmp/pytest-of-unshare/pytest-0/test_new_externals0 ============================= test session starts ============================== platform linux -- Python 3.13.1, pytest-8.3.4, pluggy-1.5.0 rootdir: /tmp/pytest-of-unshare/pytest-0/test_new_externals0 plugins: inline-snapshot-0.19.3, mock-3.14.0, hypothesis-6.124.0, time-machine-2.16.0, subtests-0.13.1, pytest_freezer-0.4.9 collected 1 item test_file.py F [100%] =================================== FAILURES =================================== ________________________________ test_something ________________________________ def test_something(): outsource("blub") > assert outsource("foo") == snapshot() test_file.py:11: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_new_externals0/test_file.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError =============================== inline snapshot ================================ =========================== short test summary info ============================ FAILED test_file.py::test_something - TypeError: CliRunner.__init__() got an ... ============================== 1 failed in 0.16s =============================== _________________________ test_black_formatting_error __________________________ mocker = def test_black_formatting_error(mocker): mocker.patch.object(CliRunner, "invoke", return_value=SimpleNamespace(exit_code=1)) Example( """\ from inline_snapshot import snapshot def test_something(): assert 1==snapshot() assert 1==snapshot(2) assert list(range(20)) == snapshot() """ > ).run_inline( ["--inline-snapshot=fix,create"], changed_files=snapshot( { "test_something.py": """\ from inline_snapshot import snapshot def test_something(): assert 1==snapshot(1) assert 1==snapshot(1) 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 ]) """ } ), report=snapshot( """\ ----------------------------------- Problems ----------------------------------- black could not format your code, which might be caused by this issue: https://github.com/15r10nk/inline-snapshot/issues/138 """ ), ) tests/test_formating.py:24: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = args = ['--inline-snapshot=fix,create'] def run_inline( self, args: list[str] = [], *, reported_categories: Snapshot[list[Category]] | None = None, changed_files: Snapshot[dict[str, str]] | None = None, report: Snapshot[str] | None = None, raises: Snapshot[str] | None = None, ) -> Example: """Execute the example files in process and run every `test_*` function. This is useful for fast test execution. Parameters: args: inline-snapshot arguments (supports only "--inline-snapshot=fix|create|..." ). reported_categories: snapshot of categories which inline-snapshot thinks could be applied. changed_files: snapshot of files which are changed by this run. raises: snapshot of the exception which is raised during the test execution. It is required if your code raises an exception. Returns: A new Example instance which contains the changed files. """ parser = ArgumentParser() parser.add_argument( "--inline-snapshot", metavar="(disable,short-report,report,review,create,update,trim,fix)*", dest="inline_snapshot", help="update specific snapshot values:\n" "disable: disable the snapshot logic\n" "short-report: show a short report\n" "report: show a longer report with a diff report\n" "review: allow to approve the changes interactive\n" "create: creates snapshots which are currently not defined\n" "update: update snapshots even if they are defined\n" "trim: changes the snapshot in a way which will make the snapshot more precise.\n" "fix: change snapshots which currently break your tests\n", ) parsed_args = parser.parse_args(args) flags = (parsed_args.inline_snapshot or "").split(",") with TemporaryDirectory() as dir: tmp_path = Path(dir) self._write_files(tmp_path) raised_exception = None with snapshot_env(): with ChangeRecorder().activate() as recorder: _inline_snapshot._update_flags = Flags({*flags}) inline_snapshot._external.storage = ( inline_snapshot._external.DiscStorage(tmp_path / ".storage") ) try: for filename in tmp_path.glob("*.py"): globals: dict[str, Any] = {} print("run> pytest", filename) exec( compile(filename.read_text("utf-8"), filename, "exec"), globals, ) # run all test_* functions for k, v in globals.items(): if k.startswith("test_") and callable(v): v() except Exception as e: traceback.print_exc() raised_exception = e finally: _inline_snapshot._active = False changes = [] for snapshot in _inline_snapshot.snapshots.values(): changes += snapshot._changes() snapshot_flags = {change.flag for change in changes} apply_all( [ change for change in changes if change.flag in _inline_snapshot._update_flags.to_set() ] ) recorder.fix_all() report_output = StringIO() console = Console(file=report_output) # TODO: add all the report output here report_problems(console) if reported_categories is not None: assert sorted(snapshot_flags) == reported_categories if raised_exception is not None: > assert raises == f"{type(raised_exception).__name__}:\n" + str( raised_exception ) E assert None == ('TypeError:\n' + "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'") E + where "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'" = str(TypeError("CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'")) /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: AssertionError ----------------------------- Captured stdout call ----------------------------- file: test_something.py from inline_snapshot import snapshot def test_something(): assert 1==snapshot() assert 1==snapshot(2) assert list(range(20)) == snapshot() run> pytest /tmp/tmp3i3hogql/test_something.py ----------------------------- Captured stderr call ----------------------------- Traceback (most recent call last): File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 193, in run_inline v() File "/tmp/tmp3i3hogql/test_something.py", line 4, in test_something assert 1==snapshot() ^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ return self == other ^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ self._changes.append(next(it)) ^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign new_code = self.context.file._token_to_code(new_token) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format return format_code(text, Path(self._source.filename)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code runner = CliRunner(mix_stderr=False) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' _______________________________ test_fstring_139 _______________________________ def test_fstring_139(): Example( """ from inline_snapshot import snapshot snapshot(f'') snapshot(rf'') snapshot(Rf'') snapshot(F'') snapshot(rF'') snapshot(RF'') def test_a(): return None """ > ).run_pytest(returncode=0) tests/test_formating.py:64: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = args = [] def run_pytest( self, args: list[str] = [], *, term_columns=80, env: dict[str, str] = {}, changed_files: Snapshot[dict[str, str]] | None = None, report: Snapshot[str] | None = None, stderr: Snapshot[str] | None = None, returncode: Snapshot[int] | None = None, ) -> Example: """Run pytest with the given args and env variables in an seperate process. It can be used to test the interaction between your code and pytest, but it is a bit slower than `run_inline` Parameters: args: pytest arguments like "--inline-snapshot=fix" env: dict of environment variables changed_files: snapshot of files which are changed by this run. report: snapshot of the report at the end of the pytest run. stderr: pytest stderr output returncode: snapshot of the pytest returncode. Returns: A new Example instance which contains the changed files. """ with TemporaryDirectory() as dir: tmp_path = Path(dir) self._write_files(tmp_path) cmd = [sys.executable, "-m", "pytest", *args] command_env = dict(os.environ) command_env["TERM"] = "unknown" command_env["COLUMNS"] = str( term_columns + 1 if platform.system() == "Windows" else term_columns ) command_env.pop("CI", None) command_env.update(env) result = sp.run(cmd, cwd=tmp_path, capture_output=True, env=command_env) print("run>", *cmd) print("stdout:") print(result.stdout.decode()) print("stderr:") print(result.stderr.decode()) if returncode is not None: > assert result.returncode == returncode E AssertionError: assert 1 == 0 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 /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:297: AssertionError ----------------------------- Captured stdout call ----------------------------- file: test_something.py from inline_snapshot import snapshot snapshot(f'') snapshot(rf'') snapshot(Rf'') snapshot(F'') snapshot(rF'') snapshot(RF'') def test_a(): return None run> /usr/bin/python3.12 -m pytest stdout: ============================= test session starts ============================== platform linux -- Python 3.12.8, pytest-8.3.4, pluggy-1.5.0 rootdir: /tmp/tmp41qg6s30 plugins: inline-snapshot-0.19.3, mock-3.14.0, hypothesis-6.124.0, time-machine-2.16.0, subtests-0.13.1, pytest_freezer-0.4.9 collected 1 item test_something.py . [100%] =============================== inline snapshot ================================ stderr: Traceback (most recent call last): File "", line 198, in _run_module_as_main File "", line 88, in _run_code File "/usr/lib/python3/dist-packages/pytest/__main__.py", line 9, in raise SystemExit(pytest.console_main()) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 201, in console_main code = main() ^^^^^^ File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 175, in main ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec return self._inner_hookexec(hook_name, methods, kwargs, firstresult) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall raise exception.with_traceback(exception.__traceback__) File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall res = hook_impl.function(*args) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/_pytest/main.py", line 330, in pytest_cmdline_main return wrap_session(config, _main) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/_pytest/main.py", line 318, in wrap_session config.hook.pytest_sessionfinish( File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec return self._inner_hookexec(hook_name, methods, kwargs, firstresult) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall raise exception.with_traceback(exception.__traceback__) File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall teardown.throw(exception) # type: ignore[union-attr] ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/_pytest/logging.py", line 868, in pytest_sessionfinish return (yield) ^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 124, in _multicall teardown.send(result) # type: ignore[union-attr] ^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 903, in pytest_sessionfinish self.config.hook.pytest_terminal_summary( File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec return self._inner_hookexec(hook_name, methods, kwargs, firstresult) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall raise exception.with_traceback(exception.__traceback__) File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall teardown.throw(exception) # type: ignore[union-attr] ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 925, in pytest_terminal_summary return (yield) ^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall teardown.throw(exception) # type: ignore[union-attr] ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/_pytest/warnings.py", line 132, in pytest_terminal_summary return (yield) ^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall res = hook_impl.function(*args) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/pytest_plugin.py", line 271, in pytest_terminal_summary for change in snapshot._changes(): ^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 671, in _changes yield from self._value._get_changes() File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 218, in _get_changes yield from handle(self._ast_node, self._old_value) File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 206, in handle new_code = self._file._token_to_code(new_token) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format return format_code(text, Path(self._source.filename)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code runner = CliRunner(mix_stderr=False) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' _______________ test_generic[executing] [assert 4 == snapshot()] _______________ source = .w at 0x7f6a3f3f98a0> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) executing_used = True def test_generic(source, subtests, executing_used): codes = [] for op in operations: codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) if op.svalue: codes.append( ( f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", op.flag, ) ) else: codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) all_flags = ["trim", "fix", "create", "update"] for code, reported_flag in codes: with subtests.test(code): > s = source(code) tests/test_inline_snapshot.py:79: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic_executing_0/test_1.py:9: in assert 4 == snapshot() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_executing_0/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert 4 == snapshot() ------------------------------ Captured log call ------------------------------- ____________ test_generic[executing] [assert 4 == snapshot({})[0]] _____________ source = .w at 0x7f6a3f3f98a0> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) executing_used = True def test_generic(source, subtests, executing_used): codes = [] for op in operations: codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) if op.svalue: codes.append( ( f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", op.flag, ) ) else: codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) all_flags = ["trim", "fix", "create", "update"] for code, reported_flag in codes: with subtests.test(code): > s = source(code) tests/test_inline_snapshot.py:79: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic_executing_0/test_2.py:9: in assert 4 == snapshot({})[0] /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_executing_0/test_2.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert 4 == snapshot({})[0] ------------------------------ Captured log call ------------------------------- ______________ test_generic[executing] [assert 4 == snapshot(5)] _______________ source = .w at 0x7f6a3f3f98a0> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) executing_used = True def test_generic(source, subtests, executing_used): codes = [] for op in operations: codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) if op.svalue: codes.append( ( f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", op.flag, ) ) else: codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) all_flags = ["trim", "fix", "create", "update"] for code, reported_flag in codes: with subtests.test(code): > s = source(code) tests/test_inline_snapshot.py:79: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic_executing_0/test_3.py:9: in assert 4 == snapshot(5) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_executing_0/test_3.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert 4 == snapshot(5) ------------------------------ Captured log call ------------------------------- __________ test_generic[executing] [assert 4 == snapshot({0: 5})[0]] ___________ source = .w at 0x7f6a3f3f98a0> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) executing_used = True def test_generic(source, subtests, executing_used): codes = [] for op in operations: codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) if op.svalue: codes.append( ( f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", op.flag, ) ) else: codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) all_flags = ["trim", "fix", "create", "update"] for code, reported_flag in codes: with subtests.test(code): > s = source(code) tests/test_inline_snapshot.py:79: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic_executing_0/test_4.py:9: in assert 4 == snapshot({0: 5})[0] /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_executing_0/test_4.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert 4 == snapshot({0: 5})[0] ------------------------------ Captured log call ------------------------------- _____________ test_generic[executing] [assert 4 == snapshot(2+2)] ______________ source = .w at 0x7f6a3f3f98a0> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) executing_used = True def test_generic(source, subtests, executing_used): codes = [] for op in operations: codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) if op.svalue: codes.append( ( f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", op.flag, ) ) else: codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) all_flags = ["trim", "fix", "create", "update"] for code, reported_flag in codes: with subtests.test(code): > s = source(code) tests/test_inline_snapshot.py:79: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic_executing_0/test_5.py:9: in assert 4 == snapshot(2+2) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_executing_0/test_5.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert 4 == snapshot(2+2) ------------------------------ Captured log call ------------------------------- _________ test_generic[executing] [assert 4 == snapshot({0: 2+2})[0]] __________ source = .w at 0x7f6a3f3f98a0> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) executing_used = True def test_generic(source, subtests, executing_used): codes = [] for op in operations: codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) if op.svalue: codes.append( ( f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", op.flag, ) ) else: codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) all_flags = ["trim", "fix", "create", "update"] for code, reported_flag in codes: with subtests.test(code): > s = source(code) tests/test_inline_snapshot.py:79: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic_executing_0/test_6.py:9: in assert 4 == snapshot({0: 2+2})[0] /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_executing_0/test_6.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert 4 == snapshot({0: 2+2})[0] ------------------------------ Captured log call ------------------------------- _______________ test_generic[executing] [assert 4 <= snapshot()] _______________ source = .w at 0x7f6a3f3f98a0> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) executing_used = True def test_generic(source, subtests, executing_used): codes = [] for op in operations: codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) if op.svalue: codes.append( ( f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", op.flag, ) ) else: codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) all_flags = ["trim", "fix", "create", "update"] for code, reported_flag in codes: with subtests.test(code): > s = source(code) tests/test_inline_snapshot.py:79: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:125: in run changes += snapshot._changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:657: in _changes new_code = self._value._new_code() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:321: in _new_code return self._file._value_to_code(self._new_value) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code return self._token_to_code(value_to_token(value)) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_executing_0/test_7.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert 4 <= snapshot() ------------------------------ Captured log call ------------------------------- ____________ test_generic[executing] [assert 4 <= snapshot({})[0]] _____________ source = .w at 0x7f6a3f3f98a0> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) executing_used = True def test_generic(source, subtests, executing_used): codes = [] for op in operations: codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) if op.svalue: codes.append( ( f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", op.flag, ) ) else: codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) all_flags = ["trim", "fix", "create", "update"] for code, reported_flag in codes: with subtests.test(code): > s = source(code) tests/test_inline_snapshot.py:79: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:125: in run changes += snapshot._changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes yield from self._value._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:534: in _get_changes to_insert.append((key, new_value_element._new_code())) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:321: in _new_code return self._file._value_to_code(self._new_value) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code return self._token_to_code(value_to_token(value)) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_executing_0/test_8.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert 4 <= snapshot({})[0] ------------------------------ Captured log call ------------------------------- ______________ test_generic[executing] [assert 4 <= snapshot(5)] _______________ source = .w at 0x7f6a3f3f98a0> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) executing_used = True def test_generic(source, subtests, executing_used): codes = [] for op in operations: codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) if op.svalue: codes.append( ( f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", op.flag, ) ) else: codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) all_flags = ["trim", "fix", "create", "update"] for code, reported_flag in codes: with subtests.test(code): > s = source(code) tests/test_inline_snapshot.py:79: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:125: in run changes += snapshot._changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes yield from self._value._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes new_code = self._file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_executing_0/test_9.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert 4 <= snapshot(5) ------------------------------ Captured log call ------------------------------- __________ test_generic[executing] [assert 4 <= snapshot({0: 5})[0]] ___________ source = .w at 0x7f6a3f3f98a0> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) executing_used = True def test_generic(source, subtests, executing_used): codes = [] for op in operations: codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) if op.svalue: codes.append( ( f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", op.flag, ) ) else: codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) all_flags = ["trim", "fix", "create", "update"] for code, reported_flag in codes: with subtests.test(code): > s = source(code) tests/test_inline_snapshot.py:79: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:125: in run changes += snapshot._changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes yield from self._value._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes yield from self._new_value[key]._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes new_code = self._file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_executing_0/test_10.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert 4 <= snapshot({0: 5})[0] ------------------------------ Captured log call ------------------------------- ______________ test_generic[executing] [assert 5 <= snapshot(4)] _______________ source = .w at 0x7f6a3f3f98a0> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) executing_used = True def test_generic(source, subtests, executing_used): codes = [] for op in operations: codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) if op.svalue: codes.append( ( f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", op.flag, ) ) else: codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) all_flags = ["trim", "fix", "create", "update"] for code, reported_flag in codes: with subtests.test(code): > s = source(code) tests/test_inline_snapshot.py:79: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:125: in run changes += snapshot._changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes yield from self._value._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes new_code = self._file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '5 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_executing_0/test_11.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert 5 <= snapshot(4) ----------------------------- Captured stderr call ----------------------------- Traceback (most recent call last): File "/tmp/autopkgtest.ImMzGl/autopkgtest_tmp/tests/conftest.py", line 114, in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) File "/tmp/pytest-of-unshare/pytest-0/test_generic_executing_0/test_11.py", line 9, in assert 5 <= snapshot(4) ^^^^^^^^^^^^^^^^ AssertionError ------------------------------ Captured log call ------------------------------- __________ test_generic[executing] [assert 5 <= snapshot({0: 4})[0]] ___________ source = .w at 0x7f6a3f3f98a0> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) executing_used = True def test_generic(source, subtests, executing_used): codes = [] for op in operations: codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) if op.svalue: codes.append( ( f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", op.flag, ) ) else: codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) all_flags = ["trim", "fix", "create", "update"] for code, reported_flag in codes: with subtests.test(code): > s = source(code) tests/test_inline_snapshot.py:79: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:125: in run changes += snapshot._changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes yield from self._value._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes yield from self._new_value[key]._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes new_code = self._file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '5 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_executing_0/test_12.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert 5 <= snapshot({0: 4})[0] ----------------------------- Captured stderr call ----------------------------- Traceback (most recent call last): File "/tmp/autopkgtest.ImMzGl/autopkgtest_tmp/tests/conftest.py", line 114, in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) File "/tmp/pytest-of-unshare/pytest-0/test_generic_executing_0/test_12.py", line 9, in assert 5 <= snapshot({0: 4})[0] ^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError ------------------------------ Captured log call ------------------------------- _____________ test_generic[executing] [assert 5 <= snapshot(3+2)] ______________ source = .w at 0x7f6a3f3f98a0> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) executing_used = True def test_generic(source, subtests, executing_used): codes = [] for op in operations: codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) if op.svalue: codes.append( ( f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", op.flag, ) ) else: codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) all_flags = ["trim", "fix", "create", "update"] for code, reported_flag in codes: with subtests.test(code): > s = source(code) tests/test_inline_snapshot.py:79: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:125: in run changes += snapshot._changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes yield from self._value._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes new_code = self._file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '5 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_executing_0/test_13.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert 5 <= snapshot(3+2) ------------------------------ Captured log call ------------------------------- _________ test_generic[executing] [assert 5 <= snapshot({0: 3+2})[0]] __________ source = .w at 0x7f6a3f3f98a0> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) executing_used = True def test_generic(source, subtests, executing_used): codes = [] for op in operations: codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) if op.svalue: codes.append( ( f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", op.flag, ) ) else: codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) all_flags = ["trim", "fix", "create", "update"] for code, reported_flag in codes: with subtests.test(code): > s = source(code) tests/test_inline_snapshot.py:79: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:125: in run changes += snapshot._changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes yield from self._value._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes yield from self._new_value[key]._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes new_code = self._file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '5 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_executing_0/test_14.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert 5 <= snapshot({0: 3+2})[0] ------------------------------ Captured log call ------------------------------- _______________ test_generic[executing] [assert 5 >= snapshot()] _______________ source = .w at 0x7f6a3f3f98a0> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) executing_used = True def test_generic(source, subtests, executing_used): codes = [] for op in operations: codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) if op.svalue: codes.append( ( f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", op.flag, ) ) else: codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) all_flags = ["trim", "fix", "create", "update"] for code, reported_flag in codes: with subtests.test(code): > s = source(code) tests/test_inline_snapshot.py:79: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:125: in run changes += snapshot._changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:657: in _changes new_code = self._value._new_code() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:321: in _new_code return self._file._value_to_code(self._new_value) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code return self._token_to_code(value_to_token(value)) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '5 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_executing_0/test_15.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert 5 >= snapshot() ------------------------------ Captured log call ------------------------------- ____________ test_generic[executing] [assert 5 >= snapshot({})[0]] _____________ source = .w at 0x7f6a3f3f98a0> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) executing_used = True def test_generic(source, subtests, executing_used): codes = [] for op in operations: codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) if op.svalue: codes.append( ( f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", op.flag, ) ) else: codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) all_flags = ["trim", "fix", "create", "update"] for code, reported_flag in codes: with subtests.test(code): > s = source(code) tests/test_inline_snapshot.py:79: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:125: in run changes += snapshot._changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes yield from self._value._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:534: in _get_changes to_insert.append((key, new_value_element._new_code())) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:321: in _new_code return self._file._value_to_code(self._new_value) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code return self._token_to_code(value_to_token(value)) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '5 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_executing_0/test_16.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert 5 >= snapshot({})[0] ------------------------------ Captured log call ------------------------------- ______________ test_generic[executing] [assert 5 >= snapshot(4)] _______________ source = .w at 0x7f6a3f3f98a0> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) executing_used = True def test_generic(source, subtests, executing_used): codes = [] for op in operations: codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) if op.svalue: codes.append( ( f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", op.flag, ) ) else: codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) all_flags = ["trim", "fix", "create", "update"] for code, reported_flag in codes: with subtests.test(code): > s = source(code) tests/test_inline_snapshot.py:79: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:125: in run changes += snapshot._changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes yield from self._value._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes new_code = self._file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '5 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_executing_0/test_17.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert 5 >= snapshot(4) ------------------------------ Captured log call ------------------------------- __________ test_generic[executing] [assert 5 >= snapshot({0: 4})[0]] ___________ source = .w at 0x7f6a3f3f98a0> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) executing_used = True def test_generic(source, subtests, executing_used): codes = [] for op in operations: codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) if op.svalue: codes.append( ( f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", op.flag, ) ) else: codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) all_flags = ["trim", "fix", "create", "update"] for code, reported_flag in codes: with subtests.test(code): > s = source(code) tests/test_inline_snapshot.py:79: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:125: in run changes += snapshot._changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes yield from self._value._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes yield from self._new_value[key]._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes new_code = self._file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '5 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_executing_0/test_18.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert 5 >= snapshot({0: 4})[0] ------------------------------ Captured log call ------------------------------- ______________ test_generic[executing] [assert 4 >= snapshot(5)] _______________ source = .w at 0x7f6a3f3f98a0> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) executing_used = True def test_generic(source, subtests, executing_used): codes = [] for op in operations: codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) if op.svalue: codes.append( ( f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", op.flag, ) ) else: codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) all_flags = ["trim", "fix", "create", "update"] for code, reported_flag in codes: with subtests.test(code): > s = source(code) tests/test_inline_snapshot.py:79: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:125: in run changes += snapshot._changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes yield from self._value._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes new_code = self._file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_executing_0/test_19.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert 4 >= snapshot(5) ----------------------------- Captured stderr call ----------------------------- Traceback (most recent call last): File "/tmp/autopkgtest.ImMzGl/autopkgtest_tmp/tests/conftest.py", line 114, in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) File "/tmp/pytest-of-unshare/pytest-0/test_generic_executing_0/test_19.py", line 9, in assert 4 >= snapshot(5) ^^^^^^^^^^^^^^^^ AssertionError ------------------------------ Captured log call ------------------------------- __________ test_generic[executing] [assert 4 >= snapshot({0: 5})[0]] ___________ source = .w at 0x7f6a3f3f98a0> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) executing_used = True def test_generic(source, subtests, executing_used): codes = [] for op in operations: codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) if op.svalue: codes.append( ( f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", op.flag, ) ) else: codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) all_flags = ["trim", "fix", "create", "update"] for code, reported_flag in codes: with subtests.test(code): > s = source(code) tests/test_inline_snapshot.py:79: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:125: in run changes += snapshot._changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes yield from self._value._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes yield from self._new_value[key]._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes new_code = self._file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_executing_0/test_20.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert 4 >= snapshot({0: 5})[0] ----------------------------- Captured stderr call ----------------------------- Traceback (most recent call last): File "/tmp/autopkgtest.ImMzGl/autopkgtest_tmp/tests/conftest.py", line 114, in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) File "/tmp/pytest-of-unshare/pytest-0/test_generic_executing_0/test_20.py", line 9, in assert 4 >= snapshot({0: 5})[0] ^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError ------------------------------ Captured log call ------------------------------- _____________ test_generic[executing] [assert 5 >= snapshot(3+2)] ______________ source = .w at 0x7f6a3f3f98a0> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) executing_used = True def test_generic(source, subtests, executing_used): codes = [] for op in operations: codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) if op.svalue: codes.append( ( f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", op.flag, ) ) else: codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) all_flags = ["trim", "fix", "create", "update"] for code, reported_flag in codes: with subtests.test(code): > s = source(code) tests/test_inline_snapshot.py:79: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:125: in run changes += snapshot._changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes yield from self._value._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes new_code = self._file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '5 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_executing_0/test_21.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert 5 >= snapshot(3+2) ------------------------------ Captured log call ------------------------------- _________ test_generic[executing] [assert 5 >= snapshot({0: 3+2})[0]] __________ source = .w at 0x7f6a3f3f98a0> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) executing_used = True def test_generic(source, subtests, executing_used): codes = [] for op in operations: codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) if op.svalue: codes.append( ( f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", op.flag, ) ) else: codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) all_flags = ["trim", "fix", "create", "update"] for code, reported_flag in codes: with subtests.test(code): > s = source(code) tests/test_inline_snapshot.py:79: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:125: in run changes += snapshot._changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes yield from self._value._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes yield from self._new_value[key]._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes new_code = self._file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '5 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_executing_0/test_22.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert 5 >= snapshot({0: 3+2})[0] ------------------------------ Captured log call ------------------------------- _______________ test_generic[executing] [assert 5 in snapshot()] _______________ source = .w at 0x7f6a3f3f98a0> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) executing_used = True def test_generic(source, subtests, executing_used): codes = [] for op in operations: codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) if op.svalue: codes.append( ( f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", op.flag, ) ) else: codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) all_flags = ["trim", "fix", "create", "update"] for code, reported_flag in codes: with subtests.test(code): > s = source(code) tests/test_inline_snapshot.py:79: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:125: in run changes += snapshot._changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:657: in _changes new_code = self._value._new_code() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:411: in _new_code return self._file._value_to_code(self._new_value) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code return self._token_to_code(value_to_token(value)) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '[5 ]' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_executing_0/test_23.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert 5 in snapshot() ------------------------------ Captured log call ------------------------------- ____________ test_generic[executing] [assert 5 in snapshot({})[0]] _____________ source = .w at 0x7f6a3f3f98a0> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) executing_used = True def test_generic(source, subtests, executing_used): codes = [] for op in operations: codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) if op.svalue: codes.append( ( f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", op.flag, ) ) else: codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) all_flags = ["trim", "fix", "create", "update"] for code, reported_flag in codes: with subtests.test(code): > s = source(code) tests/test_inline_snapshot.py:79: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:125: in run changes += snapshot._changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes yield from self._value._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:534: in _get_changes to_insert.append((key, new_value_element._new_code())) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:411: in _new_code return self._file._value_to_code(self._new_value) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code return self._token_to_code(value_to_token(value)) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '[5 ]' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_executing_0/test_24.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert 5 in snapshot({})[0] ------------------------------ Captured log call ------------------------------- ____________ test_generic[executing] [assert 5 in snapshot([4, 5])] ____________ source = .w at 0x7f6a3f3f98a0> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) executing_used = True def test_generic(source, subtests, executing_used): codes = [] for op in operations: codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) if op.svalue: codes.append( ( f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", op.flag, ) ) else: codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) all_flags = ["trim", "fix", "create", "update"] for code, reported_flag in codes: with subtests.test(code): s = source(code) print("source:", code) if not executing_used and reported_flag == "update": assert not s.flags else: assert list(s.flags) == [reported_flag] assert (reported_flag == "fix") == s.error for flag in all_flags: if flag == reported_flag: continue print("use flag:", flag) s2 = s.run(flag) assert s2.source == s.source if not executing_used: continue > s2 = s.run(reported_flag) tests/test_inline_snapshot.py:99: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:137: in run recorder.fix_all() /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all file.rewrite() /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite new_code = self.new_code() /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code format_whole_file = enforce_formatting() or code == format_code( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 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])' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_executing_0/test_29.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert 5 in snapshot([4, 5]) reported_flags: {'trim'} run: pytest --inline-snapshot= output: |assert 5 in snapshot([4, 5]) source: assert 5 in snapshot([4, 5]) use flag: fix input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert 5 in snapshot([4, 5]) reported_flags: {'trim'} run: pytest --inline-snapshot=fix output: |assert 5 in snapshot([4, 5]) use flag: create input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert 5 in snapshot([4, 5]) reported_flags: {'trim'} run: pytest --inline-snapshot=create output: |assert 5 in snapshot([4, 5]) use flag: update input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert 5 in snapshot([4, 5]) reported_flags: {'trim'} run: pytest --inline-snapshot=update output: |assert 5 in snapshot([4, 5]) input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert 5 in snapshot([4, 5]) ------------------------------ Captured log call ------------------------------- ________ test_generic[executing] [assert 5 in snapshot({0: [4, 5]})[0]] ________ source = .w at 0x7f6a3f3f98a0> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) executing_used = True def test_generic(source, subtests, executing_used): codes = [] for op in operations: codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) if op.svalue: codes.append( ( f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", op.flag, ) ) else: codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) all_flags = ["trim", "fix", "create", "update"] for code, reported_flag in codes: with subtests.test(code): s = source(code) print("source:", code) if not executing_used and reported_flag == "update": assert not s.flags else: assert list(s.flags) == [reported_flag] assert (reported_flag == "fix") == s.error for flag in all_flags: if flag == reported_flag: continue print("use flag:", flag) s2 = s.run(flag) assert s2.source == s.source if not executing_used: continue > s2 = s.run(reported_flag) tests/test_inline_snapshot.py:99: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:137: in run recorder.fix_all() /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all file.rewrite() /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite new_code = self.new_code() /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code format_whole_file = enforce_formatting() or code == format_code( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 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]' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_executing_0/test_34.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert 5 in snapshot({0: [4, 5]})[0] reported_flags: {'trim'} run: pytest --inline-snapshot= output: |assert 5 in snapshot({0: [4, 5]})[0] source: assert 5 in snapshot({0: [4, 5]})[0] use flag: fix input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert 5 in snapshot({0: [4, 5]})[0] reported_flags: {'trim'} run: pytest --inline-snapshot=fix output: |assert 5 in snapshot({0: [4, 5]})[0] use flag: create input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert 5 in snapshot({0: [4, 5]})[0] reported_flags: {'trim'} run: pytest --inline-snapshot=create output: |assert 5 in snapshot({0: [4, 5]})[0] use flag: update input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert 5 in snapshot({0: [4, 5]})[0] reported_flags: {'trim'} run: pytest --inline-snapshot=update output: |assert 5 in snapshot({0: [4, 5]})[0] input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert 5 in snapshot({0: [4, 5]})[0] ------------------------------ Captured log call ------------------------------- ______________ test_generic[executing] [assert 5 in snapshot([])] ______________ source = .w at 0x7f6a3f3f98a0> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) executing_used = True def test_generic(source, subtests, executing_used): codes = [] for op in operations: codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) if op.svalue: codes.append( ( f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", op.flag, ) ) else: codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) all_flags = ["trim", "fix", "create", "update"] for code, reported_flag in codes: with subtests.test(code): > s = source(code) tests/test_inline_snapshot.py:79: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:125: in run changes += snapshot._changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes yield from self._value._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:456: in _get_changes new_code=[self._file._value_to_code(v) for v in new_values], /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code return self._token_to_code(value_to_token(value)) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '5 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_executing_0/test_35.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert 5 in snapshot([]) ----------------------------- Captured stderr call ----------------------------- Traceback (most recent call last): File "/tmp/autopkgtest.ImMzGl/autopkgtest_tmp/tests/conftest.py", line 114, in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) File "/tmp/pytest-of-unshare/pytest-0/test_generic_executing_0/test_35.py", line 9, in assert 5 in snapshot([]) ^^^^^^^^^^^^^^^^^ AssertionError ------------------------------ Captured log call ------------------------------- __________ test_generic[executing] [assert 5 in snapshot({0: []})[0]] __________ source = .w at 0x7f6a3f3f98a0> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) executing_used = True def test_generic(source, subtests, executing_used): codes = [] for op in operations: codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) if op.svalue: codes.append( ( f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", op.flag, ) ) else: codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) all_flags = ["trim", "fix", "create", "update"] for code, reported_flag in codes: with subtests.test(code): > s = source(code) tests/test_inline_snapshot.py:79: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:125: in run changes += snapshot._changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes yield from self._value._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes yield from self._new_value[key]._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:456: in _get_changes new_code=[self._file._value_to_code(v) for v in new_values], /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code return self._token_to_code(value_to_token(value)) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '5 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_executing_0/test_36.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert 5 in snapshot({0: []})[0] ----------------------------- Captured stderr call ----------------------------- Traceback (most recent call last): File "/tmp/autopkgtest.ImMzGl/autopkgtest_tmp/tests/conftest.py", line 114, in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) File "/tmp/pytest-of-unshare/pytest-0/test_generic_executing_0/test_36.py", line 9, in assert 5 in snapshot({0: []})[0] ^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError ------------------------------ Captured log call ------------------------------- ____________ test_generic[executing] [assert 5 in snapshot([3+2])] _____________ source = .w at 0x7f6a3f3f98a0> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) executing_used = True def test_generic(source, subtests, executing_used): codes = [] for op in operations: codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) if op.svalue: codes.append( ( f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", op.flag, ) ) else: codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) all_flags = ["trim", "fix", "create", "update"] for code, reported_flag in codes: with subtests.test(code): > s = source(code) tests/test_inline_snapshot.py:79: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:125: in run changes += snapshot._changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes yield from self._value._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:438: in _get_changes new_code = self._file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '5 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_executing_0/test_37.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert 5 in snapshot([3+2]) ------------------------------ Captured log call ------------------------------- ________ test_generic[executing] [assert 5 in snapshot({0: [3+2]})[0]] _________ source = .w at 0x7f6a3f3f98a0> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) executing_used = True def test_generic(source, subtests, executing_used): codes = [] for op in operations: codes.append((f"assert {op.value} {op.op} snapshot({op.svalue})", op.flag)) if op.svalue: codes.append( ( f"assert {op.value} {op.op} snapshot({{0: {op.svalue}}})[0]", op.flag, ) ) else: codes.append((f"assert {op.value} {op.op} snapshot({{}})[0]", op.flag)) all_flags = ["trim", "fix", "create", "update"] for code, reported_flag in codes: with subtests.test(code): > s = source(code) tests/test_inline_snapshot.py:79: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:125: in run changes += snapshot._changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes yield from self._value._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes yield from self._new_value[key]._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:438: in _get_changes new_code = self._file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '5 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_executing_0/test_38.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert 5 in snapshot({0: [3+2]})[0] ------------------------------ Captured log call ------------------------------- _______________ test_generic_multi[executing-create(==) fix(==)] _______________ source = .w at 0x7f6a3ef48d60> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx=>, request=>) ops = (operation(value='4', op='==', svalue='', fvalue='4', flag='create'), operation(value='4', op='==', svalue='5', fvalue='4', flag='fix')) executing_used = True @pytest.mark.parametrize( "ops", [ pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) for ops in itertools.combinations(operations, 2) ], ) def test_generic_multi(source, subtests, ops, executing_used): def gen_code(ops, fixed, old_keys): keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] new_keys = [] args = [] print(keys) for k in keys: op = ops[k] value = op.fvalue if op.flag in fixed else op.svalue if value: args.append(f'"k_{k}": {value}') new_keys.append(k) args = ", ".join(args) code = "s = snapshot({" + args + "})\n" for k, op in enumerate(ops): code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' return code, new_keys all_flags = {op.flag for op in ops} keys = [] code, keys = gen_code(ops, {}, keys) > s = source(code) tests/test_inline_snapshot.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_c0/test_1.py:10: in print(4 == s["k_0"]) # create -> 4 /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_c0/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- [0, 1] input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |s = snapshot({"k_1": 5}) |print(4 == s["k_0"]) # create -> 4 |print(4 == s["k_1"]) # fix 5 -> 4 _____________ test_generic_multi[executing-create(==) update(==)] ______________ source = .w at 0x7f6a3ef493a0> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx=>, request=>) ops = (operation(value='4', op='==', svalue='', fvalue='4', flag='create'), operation(value='4', op='==', svalue='2+2', fvalue='4', flag='update')) executing_used = True @pytest.mark.parametrize( "ops", [ pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) for ops in itertools.combinations(operations, 2) ], ) def test_generic_multi(source, subtests, ops, executing_used): def gen_code(ops, fixed, old_keys): keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] new_keys = [] args = [] print(keys) for k in keys: op = ops[k] value = op.fvalue if op.flag in fixed else op.svalue if value: args.append(f'"k_{k}": {value}') new_keys.append(k) args = ", ".join(args) code = "s = snapshot({" + args + "})\n" for k, op in enumerate(ops): code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' return code, new_keys all_flags = {op.flag for op in ops} keys = [] code, keys = gen_code(ops, {}, keys) > s = source(code) tests/test_inline_snapshot.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_c1/test_1.py:10: in print(4 == s["k_0"]) # create -> 4 /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_c1/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- [0, 1] input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |s = snapshot({"k_1": 2+2}) |print(4 == s["k_0"]) # create -> 4 |print(4 == s["k_1"]) # update 2+2 -> 4 _____________ test_generic_multi[executing-create(==) create(<=)] ______________ source = .w at 0x7f6a3ef49e40> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx=>, request=>) ops = (operation(value='4', op='==', svalue='', fvalue='4', flag='create'), operation(value='4', op='<=', svalue='', fvalue='4', flag='create')) executing_used = True @pytest.mark.parametrize( "ops", [ pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) for ops in itertools.combinations(operations, 2) ], ) def test_generic_multi(source, subtests, ops, executing_used): def gen_code(ops, fixed, old_keys): keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] new_keys = [] args = [] print(keys) for k in keys: op = ops[k] value = op.fvalue if op.flag in fixed else op.svalue if value: args.append(f'"k_{k}": {value}') new_keys.append(k) args = ", ".join(args) code = "s = snapshot({" + args + "})\n" for k, op in enumerate(ops): code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' return code, new_keys all_flags = {op.flag for op in ops} keys = [] code, keys = gen_code(ops, {}, keys) > s = source(code) tests/test_inline_snapshot.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_c2/test_1.py:10: in print(4 == s["k_0"]) # create -> 4 /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_c2/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- [0, 1] input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |s = snapshot({}) |print(4 == s["k_0"]) # create -> 4 |print(4 <= s["k_1"]) # create -> 4 ______________ test_generic_multi[executing-create(==) trim(<=)] _______________ source = .w at 0x7f6a3ef4a5c0> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx=>, request=>) ops = (operation(value='4', op='==', svalue='', fvalue='4', flag='create'), operation(value='4', op='<=', svalue='5', fvalue='4', flag='trim')) executing_used = True @pytest.mark.parametrize( "ops", [ pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) for ops in itertools.combinations(operations, 2) ], ) def test_generic_multi(source, subtests, ops, executing_used): def gen_code(ops, fixed, old_keys): keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] new_keys = [] args = [] print(keys) for k in keys: op = ops[k] value = op.fvalue if op.flag in fixed else op.svalue if value: args.append(f'"k_{k}": {value}') new_keys.append(k) args = ", ".join(args) code = "s = snapshot({" + args + "})\n" for k, op in enumerate(ops): code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' return code, new_keys all_flags = {op.flag for op in ops} keys = [] code, keys = gen_code(ops, {}, keys) > s = source(code) tests/test_inline_snapshot.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_c3/test_1.py:10: in print(4 == s["k_0"]) # create -> 4 /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_c3/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- [0, 1] input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |s = snapshot({"k_1": 5}) |print(4 == s["k_0"]) # create -> 4 |print(4 <= s["k_1"]) # trim 5 -> 4 _______________ test_generic_multi[executing-create(==) fix(<=)] _______________ source = .w at 0x7f6a3ef48c20> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx=>, request=>) ops = (operation(value='4', op='==', svalue='', fvalue='4', flag='create'), operation(value='5', op='<=', svalue='4', fvalue='5', flag='fix')) executing_used = True @pytest.mark.parametrize( "ops", [ pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) for ops in itertools.combinations(operations, 2) ], ) def test_generic_multi(source, subtests, ops, executing_used): def gen_code(ops, fixed, old_keys): keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] new_keys = [] args = [] print(keys) for k in keys: op = ops[k] value = op.fvalue if op.flag in fixed else op.svalue if value: args.append(f'"k_{k}": {value}') new_keys.append(k) args = ", ".join(args) code = "s = snapshot({" + args + "})\n" for k, op in enumerate(ops): code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' return code, new_keys all_flags = {op.flag for op in ops} keys = [] code, keys = gen_code(ops, {}, keys) > s = source(code) tests/test_inline_snapshot.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_c4/test_1.py:10: in print(4 == s["k_0"]) # create -> 4 /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_c4/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- [0, 1] input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |s = snapshot({"k_1": 4}) |print(4 == s["k_0"]) # create -> 4 |print(5 <= s["k_1"]) # fix 4 -> 5 _____________ test_generic_multi[executing-create(==) update(<=)] ______________ source = .w at 0x7f6a3ef4ade0> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx=>, request=>) ops = (operation(value='4', op='==', svalue='', fvalue='4', flag='create'), operation(value='5', op='<=', svalue='3+2', fvalue='5', flag='update')) executing_used = True @pytest.mark.parametrize( "ops", [ pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) for ops in itertools.combinations(operations, 2) ], ) def test_generic_multi(source, subtests, ops, executing_used): def gen_code(ops, fixed, old_keys): keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] new_keys = [] args = [] print(keys) for k in keys: op = ops[k] value = op.fvalue if op.flag in fixed else op.svalue if value: args.append(f'"k_{k}": {value}') new_keys.append(k) args = ", ".join(args) code = "s = snapshot({" + args + "})\n" for k, op in enumerate(ops): code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' return code, new_keys all_flags = {op.flag for op in ops} keys = [] code, keys = gen_code(ops, {}, keys) > s = source(code) tests/test_inline_snapshot.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_c5/test_1.py:10: in print(4 == s["k_0"]) # create -> 4 /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_c5/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- [0, 1] input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |s = snapshot({"k_1": 3+2}) |print(4 == s["k_0"]) # create -> 4 |print(5 <= s["k_1"]) # update 3+2 -> 5 _____________ test_generic_multi[executing-create(==) create(>=)] ______________ source = .w at 0x7f6a3ef48f40> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx=>, request==)]>>) ops = (operation(value='4', op='==', svalue='', fvalue='4', flag='create'), operation(value='5', op='>=', svalue='', fvalue='5', flag='create')) executing_used = True @pytest.mark.parametrize( "ops", [ pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) for ops in itertools.combinations(operations, 2) ], ) def test_generic_multi(source, subtests, ops, executing_used): def gen_code(ops, fixed, old_keys): keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] new_keys = [] args = [] print(keys) for k in keys: op = ops[k] value = op.fvalue if op.flag in fixed else op.svalue if value: args.append(f'"k_{k}": {value}') new_keys.append(k) args = ", ".join(args) code = "s = snapshot({" + args + "})\n" for k, op in enumerate(ops): code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' return code, new_keys all_flags = {op.flag for op in ops} keys = [] code, keys = gen_code(ops, {}, keys) > s = source(code) tests/test_inline_snapshot.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_c6/test_1.py:10: in print(4 == s["k_0"]) # create -> 4 /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_c6/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- [0, 1] input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |s = snapshot({}) |print(4 == s["k_0"]) # create -> 4 |print(5 >= s["k_1"]) # create -> 5 ______________ test_generic_multi[executing-create(==) trim(>=)] _______________ source = .w at 0x7f6a3ef49940> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx=>, request==)]>>) ops = (operation(value='4', op='==', svalue='', fvalue='4', flag='create'), operation(value='5', op='>=', svalue='4', fvalue='5', flag='trim')) executing_used = True @pytest.mark.parametrize( "ops", [ pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) for ops in itertools.combinations(operations, 2) ], ) def test_generic_multi(source, subtests, ops, executing_used): def gen_code(ops, fixed, old_keys): keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] new_keys = [] args = [] print(keys) for k in keys: op = ops[k] value = op.fvalue if op.flag in fixed else op.svalue if value: args.append(f'"k_{k}": {value}') new_keys.append(k) args = ", ".join(args) code = "s = snapshot({" + args + "})\n" for k, op in enumerate(ops): code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' return code, new_keys all_flags = {op.flag for op in ops} keys = [] code, keys = gen_code(ops, {}, keys) > s = source(code) tests/test_inline_snapshot.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_c7/test_1.py:10: in print(4 == s["k_0"]) # create -> 4 /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_c7/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- [0, 1] input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |s = snapshot({"k_1": 4}) |print(4 == s["k_0"]) # create -> 4 |print(5 >= s["k_1"]) # trim 4 -> 5 _______________ test_generic_multi[executing-create(==) fix(>=)] _______________ source = .w at 0x7f6a3ef4bec0> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx=>, request==)]>>) ops = (operation(value='4', op='==', svalue='', fvalue='4', flag='create'), operation(value='4', op='>=', svalue='5', fvalue='4', flag='fix')) executing_used = True @pytest.mark.parametrize( "ops", [ pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) for ops in itertools.combinations(operations, 2) ], ) def test_generic_multi(source, subtests, ops, executing_used): def gen_code(ops, fixed, old_keys): keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] new_keys = [] args = [] print(keys) for k in keys: op = ops[k] value = op.fvalue if op.flag in fixed else op.svalue if value: args.append(f'"k_{k}": {value}') new_keys.append(k) args = ", ".join(args) code = "s = snapshot({" + args + "})\n" for k, op in enumerate(ops): code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' return code, new_keys all_flags = {op.flag for op in ops} keys = [] code, keys = gen_code(ops, {}, keys) > s = source(code) tests/test_inline_snapshot.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_c8/test_1.py:10: in print(4 == s["k_0"]) # create -> 4 /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_c8/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- [0, 1] input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |s = snapshot({"k_1": 5}) |print(4 == s["k_0"]) # create -> 4 |print(4 >= s["k_1"]) # fix 5 -> 4 _____________ test_generic_multi[executing-create(==) update(>=)] ______________ source = .w at 0x7f6a3f91ef20> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx=>, request==)]>>) ops = (operation(value='4', op='==', svalue='', fvalue='4', flag='create'), operation(value='5', op='>=', svalue='3+2', fvalue='5', flag='update')) executing_used = True @pytest.mark.parametrize( "ops", [ pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) for ops in itertools.combinations(operations, 2) ], ) def test_generic_multi(source, subtests, ops, executing_used): def gen_code(ops, fixed, old_keys): keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] new_keys = [] args = [] print(keys) for k in keys: op = ops[k] value = op.fvalue if op.flag in fixed else op.svalue if value: args.append(f'"k_{k}": {value}') new_keys.append(k) args = ", ".join(args) code = "s = snapshot({" + args + "})\n" for k, op in enumerate(ops): code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' return code, new_keys all_flags = {op.flag for op in ops} keys = [] code, keys = gen_code(ops, {}, keys) > s = source(code) tests/test_inline_snapshot.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_c9/test_1.py:10: in print(4 == s["k_0"]) # create -> 4 /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_c9/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- [0, 1] input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |s = snapshot({"k_1": 3+2}) |print(4 == s["k_0"]) # create -> 4 |print(5 >= s["k_1"]) # update 3+2 -> 5 _____________ test_generic_multi[executing-create(==) create(in)] ______________ source = .w at 0x7f6a3ef4b060> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx=>, request=>) ops = (operation(value='4', op='==', svalue='', fvalue='4', flag='create'), operation(value='5', op='in', svalue='', fvalue='[5]', flag='create')) executing_used = True @pytest.mark.parametrize( "ops", [ pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) for ops in itertools.combinations(operations, 2) ], ) def test_generic_multi(source, subtests, ops, executing_used): def gen_code(ops, fixed, old_keys): keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] new_keys = [] args = [] print(keys) for k in keys: op = ops[k] value = op.fvalue if op.flag in fixed else op.svalue if value: args.append(f'"k_{k}": {value}') new_keys.append(k) args = ", ".join(args) code = "s = snapshot({" + args + "})\n" for k, op in enumerate(ops): code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' return code, new_keys all_flags = {op.flag for op in ops} keys = [] code, keys = gen_code(ops, {}, keys) > s = source(code) tests/test_inline_snapshot.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_c10/test_1.py:10: in print(4 == s["k_0"]) # create -> 4 /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_c10/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- [0, 1] input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |s = snapshot({}) |print(4 == s["k_0"]) # create -> 4 |print(5 in s["k_1"]) # create -> [5] ______________ test_generic_multi[executing-create(==) trim(in)] _______________ source = .w at 0x7f6a3ef49da0> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx=>, request=>) ops = (operation(value='4', op='==', svalue='', fvalue='4', flag='create'), operation(value='5', op='in', svalue='[4, 5]', fvalue='[5]', flag='trim')) executing_used = True @pytest.mark.parametrize( "ops", [ pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) for ops in itertools.combinations(operations, 2) ], ) def test_generic_multi(source, subtests, ops, executing_used): def gen_code(ops, fixed, old_keys): keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] new_keys = [] args = [] print(keys) for k in keys: op = ops[k] value = op.fvalue if op.flag in fixed else op.svalue if value: args.append(f'"k_{k}": {value}') new_keys.append(k) args = ", ".join(args) code = "s = snapshot({" + args + "})\n" for k, op in enumerate(ops): code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' return code, new_keys all_flags = {op.flag for op in ops} keys = [] code, keys = gen_code(ops, {}, keys) > s = source(code) tests/test_inline_snapshot.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_c11/test_1.py:10: in print(4 == s["k_0"]) # create -> 4 /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_c11/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- [0, 1] input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |s = snapshot({"k_1": [4, 5]}) |print(4 == s["k_0"]) # create -> 4 |print(5 in s["k_1"]) # trim [4, 5] -> [5] _______________ test_generic_multi[executing-create(==) fix(in)] _______________ source = .w at 0x7f6a3f91ef20> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx=>, request=>) ops = (operation(value='4', op='==', svalue='', fvalue='4', flag='create'), operation(value='5', op='in', svalue='[]', fvalue='[5]', flag='fix')) executing_used = True @pytest.mark.parametrize( "ops", [ pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) for ops in itertools.combinations(operations, 2) ], ) def test_generic_multi(source, subtests, ops, executing_used): def gen_code(ops, fixed, old_keys): keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] new_keys = [] args = [] print(keys) for k in keys: op = ops[k] value = op.fvalue if op.flag in fixed else op.svalue if value: args.append(f'"k_{k}": {value}') new_keys.append(k) args = ", ".join(args) code = "s = snapshot({" + args + "})\n" for k, op in enumerate(ops): code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' return code, new_keys all_flags = {op.flag for op in ops} keys = [] code, keys = gen_code(ops, {}, keys) > s = source(code) tests/test_inline_snapshot.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_c12/test_1.py:10: in print(4 == s["k_0"]) # create -> 4 /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_c12/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- [0, 1] input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |s = snapshot({"k_1": []}) |print(4 == s["k_0"]) # create -> 4 |print(5 in s["k_1"]) # fix [] -> [5] _____________ test_generic_multi[executing-create(==) update(in)] ______________ source = .w at 0x7f6a3ef4b060> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx=>, request=>) ops = (operation(value='4', op='==', svalue='', fvalue='4', flag='create'), operation(value='5', op='in', svalue='[3+2]', fvalue='[5]', flag='update')) executing_used = True @pytest.mark.parametrize( "ops", [ pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) for ops in itertools.combinations(operations, 2) ], ) def test_generic_multi(source, subtests, ops, executing_used): def gen_code(ops, fixed, old_keys): keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] new_keys = [] args = [] print(keys) for k in keys: op = ops[k] value = op.fvalue if op.flag in fixed else op.svalue if value: args.append(f'"k_{k}": {value}') new_keys.append(k) args = ", ".join(args) code = "s = snapshot({" + args + "})\n" for k, op in enumerate(ops): code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' return code, new_keys all_flags = {op.flag for op in ops} keys = [] code, keys = gen_code(ops, {}, keys) > s = source(code) tests/test_inline_snapshot.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_c13/test_1.py:10: in print(4 == s["k_0"]) # create -> 4 /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_c13/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- [0, 1] input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |s = snapshot({"k_1": [3+2]}) |print(4 == s["k_0"]) # create -> 4 |print(5 in s["k_1"]) # update [3+2] -> [5] _______________ test_generic_multi[executing-fix(==) update(==)] _______________ source = .w at 0x7f6a3ef48f40> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx=>, request=>) ops = (operation(value='4', op='==', svalue='5', fvalue='4', flag='fix'), operation(value='4', op='==', svalue='2+2', fvalue='4', flag='update')) executing_used = True @pytest.mark.parametrize( "ops", [ pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) for ops in itertools.combinations(operations, 2) ], ) def test_generic_multi(source, subtests, ops, executing_used): def gen_code(ops, fixed, old_keys): keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] new_keys = [] args = [] print(keys) for k in keys: op = ops[k] value = op.fvalue if op.flag in fixed else op.svalue if value: args.append(f'"k_{k}": {value}') new_keys.append(k) args = ", ".join(args) code = "s = snapshot({" + args + "})\n" for k, op in enumerate(ops): code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' return code, new_keys all_flags = {op.flag for op in ops} keys = [] code, keys = gen_code(ops, {}, keys) > s = source(code) tests/test_inline_snapshot.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_f0/test_1.py:10: in print(4 == s["k_0"]) # fix 5 -> 4 /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_f0/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- [0, 1] input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |s = snapshot({"k_0": 5, "k_1": 2+2}) |print(4 == s["k_0"]) # fix 5 -> 4 |print(4 == s["k_1"]) # update 2+2 -> 4 _______________ test_generic_multi[executing-fix(==) create(<=)] _______________ source = .w at 0x7f6a3ef4ade0> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx=>, request=>) ops = (operation(value='4', op='==', svalue='5', fvalue='4', flag='fix'), operation(value='4', op='<=', svalue='', fvalue='4', flag='create')) executing_used = True @pytest.mark.parametrize( "ops", [ pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) for ops in itertools.combinations(operations, 2) ], ) def test_generic_multi(source, subtests, ops, executing_used): def gen_code(ops, fixed, old_keys): keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] new_keys = [] args = [] print(keys) for k in keys: op = ops[k] value = op.fvalue if op.flag in fixed else op.svalue if value: args.append(f'"k_{k}": {value}') new_keys.append(k) args = ", ".join(args) code = "s = snapshot({" + args + "})\n" for k, op in enumerate(ops): code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' return code, new_keys all_flags = {op.flag for op in ops} keys = [] code, keys = gen_code(ops, {}, keys) > s = source(code) tests/test_inline_snapshot.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_f1/test_1.py:10: in print(4 == s["k_0"]) # fix 5 -> 4 /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_f1/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- [0, 1] input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |s = snapshot({"k_0": 5}) |print(4 == s["k_0"]) # fix 5 -> 4 |print(4 <= s["k_1"]) # create -> 4 ________________ test_generic_multi[executing-fix(==) trim(<=)] ________________ source = .w at 0x7f6a3f3f94e0> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx=>, request=>) ops = (operation(value='4', op='==', svalue='5', fvalue='4', flag='fix'), operation(value='4', op='<=', svalue='5', fvalue='4', flag='trim')) executing_used = True @pytest.mark.parametrize( "ops", [ pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) for ops in itertools.combinations(operations, 2) ], ) def test_generic_multi(source, subtests, ops, executing_used): def gen_code(ops, fixed, old_keys): keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] new_keys = [] args = [] print(keys) for k in keys: op = ops[k] value = op.fvalue if op.flag in fixed else op.svalue if value: args.append(f'"k_{k}": {value}') new_keys.append(k) args = ", ".join(args) code = "s = snapshot({" + args + "})\n" for k, op in enumerate(ops): code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' return code, new_keys all_flags = {op.flag for op in ops} keys = [] code, keys = gen_code(ops, {}, keys) > s = source(code) tests/test_inline_snapshot.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_f2/test_1.py:10: in print(4 == s["k_0"]) # fix 5 -> 4 /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_f2/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- [0, 1] input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |s = snapshot({"k_0": 5, "k_1": 5}) |print(4 == s["k_0"]) # fix 5 -> 4 |print(4 <= s["k_1"]) # trim 5 -> 4 ________________ test_generic_multi[executing-fix(==) fix(<=)] _________________ source = .w at 0x7f6a3ee8d440> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx=>, request=>) ops = (operation(value='4', op='==', svalue='5', fvalue='4', flag='fix'), operation(value='5', op='<=', svalue='4', fvalue='5', flag='fix')) executing_used = True @pytest.mark.parametrize( "ops", [ pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) for ops in itertools.combinations(operations, 2) ], ) def test_generic_multi(source, subtests, ops, executing_used): def gen_code(ops, fixed, old_keys): keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] new_keys = [] args = [] print(keys) for k in keys: op = ops[k] value = op.fvalue if op.flag in fixed else op.svalue if value: args.append(f'"k_{k}": {value}') new_keys.append(k) args = ", ".join(args) code = "s = snapshot({" + args + "})\n" for k, op in enumerate(ops): code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' return code, new_keys all_flags = {op.flag for op in ops} keys = [] code, keys = gen_code(ops, {}, keys) > s = source(code) tests/test_inline_snapshot.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_f3/test_1.py:10: in print(4 == s["k_0"]) # fix 5 -> 4 /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_f3/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- [0, 1] input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |s = snapshot({"k_0": 5, "k_1": 4}) |print(4 == s["k_0"]) # fix 5 -> 4 |print(5 <= s["k_1"]) # fix 4 -> 5 _______________ test_generic_multi[executing-fix(==) update(<=)] _______________ source = .w at 0x7f6a3f3f94e0> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx=>, request=>) ops = (operation(value='4', op='==', svalue='5', fvalue='4', flag='fix'), operation(value='5', op='<=', svalue='3+2', fvalue='5', flag='update')) executing_used = True @pytest.mark.parametrize( "ops", [ pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) for ops in itertools.combinations(operations, 2) ], ) def test_generic_multi(source, subtests, ops, executing_used): def gen_code(ops, fixed, old_keys): keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] new_keys = [] args = [] print(keys) for k in keys: op = ops[k] value = op.fvalue if op.flag in fixed else op.svalue if value: args.append(f'"k_{k}": {value}') new_keys.append(k) args = ", ".join(args) code = "s = snapshot({" + args + "})\n" for k, op in enumerate(ops): code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' return code, new_keys all_flags = {op.flag for op in ops} keys = [] code, keys = gen_code(ops, {}, keys) > s = source(code) tests/test_inline_snapshot.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_f4/test_1.py:10: in print(4 == s["k_0"]) # fix 5 -> 4 /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_f4/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- [0, 1] input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |s = snapshot({"k_0": 5, "k_1": 3+2}) |print(4 == s["k_0"]) # fix 5 -> 4 |print(5 <= s["k_1"]) # update 3+2 -> 5 _______________ test_generic_multi[executing-fix(==) create(>=)] _______________ source = .w at 0x7f6a3ee8cea0> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx=>, request==)]>>) ops = (operation(value='4', op='==', svalue='5', fvalue='4', flag='fix'), operation(value='5', op='>=', svalue='', fvalue='5', flag='create')) executing_used = True @pytest.mark.parametrize( "ops", [ pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) for ops in itertools.combinations(operations, 2) ], ) def test_generic_multi(source, subtests, ops, executing_used): def gen_code(ops, fixed, old_keys): keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] new_keys = [] args = [] print(keys) for k in keys: op = ops[k] value = op.fvalue if op.flag in fixed else op.svalue if value: args.append(f'"k_{k}": {value}') new_keys.append(k) args = ", ".join(args) code = "s = snapshot({" + args + "})\n" for k, op in enumerate(ops): code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' return code, new_keys all_flags = {op.flag for op in ops} keys = [] code, keys = gen_code(ops, {}, keys) > s = source(code) tests/test_inline_snapshot.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_f5/test_1.py:10: in print(4 == s["k_0"]) # fix 5 -> 4 /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_f5/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- [0, 1] input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |s = snapshot({"k_0": 5}) |print(4 == s["k_0"]) # fix 5 -> 4 |print(5 >= s["k_1"]) # create -> 5 ________________ test_generic_multi[executing-fix(==) trim(>=)] ________________ source = .w at 0x7f6a3ee8e480> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx=>, request==)]>>) ops = (operation(value='4', op='==', svalue='5', fvalue='4', flag='fix'), operation(value='5', op='>=', svalue='4', fvalue='5', flag='trim')) executing_used = True @pytest.mark.parametrize( "ops", [ pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) for ops in itertools.combinations(operations, 2) ], ) def test_generic_multi(source, subtests, ops, executing_used): def gen_code(ops, fixed, old_keys): keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] new_keys = [] args = [] print(keys) for k in keys: op = ops[k] value = op.fvalue if op.flag in fixed else op.svalue if value: args.append(f'"k_{k}": {value}') new_keys.append(k) args = ", ".join(args) code = "s = snapshot({" + args + "})\n" for k, op in enumerate(ops): code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' return code, new_keys all_flags = {op.flag for op in ops} keys = [] code, keys = gen_code(ops, {}, keys) > s = source(code) tests/test_inline_snapshot.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_f6/test_1.py:10: in print(4 == s["k_0"]) # fix 5 -> 4 /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_f6/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- [0, 1] input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |s = snapshot({"k_0": 5, "k_1": 4}) |print(4 == s["k_0"]) # fix 5 -> 4 |print(5 >= s["k_1"]) # trim 4 -> 5 ________________ test_generic_multi[executing-fix(==) fix(>=)] _________________ source = .w at 0x7f6a3ef48fe0> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx=>, request==)]>>) ops = (operation(value='4', op='==', svalue='5', fvalue='4', flag='fix'), operation(value='4', op='>=', svalue='5', fvalue='4', flag='fix')) executing_used = True @pytest.mark.parametrize( "ops", [ pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) for ops in itertools.combinations(operations, 2) ], ) def test_generic_multi(source, subtests, ops, executing_used): def gen_code(ops, fixed, old_keys): keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] new_keys = [] args = [] print(keys) for k in keys: op = ops[k] value = op.fvalue if op.flag in fixed else op.svalue if value: args.append(f'"k_{k}": {value}') new_keys.append(k) args = ", ".join(args) code = "s = snapshot({" + args + "})\n" for k, op in enumerate(ops): code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' return code, new_keys all_flags = {op.flag for op in ops} keys = [] code, keys = gen_code(ops, {}, keys) > s = source(code) tests/test_inline_snapshot.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_f7/test_1.py:10: in print(4 == s["k_0"]) # fix 5 -> 4 /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_f7/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- [0, 1] input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |s = snapshot({"k_0": 5, "k_1": 5}) |print(4 == s["k_0"]) # fix 5 -> 4 |print(4 >= s["k_1"]) # fix 5 -> 4 _______________ test_generic_multi[executing-fix(==) update(>=)] _______________ source = .w at 0x7f6a3ee8de40> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx=>, request==)]>>) ops = (operation(value='4', op='==', svalue='5', fvalue='4', flag='fix'), operation(value='5', op='>=', svalue='3+2', fvalue='5', flag='update')) executing_used = True @pytest.mark.parametrize( "ops", [ pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) for ops in itertools.combinations(operations, 2) ], ) def test_generic_multi(source, subtests, ops, executing_used): def gen_code(ops, fixed, old_keys): keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] new_keys = [] args = [] print(keys) for k in keys: op = ops[k] value = op.fvalue if op.flag in fixed else op.svalue if value: args.append(f'"k_{k}": {value}') new_keys.append(k) args = ", ".join(args) code = "s = snapshot({" + args + "})\n" for k, op in enumerate(ops): code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' return code, new_keys all_flags = {op.flag for op in ops} keys = [] code, keys = gen_code(ops, {}, keys) > s = source(code) tests/test_inline_snapshot.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_f8/test_1.py:10: in print(4 == s["k_0"]) # fix 5 -> 4 /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_f8/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- [0, 1] input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |s = snapshot({"k_0": 5, "k_1": 3+2}) |print(4 == s["k_0"]) # fix 5 -> 4 |print(5 >= s["k_1"]) # update 3+2 -> 5 _______________ test_generic_multi[executing-fix(==) create(in)] _______________ source = .w at 0x7f6a3ee8f4c0> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx=>, request=>) ops = (operation(value='4', op='==', svalue='5', fvalue='4', flag='fix'), operation(value='5', op='in', svalue='', fvalue='[5]', flag='create')) executing_used = True @pytest.mark.parametrize( "ops", [ pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) for ops in itertools.combinations(operations, 2) ], ) def test_generic_multi(source, subtests, ops, executing_used): def gen_code(ops, fixed, old_keys): keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] new_keys = [] args = [] print(keys) for k in keys: op = ops[k] value = op.fvalue if op.flag in fixed else op.svalue if value: args.append(f'"k_{k}": {value}') new_keys.append(k) args = ", ".join(args) code = "s = snapshot({" + args + "})\n" for k, op in enumerate(ops): code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' return code, new_keys all_flags = {op.flag for op in ops} keys = [] code, keys = gen_code(ops, {}, keys) > s = source(code) tests/test_inline_snapshot.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_f9/test_1.py:10: in print(4 == s["k_0"]) # fix 5 -> 4 /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_f9/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- [0, 1] input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |s = snapshot({"k_0": 5}) |print(4 == s["k_0"]) # fix 5 -> 4 |print(5 in s["k_1"]) # create -> [5] ________________ test_generic_multi[executing-fix(==) trim(in)] ________________ source = .w at 0x7f6a3ef4ad40> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx=>, request=>) ops = (operation(value='4', op='==', svalue='5', fvalue='4', flag='fix'), operation(value='5', op='in', svalue='[4, 5]', fvalue='[5]', flag='trim')) executing_used = True @pytest.mark.parametrize( "ops", [ pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) for ops in itertools.combinations(operations, 2) ], ) def test_generic_multi(source, subtests, ops, executing_used): def gen_code(ops, fixed, old_keys): keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] new_keys = [] args = [] print(keys) for k in keys: op = ops[k] value = op.fvalue if op.flag in fixed else op.svalue if value: args.append(f'"k_{k}": {value}') new_keys.append(k) args = ", ".join(args) code = "s = snapshot({" + args + "})\n" for k, op in enumerate(ops): code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' return code, new_keys all_flags = {op.flag for op in ops} keys = [] code, keys = gen_code(ops, {}, keys) > s = source(code) tests/test_inline_snapshot.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_f10/test_1.py:10: in print(4 == s["k_0"]) # fix 5 -> 4 /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_f10/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- [0, 1] input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |s = snapshot({"k_0": 5, "k_1": [4, 5]}) |print(4 == s["k_0"]) # fix 5 -> 4 |print(5 in s["k_1"]) # trim [4, 5] -> [5] ________________ test_generic_multi[executing-fix(==) fix(in)] _________________ source = .w at 0x7f6a3ee8f060> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx=>, request=>) ops = (operation(value='4', op='==', svalue='5', fvalue='4', flag='fix'), operation(value='5', op='in', svalue='[]', fvalue='[5]', flag='fix')) executing_used = True @pytest.mark.parametrize( "ops", [ pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) for ops in itertools.combinations(operations, 2) ], ) def test_generic_multi(source, subtests, ops, executing_used): def gen_code(ops, fixed, old_keys): keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] new_keys = [] args = [] print(keys) for k in keys: op = ops[k] value = op.fvalue if op.flag in fixed else op.svalue if value: args.append(f'"k_{k}": {value}') new_keys.append(k) args = ", ".join(args) code = "s = snapshot({" + args + "})\n" for k, op in enumerate(ops): code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' return code, new_keys all_flags = {op.flag for op in ops} keys = [] code, keys = gen_code(ops, {}, keys) > s = source(code) tests/test_inline_snapshot.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_f11/test_1.py:10: in print(4 == s["k_0"]) # fix 5 -> 4 /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_f11/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- [0, 1] input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |s = snapshot({"k_0": 5, "k_1": []}) |print(4 == s["k_0"]) # fix 5 -> 4 |print(5 in s["k_1"]) # fix [] -> [5] _______________ test_generic_multi[executing-fix(==) update(in)] _______________ source = .w at 0x7f6a3edc8680> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx=>, request=>) ops = (operation(value='4', op='==', svalue='5', fvalue='4', flag='fix'), operation(value='5', op='in', svalue='[3+2]', fvalue='[5]', flag='update')) executing_used = True @pytest.mark.parametrize( "ops", [ pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) for ops in itertools.combinations(operations, 2) ], ) def test_generic_multi(source, subtests, ops, executing_used): def gen_code(ops, fixed, old_keys): keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] new_keys = [] args = [] print(keys) for k in keys: op = ops[k] value = op.fvalue if op.flag in fixed else op.svalue if value: args.append(f'"k_{k}": {value}') new_keys.append(k) args = ", ".join(args) code = "s = snapshot({" + args + "})\n" for k, op in enumerate(ops): code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' return code, new_keys all_flags = {op.flag for op in ops} keys = [] code, keys = gen_code(ops, {}, keys) > s = source(code) tests/test_inline_snapshot.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_f12/test_1.py:10: in print(4 == s["k_0"]) # fix 5 -> 4 /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_f12/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- [0, 1] input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |s = snapshot({"k_0": 5, "k_1": [3+2]}) |print(4 == s["k_0"]) # fix 5 -> 4 |print(5 in s["k_1"]) # update [3+2] -> [5] _____________ test_generic_multi[executing-update(==) create(<=)] ______________ source = .w at 0x7f6a3ef4bba0> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx=>, request=>) ops = (operation(value='4', op='==', svalue='2+2', fvalue='4', flag='update'), operation(value='4', op='<=', svalue='', fvalue='4', flag='create')) executing_used = True @pytest.mark.parametrize( "ops", [ pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) for ops in itertools.combinations(operations, 2) ], ) def test_generic_multi(source, subtests, ops, executing_used): def gen_code(ops, fixed, old_keys): keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] new_keys = [] args = [] print(keys) for k in keys: op = ops[k] value = op.fvalue if op.flag in fixed else op.svalue if value: args.append(f'"k_{k}": {value}') new_keys.append(k) args = ", ".join(args) code = "s = snapshot({" + args + "})\n" for k, op in enumerate(ops): code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' return code, new_keys all_flags = {op.flag for op in ops} keys = [] code, keys = gen_code(ops, {}, keys) > s = source(code) tests/test_inline_snapshot.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_u0/test_1.py:10: in print(4 == s["k_0"]) # update 2+2 -> 4 /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_u0/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- [0, 1] input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |s = snapshot({"k_0": 2+2}) |print(4 == s["k_0"]) # update 2+2 -> 4 |print(4 <= s["k_1"]) # create -> 4 ______________ test_generic_multi[executing-update(==) trim(<=)] _______________ source = .w at 0x7f6a3edc8fe0> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx=>, request=>) ops = (operation(value='4', op='==', svalue='2+2', fvalue='4', flag='update'), operation(value='4', op='<=', svalue='5', fvalue='4', flag='trim')) executing_used = True @pytest.mark.parametrize( "ops", [ pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) for ops in itertools.combinations(operations, 2) ], ) def test_generic_multi(source, subtests, ops, executing_used): def gen_code(ops, fixed, old_keys): keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] new_keys = [] args = [] print(keys) for k in keys: op = ops[k] value = op.fvalue if op.flag in fixed else op.svalue if value: args.append(f'"k_{k}": {value}') new_keys.append(k) args = ", ".join(args) code = "s = snapshot({" + args + "})\n" for k, op in enumerate(ops): code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' return code, new_keys all_flags = {op.flag for op in ops} keys = [] code, keys = gen_code(ops, {}, keys) > s = source(code) tests/test_inline_snapshot.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_u1/test_1.py:10: in print(4 == s["k_0"]) # update 2+2 -> 4 /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_u1/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- [0, 1] input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |s = snapshot({"k_0": 2+2, "k_1": 5}) |print(4 == s["k_0"]) # update 2+2 -> 4 |print(4 <= s["k_1"]) # trim 5 -> 4 _______________ test_generic_multi[executing-update(==) fix(<=)] _______________ source = .w at 0x7f6a3edc9760> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx=>, request=>) ops = (operation(value='4', op='==', svalue='2+2', fvalue='4', flag='update'), operation(value='5', op='<=', svalue='4', fvalue='5', flag='fix')) executing_used = True @pytest.mark.parametrize( "ops", [ pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) for ops in itertools.combinations(operations, 2) ], ) def test_generic_multi(source, subtests, ops, executing_used): def gen_code(ops, fixed, old_keys): keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] new_keys = [] args = [] print(keys) for k in keys: op = ops[k] value = op.fvalue if op.flag in fixed else op.svalue if value: args.append(f'"k_{k}": {value}') new_keys.append(k) args = ", ".join(args) code = "s = snapshot({" + args + "})\n" for k, op in enumerate(ops): code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' return code, new_keys all_flags = {op.flag for op in ops} keys = [] code, keys = gen_code(ops, {}, keys) > s = source(code) tests/test_inline_snapshot.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_u2/test_1.py:10: in print(4 == s["k_0"]) # update 2+2 -> 4 /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_u2/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- [0, 1] input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |s = snapshot({"k_0": 2+2, "k_1": 4}) |print(4 == s["k_0"]) # update 2+2 -> 4 |print(5 <= s["k_1"]) # fix 4 -> 5 _____________ test_generic_multi[executing-update(==) update(<=)] ______________ source = .w at 0x7f6a3ee8fe20> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx=>, request=>) ops = (operation(value='4', op='==', svalue='2+2', fvalue='4', flag='update'), operation(value='5', op='<=', svalue='3+2', fvalue='5', flag='update')) executing_used = True @pytest.mark.parametrize( "ops", [ pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) for ops in itertools.combinations(operations, 2) ], ) def test_generic_multi(source, subtests, ops, executing_used): def gen_code(ops, fixed, old_keys): keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] new_keys = [] args = [] print(keys) for k in keys: op = ops[k] value = op.fvalue if op.flag in fixed else op.svalue if value: args.append(f'"k_{k}": {value}') new_keys.append(k) args = ", ".join(args) code = "s = snapshot({" + args + "})\n" for k, op in enumerate(ops): code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' return code, new_keys all_flags = {op.flag for op in ops} keys = [] code, keys = gen_code(ops, {}, keys) > s = source(code) tests/test_inline_snapshot.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_u3/test_1.py:10: in print(4 == s["k_0"]) # update 2+2 -> 4 /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_u3/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- [0, 1] input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |s = snapshot({"k_0": 2+2, "k_1": 3+2}) |print(4 == s["k_0"]) # update 2+2 -> 4 |print(5 <= s["k_1"]) # update 3+2 -> 5 _____________ test_generic_multi[executing-update(==) create(>=)] ______________ source = .w at 0x7f6a3edc8fe0> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx=>, request==)]>>) ops = (operation(value='4', op='==', svalue='2+2', fvalue='4', flag='update'), operation(value='5', op='>=', svalue='', fvalue='5', flag='create')) executing_used = True @pytest.mark.parametrize( "ops", [ pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) for ops in itertools.combinations(operations, 2) ], ) def test_generic_multi(source, subtests, ops, executing_used): def gen_code(ops, fixed, old_keys): keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] new_keys = [] args = [] print(keys) for k in keys: op = ops[k] value = op.fvalue if op.flag in fixed else op.svalue if value: args.append(f'"k_{k}": {value}') new_keys.append(k) args = ", ".join(args) code = "s = snapshot({" + args + "})\n" for k, op in enumerate(ops): code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' return code, new_keys all_flags = {op.flag for op in ops} keys = [] code, keys = gen_code(ops, {}, keys) > s = source(code) tests/test_inline_snapshot.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_u4/test_1.py:10: in print(4 == s["k_0"]) # update 2+2 -> 4 /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_u4/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- [0, 1] input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |s = snapshot({"k_0": 2+2}) |print(4 == s["k_0"]) # update 2+2 -> 4 |print(5 >= s["k_1"]) # create -> 5 ______________ test_generic_multi[executing-update(==) trim(>=)] _______________ source = .w at 0x7f6a3edca840> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx=>, request==)]>>) ops = (operation(value='4', op='==', svalue='2+2', fvalue='4', flag='update'), operation(value='5', op='>=', svalue='4', fvalue='5', flag='trim')) executing_used = True @pytest.mark.parametrize( "ops", [ pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) for ops in itertools.combinations(operations, 2) ], ) def test_generic_multi(source, subtests, ops, executing_used): def gen_code(ops, fixed, old_keys): keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] new_keys = [] args = [] print(keys) for k in keys: op = ops[k] value = op.fvalue if op.flag in fixed else op.svalue if value: args.append(f'"k_{k}": {value}') new_keys.append(k) args = ", ".join(args) code = "s = snapshot({" + args + "})\n" for k, op in enumerate(ops): code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' return code, new_keys all_flags = {op.flag for op in ops} keys = [] code, keys = gen_code(ops, {}, keys) > s = source(code) tests/test_inline_snapshot.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_u5/test_1.py:10: in print(4 == s["k_0"]) # update 2+2 -> 4 /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_u5/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- [0, 1] input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |s = snapshot({"k_0": 2+2, "k_1": 4}) |print(4 == s["k_0"]) # update 2+2 -> 4 |print(5 >= s["k_1"]) # trim 4 -> 5 _______________ test_generic_multi[executing-update(==) fix(>=)] _______________ source = .w at 0x7f6a3ee8fce0> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx=>, request==)]>>) ops = (operation(value='4', op='==', svalue='2+2', fvalue='4', flag='update'), operation(value='4', op='>=', svalue='5', fvalue='4', flag='fix')) executing_used = True @pytest.mark.parametrize( "ops", [ pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) for ops in itertools.combinations(operations, 2) ], ) def test_generic_multi(source, subtests, ops, executing_used): def gen_code(ops, fixed, old_keys): keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] new_keys = [] args = [] print(keys) for k in keys: op = ops[k] value = op.fvalue if op.flag in fixed else op.svalue if value: args.append(f'"k_{k}": {value}') new_keys.append(k) args = ", ".join(args) code = "s = snapshot({" + args + "})\n" for k, op in enumerate(ops): code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' return code, new_keys all_flags = {op.flag for op in ops} keys = [] code, keys = gen_code(ops, {}, keys) > s = source(code) tests/test_inline_snapshot.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_u6/test_1.py:10: in print(4 == s["k_0"]) # update 2+2 -> 4 /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_u6/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- [0, 1] input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |s = snapshot({"k_0": 2+2, "k_1": 5}) |print(4 == s["k_0"]) # update 2+2 -> 4 |print(4 >= s["k_1"]) # fix 5 -> 4 _____________ test_generic_multi[executing-update(==) update(>=)] ______________ source = .w at 0x7f6a3edca200> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx=>, request==)]>>) ops = (operation(value='4', op='==', svalue='2+2', fvalue='4', flag='update'), operation(value='5', op='>=', svalue='3+2', fvalue='5', flag='update')) executing_used = True @pytest.mark.parametrize( "ops", [ pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) for ops in itertools.combinations(operations, 2) ], ) def test_generic_multi(source, subtests, ops, executing_used): def gen_code(ops, fixed, old_keys): keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] new_keys = [] args = [] print(keys) for k in keys: op = ops[k] value = op.fvalue if op.flag in fixed else op.svalue if value: args.append(f'"k_{k}": {value}') new_keys.append(k) args = ", ".join(args) code = "s = snapshot({" + args + "})\n" for k, op in enumerate(ops): code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' return code, new_keys all_flags = {op.flag for op in ops} keys = [] code, keys = gen_code(ops, {}, keys) > s = source(code) tests/test_inline_snapshot.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_u7/test_1.py:10: in print(4 == s["k_0"]) # update 2+2 -> 4 /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_u7/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- [0, 1] input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |s = snapshot({"k_0": 2+2, "k_1": 3+2}) |print(4 == s["k_0"]) # update 2+2 -> 4 |print(5 >= s["k_1"]) # update 3+2 -> 5 _____________ test_generic_multi[executing-update(==) create(in)] ______________ source = .w at 0x7f6a3edcb920> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx=>, request=>) ops = (operation(value='4', op='==', svalue='2+2', fvalue='4', flag='update'), operation(value='5', op='in', svalue='', fvalue='[5]', flag='create')) executing_used = True @pytest.mark.parametrize( "ops", [ pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) for ops in itertools.combinations(operations, 2) ], ) def test_generic_multi(source, subtests, ops, executing_used): def gen_code(ops, fixed, old_keys): keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] new_keys = [] args = [] print(keys) for k in keys: op = ops[k] value = op.fvalue if op.flag in fixed else op.svalue if value: args.append(f'"k_{k}": {value}') new_keys.append(k) args = ", ".join(args) code = "s = snapshot({" + args + "})\n" for k, op in enumerate(ops): code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' return code, new_keys all_flags = {op.flag for op in ops} keys = [] code, keys = gen_code(ops, {}, keys) > s = source(code) tests/test_inline_snapshot.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_u8/test_1.py:10: in print(4 == s["k_0"]) # update 2+2 -> 4 /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_u8/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- [0, 1] input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |s = snapshot({"k_0": 2+2}) |print(4 == s["k_0"]) # update 2+2 -> 4 |print(5 in s["k_1"]) # create -> [5] ______________ test_generic_multi[executing-update(==) trim(in)] _______________ source = .w at 0x7f6a3ee8ede0> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx=>, request=>) ops = (operation(value='4', op='==', svalue='2+2', fvalue='4', flag='update'), operation(value='5', op='in', svalue='[4, 5]', fvalue='[5]', flag='trim')) executing_used = True @pytest.mark.parametrize( "ops", [ pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) for ops in itertools.combinations(operations, 2) ], ) def test_generic_multi(source, subtests, ops, executing_used): def gen_code(ops, fixed, old_keys): keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] new_keys = [] args = [] print(keys) for k in keys: op = ops[k] value = op.fvalue if op.flag in fixed else op.svalue if value: args.append(f'"k_{k}": {value}') new_keys.append(k) args = ", ".join(args) code = "s = snapshot({" + args + "})\n" for k, op in enumerate(ops): code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' return code, new_keys all_flags = {op.flag for op in ops} keys = [] code, keys = gen_code(ops, {}, keys) > s = source(code) tests/test_inline_snapshot.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_u9/test_1.py:10: in print(4 == s["k_0"]) # update 2+2 -> 4 /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_u9/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- [0, 1] input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |s = snapshot({"k_0": 2+2, "k_1": [4, 5]}) |print(4 == s["k_0"]) # update 2+2 -> 4 |print(5 in s["k_1"]) # trim [4, 5] -> [5] _______________ test_generic_multi[executing-update(==) fix(in)] _______________ source = .w at 0x7f6a3edc9f80> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx=>, request=>) ops = (operation(value='4', op='==', svalue='2+2', fvalue='4', flag='update'), operation(value='5', op='in', svalue='[]', fvalue='[5]', flag='fix')) executing_used = True @pytest.mark.parametrize( "ops", [ pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) for ops in itertools.combinations(operations, 2) ], ) def test_generic_multi(source, subtests, ops, executing_used): def gen_code(ops, fixed, old_keys): keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] new_keys = [] args = [] print(keys) for k in keys: op = ops[k] value = op.fvalue if op.flag in fixed else op.svalue if value: args.append(f'"k_{k}": {value}') new_keys.append(k) args = ", ".join(args) code = "s = snapshot({" + args + "})\n" for k, op in enumerate(ops): code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' return code, new_keys all_flags = {op.flag for op in ops} keys = [] code, keys = gen_code(ops, {}, keys) > s = source(code) tests/test_inline_snapshot.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_u10/test_1.py:10: in print(4 == s["k_0"]) # update 2+2 -> 4 /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_u10/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- [0, 1] input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |s = snapshot({"k_0": 2+2, "k_1": []}) |print(4 == s["k_0"]) # update 2+2 -> 4 |print(5 in s["k_1"]) # fix [] -> [5] _____________ test_generic_multi[executing-update(==) update(in)] ______________ source = .w at 0x7f6a3ec147c0> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx=>, request=>) ops = (operation(value='4', op='==', svalue='2+2', fvalue='4', flag='update'), operation(value='5', op='in', svalue='[3+2]', fvalue='[5]', flag='update')) executing_used = True @pytest.mark.parametrize( "ops", [ pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) for ops in itertools.combinations(operations, 2) ], ) def test_generic_multi(source, subtests, ops, executing_used): def gen_code(ops, fixed, old_keys): keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] new_keys = [] args = [] print(keys) for k in keys: op = ops[k] value = op.fvalue if op.flag in fixed else op.svalue if value: args.append(f'"k_{k}": {value}') new_keys.append(k) args = ", ".join(args) code = "s = snapshot({" + args + "})\n" for k, op in enumerate(ops): code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' return code, new_keys all_flags = {op.flag for op in ops} keys = [] code, keys = gen_code(ops, {}, keys) > s = source(code) tests/test_inline_snapshot.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_u11/test_1.py:10: in print(4 == s["k_0"]) # update 2+2 -> 4 /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_u11/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- [0, 1] input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |s = snapshot({"k_0": 2+2, "k_1": [3+2]}) |print(4 == s["k_0"]) # update 2+2 -> 4 |print(5 in s["k_1"]) # update [3+2] -> [5] ______________ test_generic_multi[executing-create(<=) trim(<=)] _______________ source = .w at 0x7f6a3ee8f060> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx=>, request=>) ops = (operation(value='4', op='<=', svalue='', fvalue='4', flag='create'), operation(value='4', op='<=', svalue='5', fvalue='4', flag='trim')) executing_used = True @pytest.mark.parametrize( "ops", [ pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) for ops in itertools.combinations(operations, 2) ], ) def test_generic_multi(source, subtests, ops, executing_used): def gen_code(ops, fixed, old_keys): keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] new_keys = [] args = [] print(keys) for k in keys: op = ops[k] value = op.fvalue if op.flag in fixed else op.svalue if value: args.append(f'"k_{k}": {value}') new_keys.append(k) args = ", ".join(args) code = "s = snapshot({" + args + "})\n" for k, op in enumerate(ops): code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' return code, new_keys all_flags = {op.flag for op in ops} keys = [] code, keys = gen_code(ops, {}, keys) > s = source(code) tests/test_inline_snapshot.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:125: in run changes += snapshot._changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes yield from self._value._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes yield from self._new_value[key]._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes new_code = self._file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_c14/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- [0, 1] input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |s = snapshot({"k_1": 5}) |print(4 <= s["k_0"]) # create -> 4 |print(4 <= s["k_1"]) # trim 5 -> 4 True True _______________ test_generic_multi[executing-create(<=) fix(<=)] _______________ source = .w at 0x7f6a3ec14fe0> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx=>, request=>) ops = (operation(value='4', op='<=', svalue='', fvalue='4', flag='create'), operation(value='5', op='<=', svalue='4', fvalue='5', flag='fix')) executing_used = True @pytest.mark.parametrize( "ops", [ pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) for ops in itertools.combinations(operations, 2) ], ) def test_generic_multi(source, subtests, ops, executing_used): def gen_code(ops, fixed, old_keys): keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] new_keys = [] args = [] print(keys) for k in keys: op = ops[k] value = op.fvalue if op.flag in fixed else op.svalue if value: args.append(f'"k_{k}": {value}') new_keys.append(k) args = ", ".join(args) code = "s = snapshot({" + args + "})\n" for k, op in enumerate(ops): code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' return code, new_keys all_flags = {op.flag for op in ops} keys = [] code, keys = gen_code(ops, {}, keys) > s = source(code) tests/test_inline_snapshot.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:125: in run changes += snapshot._changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes yield from self._value._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes yield from self._new_value[key]._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes new_code = self._file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '5 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_c15/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- [0, 1] input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |s = snapshot({"k_1": 4}) |print(4 <= s["k_0"]) # create -> 4 |print(5 <= s["k_1"]) # fix 4 -> 5 True False _____________ test_generic_multi[executing-create(<=) update(<=)] ______________ source = .w at 0x7f6a3ec154e0> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx=>, request=>) ops = (operation(value='4', op='<=', svalue='', fvalue='4', flag='create'), operation(value='5', op='<=', svalue='3+2', fvalue='5', flag='update')) executing_used = True @pytest.mark.parametrize( "ops", [ pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) for ops in itertools.combinations(operations, 2) ], ) def test_generic_multi(source, subtests, ops, executing_used): def gen_code(ops, fixed, old_keys): keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] new_keys = [] args = [] print(keys) for k in keys: op = ops[k] value = op.fvalue if op.flag in fixed else op.svalue if value: args.append(f'"k_{k}": {value}') new_keys.append(k) args = ", ".join(args) code = "s = snapshot({" + args + "})\n" for k, op in enumerate(ops): code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' return code, new_keys all_flags = {op.flag for op in ops} keys = [] code, keys = gen_code(ops, {}, keys) > s = source(code) tests/test_inline_snapshot.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:125: in run changes += snapshot._changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes yield from self._value._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes yield from self._new_value[key]._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes new_code = self._file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '5 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_c16/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- [0, 1] input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |s = snapshot({"k_1": 3+2}) |print(4 <= s["k_0"]) # create -> 4 |print(5 <= s["k_1"]) # update 3+2 -> 5 True True _____________ test_generic_multi[executing-create(<=) create(>=)] ______________ source = .w at 0x7f6a3edcb060> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx=>, request==)]>>) ops = (operation(value='4', op='<=', svalue='', fvalue='4', flag='create'), operation(value='5', op='>=', svalue='', fvalue='5', flag='create')) executing_used = True @pytest.mark.parametrize( "ops", [ pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) for ops in itertools.combinations(operations, 2) ], ) def test_generic_multi(source, subtests, ops, executing_used): def gen_code(ops, fixed, old_keys): keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] new_keys = [] args = [] print(keys) for k in keys: op = ops[k] value = op.fvalue if op.flag in fixed else op.svalue if value: args.append(f'"k_{k}": {value}') new_keys.append(k) args = ", ".join(args) code = "s = snapshot({" + args + "})\n" for k, op in enumerate(ops): code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' return code, new_keys all_flags = {op.flag for op in ops} keys = [] code, keys = gen_code(ops, {}, keys) > s = source(code) tests/test_inline_snapshot.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:125: in run changes += snapshot._changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes yield from self._value._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:534: in _get_changes to_insert.append((key, new_value_element._new_code())) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:321: in _new_code return self._file._value_to_code(self._new_value) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code return self._token_to_code(value_to_token(value)) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_c17/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- [0, 1] input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |s = snapshot({}) |print(4 <= s["k_0"]) # create -> 4 |print(5 >= s["k_1"]) # create -> 5 True True ______________ test_generic_multi[executing-create(<=) trim(>=)] _______________ source = .w at 0x7f6a3edcbba0> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx=>, request==)]>>) ops = (operation(value='4', op='<=', svalue='', fvalue='4', flag='create'), operation(value='5', op='>=', svalue='4', fvalue='5', flag='trim')) executing_used = True @pytest.mark.parametrize( "ops", [ pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) for ops in itertools.combinations(operations, 2) ], ) def test_generic_multi(source, subtests, ops, executing_used): def gen_code(ops, fixed, old_keys): keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] new_keys = [] args = [] print(keys) for k in keys: op = ops[k] value = op.fvalue if op.flag in fixed else op.svalue if value: args.append(f'"k_{k}": {value}') new_keys.append(k) args = ", ".join(args) code = "s = snapshot({" + args + "})\n" for k, op in enumerate(ops): code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' return code, new_keys all_flags = {op.flag for op in ops} keys = [] code, keys = gen_code(ops, {}, keys) > s = source(code) tests/test_inline_snapshot.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:125: in run changes += snapshot._changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes yield from self._value._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes yield from self._new_value[key]._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes new_code = self._file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '5 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_c18/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- [0, 1] input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |s = snapshot({"k_1": 4}) |print(4 <= s["k_0"]) # create -> 4 |print(5 >= s["k_1"]) # trim 4 -> 5 True True _______________ test_generic_multi[executing-create(<=) fix(>=)] _______________ source = .w at 0x7f6a3edcafc0> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx=>, request==)]>>) ops = (operation(value='4', op='<=', svalue='', fvalue='4', flag='create'), operation(value='4', op='>=', svalue='5', fvalue='4', flag='fix')) executing_used = True @pytest.mark.parametrize( "ops", [ pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) for ops in itertools.combinations(operations, 2) ], ) def test_generic_multi(source, subtests, ops, executing_used): def gen_code(ops, fixed, old_keys): keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] new_keys = [] args = [] print(keys) for k in keys: op = ops[k] value = op.fvalue if op.flag in fixed else op.svalue if value: args.append(f'"k_{k}": {value}') new_keys.append(k) args = ", ".join(args) code = "s = snapshot({" + args + "})\n" for k, op in enumerate(ops): code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' return code, new_keys all_flags = {op.flag for op in ops} keys = [] code, keys = gen_code(ops, {}, keys) > s = source(code) tests/test_inline_snapshot.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:125: in run changes += snapshot._changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes yield from self._value._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes yield from self._new_value[key]._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes new_code = self._file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_c19/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- [0, 1] input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |s = snapshot({"k_1": 5}) |print(4 <= s["k_0"]) # create -> 4 |print(4 >= s["k_1"]) # fix 5 -> 4 True False _____________ test_generic_multi[executing-create(<=) update(>=)] ______________ source = .w at 0x7f6a3edc9b20> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx=>, request==)]>>) ops = (operation(value='4', op='<=', svalue='', fvalue='4', flag='create'), operation(value='5', op='>=', svalue='3+2', fvalue='5', flag='update')) executing_used = True @pytest.mark.parametrize( "ops", [ pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) for ops in itertools.combinations(operations, 2) ], ) def test_generic_multi(source, subtests, ops, executing_used): def gen_code(ops, fixed, old_keys): keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] new_keys = [] args = [] print(keys) for k in keys: op = ops[k] value = op.fvalue if op.flag in fixed else op.svalue if value: args.append(f'"k_{k}": {value}') new_keys.append(k) args = ", ".join(args) code = "s = snapshot({" + args + "})\n" for k, op in enumerate(ops): code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' return code, new_keys all_flags = {op.flag for op in ops} keys = [] code, keys = gen_code(ops, {}, keys) > s = source(code) tests/test_inline_snapshot.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:125: in run changes += snapshot._changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes yield from self._value._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes yield from self._new_value[key]._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes new_code = self._file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '5 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_c20/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- [0, 1] input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |s = snapshot({"k_1": 3+2}) |print(4 <= s["k_0"]) # create -> 4 |print(5 >= s["k_1"]) # update 3+2 -> 5 True True _____________ test_generic_multi[executing-create(<=) create(in)] ______________ source = .w at 0x7f6a3edc9ee0> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx=>, request=>) ops = (operation(value='4', op='<=', svalue='', fvalue='4', flag='create'), operation(value='5', op='in', svalue='', fvalue='[5]', flag='create')) executing_used = True @pytest.mark.parametrize( "ops", [ pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) for ops in itertools.combinations(operations, 2) ], ) def test_generic_multi(source, subtests, ops, executing_used): def gen_code(ops, fixed, old_keys): keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] new_keys = [] args = [] print(keys) for k in keys: op = ops[k] value = op.fvalue if op.flag in fixed else op.svalue if value: args.append(f'"k_{k}": {value}') new_keys.append(k) args = ", ".join(args) code = "s = snapshot({" + args + "})\n" for k, op in enumerate(ops): code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' return code, new_keys all_flags = {op.flag for op in ops} keys = [] code, keys = gen_code(ops, {}, keys) > s = source(code) tests/test_inline_snapshot.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:125: in run changes += snapshot._changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes yield from self._value._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:534: in _get_changes to_insert.append((key, new_value_element._new_code())) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:321: in _new_code return self._file._value_to_code(self._new_value) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code return self._token_to_code(value_to_token(value)) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_c21/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- [0, 1] input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |s = snapshot({}) |print(4 <= s["k_0"]) # create -> 4 |print(5 in s["k_1"]) # create -> [5] True True ______________ test_generic_multi[executing-create(<=) trim(in)] _______________ source = .w at 0x7f6a3edcbd80> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx=>, request=>) ops = (operation(value='4', op='<=', svalue='', fvalue='4', flag='create'), operation(value='5', op='in', svalue='[4, 5]', fvalue='[5]', flag='trim')) executing_used = True @pytest.mark.parametrize( "ops", [ pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) for ops in itertools.combinations(operations, 2) ], ) def test_generic_multi(source, subtests, ops, executing_used): def gen_code(ops, fixed, old_keys): keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] new_keys = [] args = [] print(keys) for k in keys: op = ops[k] value = op.fvalue if op.flag in fixed else op.svalue if value: args.append(f'"k_{k}": {value}') new_keys.append(k) args = ", ".join(args) code = "s = snapshot({" + args + "})\n" for k, op in enumerate(ops): code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' return code, new_keys all_flags = {op.flag for op in ops} keys = [] code, keys = gen_code(ops, {}, keys) > s = source(code) tests/test_inline_snapshot.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:125: in run changes += snapshot._changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes yield from self._value._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:534: in _get_changes to_insert.append((key, new_value_element._new_code())) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:321: in _new_code return self._file._value_to_code(self._new_value) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code return self._token_to_code(value_to_token(value)) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_c22/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- [0, 1] input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |s = snapshot({"k_1": [4, 5]}) |print(4 <= s["k_0"]) # create -> 4 |print(5 in s["k_1"]) # trim [4, 5] -> [5] True True _______________ test_generic_multi[executing-create(<=) fix(in)] _______________ source = .w at 0x7f6a3ef49580> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx=>, request=>) ops = (operation(value='4', op='<=', svalue='', fvalue='4', flag='create'), operation(value='5', op='in', svalue='[]', fvalue='[5]', flag='fix')) executing_used = True @pytest.mark.parametrize( "ops", [ pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) for ops in itertools.combinations(operations, 2) ], ) def test_generic_multi(source, subtests, ops, executing_used): def gen_code(ops, fixed, old_keys): keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] new_keys = [] args = [] print(keys) for k in keys: op = ops[k] value = op.fvalue if op.flag in fixed else op.svalue if value: args.append(f'"k_{k}": {value}') new_keys.append(k) args = ", ".join(args) code = "s = snapshot({" + args + "})\n" for k, op in enumerate(ops): code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' return code, new_keys all_flags = {op.flag for op in ops} keys = [] code, keys = gen_code(ops, {}, keys) > s = source(code) tests/test_inline_snapshot.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:125: in run changes += snapshot._changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes yield from self._value._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes yield from self._new_value[key]._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:456: in _get_changes new_code=[self._file._value_to_code(v) for v in new_values], /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code return self._token_to_code(value_to_token(value)) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '5 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_c23/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- [0, 1] input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |s = snapshot({"k_1": []}) |print(4 <= s["k_0"]) # create -> 4 |print(5 in s["k_1"]) # fix [] -> [5] True False _____________ test_generic_multi[executing-create(<=) update(in)] ______________ source = .w at 0x7f6a3ef49ee0> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx=>, request=>) ops = (operation(value='4', op='<=', svalue='', fvalue='4', flag='create'), operation(value='5', op='in', svalue='[3+2]', fvalue='[5]', flag='update')) executing_used = True @pytest.mark.parametrize( "ops", [ pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) for ops in itertools.combinations(operations, 2) ], ) def test_generic_multi(source, subtests, ops, executing_used): def gen_code(ops, fixed, old_keys): keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] new_keys = [] args = [] print(keys) for k in keys: op = ops[k] value = op.fvalue if op.flag in fixed else op.svalue if value: args.append(f'"k_{k}": {value}') new_keys.append(k) args = ", ".join(args) code = "s = snapshot({" + args + "})\n" for k, op in enumerate(ops): code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' return code, new_keys all_flags = {op.flag for op in ops} keys = [] code, keys = gen_code(ops, {}, keys) > s = source(code) tests/test_inline_snapshot.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:125: in run changes += snapshot._changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes yield from self._value._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes yield from self._new_value[key]._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:438: in _get_changes new_code = self._file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '5 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_c24/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- [0, 1] input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |s = snapshot({"k_1": [3+2]}) |print(4 <= s["k_0"]) # create -> 4 |print(5 in s["k_1"]) # update [3+2] -> [5] True True ________________ test_generic_multi[executing-trim(<=) fix(<=)] ________________ source = .w at 0x7f6a3edc9bc0> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx=>, request=>) ops = (operation(value='4', op='<=', svalue='5', fvalue='4', flag='trim'), operation(value='5', op='<=', svalue='4', fvalue='5', flag='fix')) executing_used = True @pytest.mark.parametrize( "ops", [ pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) for ops in itertools.combinations(operations, 2) ], ) def test_generic_multi(source, subtests, ops, executing_used): def gen_code(ops, fixed, old_keys): keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] new_keys = [] args = [] print(keys) for k in keys: op = ops[k] value = op.fvalue if op.flag in fixed else op.svalue if value: args.append(f'"k_{k}": {value}') new_keys.append(k) args = ", ".join(args) code = "s = snapshot({" + args + "})\n" for k, op in enumerate(ops): code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' return code, new_keys all_flags = {op.flag for op in ops} keys = [] code, keys = gen_code(ops, {}, keys) > s = source(code) tests/test_inline_snapshot.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:125: in run changes += snapshot._changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes yield from self._value._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes yield from self._new_value[key]._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes new_code = self._file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_t0/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- [0, 1] input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |s = snapshot({"k_0": 5, "k_1": 4}) |print(4 <= s["k_0"]) # trim 5 -> 4 |print(5 <= s["k_1"]) # fix 4 -> 5 True False ______________ test_generic_multi[executing-trim(<=) update(<=)] _______________ source = .w at 0x7f6a3ee8ec00> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx=>, request=>) ops = (operation(value='4', op='<=', svalue='5', fvalue='4', flag='trim'), operation(value='5', op='<=', svalue='3+2', fvalue='5', flag='update')) executing_used = True @pytest.mark.parametrize( "ops", [ pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) for ops in itertools.combinations(operations, 2) ], ) def test_generic_multi(source, subtests, ops, executing_used): def gen_code(ops, fixed, old_keys): keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] new_keys = [] args = [] print(keys) for k in keys: op = ops[k] value = op.fvalue if op.flag in fixed else op.svalue if value: args.append(f'"k_{k}": {value}') new_keys.append(k) args = ", ".join(args) code = "s = snapshot({" + args + "})\n" for k, op in enumerate(ops): code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' return code, new_keys all_flags = {op.flag for op in ops} keys = [] code, keys = gen_code(ops, {}, keys) > s = source(code) tests/test_inline_snapshot.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:125: in run changes += snapshot._changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes yield from self._value._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes yield from self._new_value[key]._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes new_code = self._file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_t1/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- [0, 1] input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |s = snapshot({"k_0": 5, "k_1": 3+2}) |print(4 <= s["k_0"]) # trim 5 -> 4 |print(5 <= s["k_1"]) # update 3+2 -> 5 True True ______________ test_generic_multi[executing-trim(<=) create(>=)] _______________ source = .w at 0x7f6a3ef48cc0> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx=>, request==)]>>) ops = (operation(value='4', op='<=', svalue='5', fvalue='4', flag='trim'), operation(value='5', op='>=', svalue='', fvalue='5', flag='create')) executing_used = True @pytest.mark.parametrize( "ops", [ pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) for ops in itertools.combinations(operations, 2) ], ) def test_generic_multi(source, subtests, ops, executing_used): def gen_code(ops, fixed, old_keys): keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] new_keys = [] args = [] print(keys) for k in keys: op = ops[k] value = op.fvalue if op.flag in fixed else op.svalue if value: args.append(f'"k_{k}": {value}') new_keys.append(k) args = ", ".join(args) code = "s = snapshot({" + args + "})\n" for k, op in enumerate(ops): code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' return code, new_keys all_flags = {op.flag for op in ops} keys = [] code, keys = gen_code(ops, {}, keys) > s = source(code) tests/test_inline_snapshot.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:125: in run changes += snapshot._changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes yield from self._value._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes yield from self._new_value[key]._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes new_code = self._file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_t2/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- [0, 1] input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |s = snapshot({"k_0": 5}) |print(4 <= s["k_0"]) # trim 5 -> 4 |print(5 >= s["k_1"]) # create -> 5 True True _______________ test_generic_multi[executing-trim(<=) trim(>=)] ________________ source = .w at 0x7f6a3ee8e5c0> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx=>, request==)]>>) ops = (operation(value='4', op='<=', svalue='5', fvalue='4', flag='trim'), operation(value='5', op='>=', svalue='4', fvalue='5', flag='trim')) executing_used = True @pytest.mark.parametrize( "ops", [ pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) for ops in itertools.combinations(operations, 2) ], ) def test_generic_multi(source, subtests, ops, executing_used): def gen_code(ops, fixed, old_keys): keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] new_keys = [] args = [] print(keys) for k in keys: op = ops[k] value = op.fvalue if op.flag in fixed else op.svalue if value: args.append(f'"k_{k}": {value}') new_keys.append(k) args = ", ".join(args) code = "s = snapshot({" + args + "})\n" for k, op in enumerate(ops): code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' return code, new_keys all_flags = {op.flag for op in ops} keys = [] code, keys = gen_code(ops, {}, keys) > s = source(code) tests/test_inline_snapshot.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:125: in run changes += snapshot._changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes yield from self._value._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes yield from self._new_value[key]._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes new_code = self._file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_t3/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- [0, 1] input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |s = snapshot({"k_0": 5, "k_1": 4}) |print(4 <= s["k_0"]) # trim 5 -> 4 |print(5 >= s["k_1"]) # trim 4 -> 5 True True ________________ test_generic_multi[executing-trim(<=) fix(>=)] ________________ source = .w at 0x7f6a3ee8c040> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx=>, request==)]>>) ops = (operation(value='4', op='<=', svalue='5', fvalue='4', flag='trim'), operation(value='4', op='>=', svalue='5', fvalue='4', flag='fix')) executing_used = True @pytest.mark.parametrize( "ops", [ pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) for ops in itertools.combinations(operations, 2) ], ) def test_generic_multi(source, subtests, ops, executing_used): def gen_code(ops, fixed, old_keys): keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] new_keys = [] args = [] print(keys) for k in keys: op = ops[k] value = op.fvalue if op.flag in fixed else op.svalue if value: args.append(f'"k_{k}": {value}') new_keys.append(k) args = ", ".join(args) code = "s = snapshot({" + args + "})\n" for k, op in enumerate(ops): code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' return code, new_keys all_flags = {op.flag for op in ops} keys = [] code, keys = gen_code(ops, {}, keys) > s = source(code) tests/test_inline_snapshot.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:125: in run changes += snapshot._changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes yield from self._value._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes yield from self._new_value[key]._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes new_code = self._file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_t4/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- [0, 1] input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |s = snapshot({"k_0": 5, "k_1": 5}) |print(4 <= s["k_0"]) # trim 5 -> 4 |print(4 >= s["k_1"]) # fix 5 -> 4 True False ______________ test_generic_multi[executing-trim(<=) update(>=)] _______________ source = .w at 0x7f6a3ee8e5c0> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx=>, request==)]>>) ops = (operation(value='4', op='<=', svalue='5', fvalue='4', flag='trim'), operation(value='5', op='>=', svalue='3+2', fvalue='5', flag='update')) executing_used = True @pytest.mark.parametrize( "ops", [ pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) for ops in itertools.combinations(operations, 2) ], ) def test_generic_multi(source, subtests, ops, executing_used): def gen_code(ops, fixed, old_keys): keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] new_keys = [] args = [] print(keys) for k in keys: op = ops[k] value = op.fvalue if op.flag in fixed else op.svalue if value: args.append(f'"k_{k}": {value}') new_keys.append(k) args = ", ".join(args) code = "s = snapshot({" + args + "})\n" for k, op in enumerate(ops): code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' return code, new_keys all_flags = {op.flag for op in ops} keys = [] code, keys = gen_code(ops, {}, keys) > s = source(code) tests/test_inline_snapshot.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:125: in run changes += snapshot._changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes yield from self._value._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes yield from self._new_value[key]._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes new_code = self._file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_t5/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- [0, 1] input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |s = snapshot({"k_0": 5, "k_1": 3+2}) |print(4 <= s["k_0"]) # trim 5 -> 4 |print(5 >= s["k_1"]) # update 3+2 -> 5 True True ______________ test_generic_multi[executing-trim(<=) create(in)] _______________ source = .w at 0x7f6a3edc9ee0> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx=>, request=>) ops = (operation(value='4', op='<=', svalue='5', fvalue='4', flag='trim'), operation(value='5', op='in', svalue='', fvalue='[5]', flag='create')) executing_used = True @pytest.mark.parametrize( "ops", [ pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) for ops in itertools.combinations(operations, 2) ], ) def test_generic_multi(source, subtests, ops, executing_used): def gen_code(ops, fixed, old_keys): keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] new_keys = [] args = [] print(keys) for k in keys: op = ops[k] value = op.fvalue if op.flag in fixed else op.svalue if value: args.append(f'"k_{k}": {value}') new_keys.append(k) args = ", ".join(args) code = "s = snapshot({" + args + "})\n" for k, op in enumerate(ops): code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' return code, new_keys all_flags = {op.flag for op in ops} keys = [] code, keys = gen_code(ops, {}, keys) > s = source(code) tests/test_inline_snapshot.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:125: in run changes += snapshot._changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes yield from self._value._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes yield from self._new_value[key]._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes new_code = self._file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_t6/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- [0, 1] input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |s = snapshot({"k_0": 5}) |print(4 <= s["k_0"]) # trim 5 -> 4 |print(5 in s["k_1"]) # create -> [5] True True _______________ test_generic_multi[executing-trim(<=) trim(in)] ________________ source = .w at 0x7f6a3ec147c0> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx=>, request=>) ops = (operation(value='4', op='<=', svalue='5', fvalue='4', flag='trim'), operation(value='5', op='in', svalue='[4, 5]', fvalue='[5]', flag='trim')) executing_used = True @pytest.mark.parametrize( "ops", [ pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) for ops in itertools.combinations(operations, 2) ], ) def test_generic_multi(source, subtests, ops, executing_used): def gen_code(ops, fixed, old_keys): keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] new_keys = [] args = [] print(keys) for k in keys: op = ops[k] value = op.fvalue if op.flag in fixed else op.svalue if value: args.append(f'"k_{k}": {value}') new_keys.append(k) args = ", ".join(args) code = "s = snapshot({" + args + "})\n" for k, op in enumerate(ops): code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' return code, new_keys all_flags = {op.flag for op in ops} keys = [] code, keys = gen_code(ops, {}, keys) > s = source(code) tests/test_inline_snapshot.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:125: in run changes += snapshot._changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes yield from self._value._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes yield from self._new_value[key]._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes new_code = self._file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_t7/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- [0, 1] input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |s = snapshot({"k_0": 5, "k_1": [4, 5]}) |print(4 <= s["k_0"]) # trim 5 -> 4 |print(5 in s["k_1"]) # trim [4, 5] -> [5] True True ________________ test_generic_multi[executing-trim(<=) fix(in)] ________________ source = .w at 0x7f6a3edc9ee0> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx=>, request=>) ops = (operation(value='4', op='<=', svalue='5', fvalue='4', flag='trim'), operation(value='5', op='in', svalue='[]', fvalue='[5]', flag='fix')) executing_used = True @pytest.mark.parametrize( "ops", [ pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) for ops in itertools.combinations(operations, 2) ], ) def test_generic_multi(source, subtests, ops, executing_used): def gen_code(ops, fixed, old_keys): keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] new_keys = [] args = [] print(keys) for k in keys: op = ops[k] value = op.fvalue if op.flag in fixed else op.svalue if value: args.append(f'"k_{k}": {value}') new_keys.append(k) args = ", ".join(args) code = "s = snapshot({" + args + "})\n" for k, op in enumerate(ops): code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' return code, new_keys all_flags = {op.flag for op in ops} keys = [] code, keys = gen_code(ops, {}, keys) > s = source(code) tests/test_inline_snapshot.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:125: in run changes += snapshot._changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes yield from self._value._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes yield from self._new_value[key]._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes new_code = self._file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_t8/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- [0, 1] input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |s = snapshot({"k_0": 5, "k_1": []}) |print(4 <= s["k_0"]) # trim 5 -> 4 |print(5 in s["k_1"]) # fix [] -> [5] True False ______________ test_generic_multi[executing-trim(<=) update(in)] _______________ source = .w at 0x7f6a3ec14720> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx=>, request=>) ops = (operation(value='4', op='<=', svalue='5', fvalue='4', flag='trim'), operation(value='5', op='in', svalue='[3+2]', fvalue='[5]', flag='update')) executing_used = True @pytest.mark.parametrize( "ops", [ pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) for ops in itertools.combinations(operations, 2) ], ) def test_generic_multi(source, subtests, ops, executing_used): def gen_code(ops, fixed, old_keys): keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] new_keys = [] args = [] print(keys) for k in keys: op = ops[k] value = op.fvalue if op.flag in fixed else op.svalue if value: args.append(f'"k_{k}": {value}') new_keys.append(k) args = ", ".join(args) code = "s = snapshot({" + args + "})\n" for k, op in enumerate(ops): code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' return code, new_keys all_flags = {op.flag for op in ops} keys = [] code, keys = gen_code(ops, {}, keys) > s = source(code) tests/test_inline_snapshot.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:125: in run changes += snapshot._changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes yield from self._value._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes yield from self._new_value[key]._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes new_code = self._file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_t9/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- [0, 1] input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |s = snapshot({"k_0": 5, "k_1": [3+2]}) |print(4 <= s["k_0"]) # trim 5 -> 4 |print(5 in s["k_1"]) # update [3+2] -> [5] True True _______________ test_generic_multi[executing-fix(<=) update(<=)] _______________ source = .w at 0x7f6a3ec168e0> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx=>, request=>) ops = (operation(value='5', op='<=', svalue='4', fvalue='5', flag='fix'), operation(value='5', op='<=', svalue='3+2', fvalue='5', flag='update')) executing_used = True @pytest.mark.parametrize( "ops", [ pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) for ops in itertools.combinations(operations, 2) ], ) def test_generic_multi(source, subtests, ops, executing_used): def gen_code(ops, fixed, old_keys): keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] new_keys = [] args = [] print(keys) for k in keys: op = ops[k] value = op.fvalue if op.flag in fixed else op.svalue if value: args.append(f'"k_{k}": {value}') new_keys.append(k) args = ", ".join(args) code = "s = snapshot({" + args + "})\n" for k, op in enumerate(ops): code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' return code, new_keys all_flags = {op.flag for op in ops} keys = [] code, keys = gen_code(ops, {}, keys) > s = source(code) tests/test_inline_snapshot.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:125: in run changes += snapshot._changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes yield from self._value._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes yield from self._new_value[key]._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes new_code = self._file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '5 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_f13/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- [0, 1] input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |s = snapshot({"k_0": 4, "k_1": 3+2}) |print(5 <= s["k_0"]) # fix 4 -> 5 |print(5 <= s["k_1"]) # update 3+2 -> 5 False True _______________ test_generic_multi[executing-fix(<=) create(>=)] _______________ source = .w at 0x7f6a3ee8e5c0> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx=>, request==)]>>) ops = (operation(value='5', op='<=', svalue='4', fvalue='5', flag='fix'), operation(value='5', op='>=', svalue='', fvalue='5', flag='create')) executing_used = True @pytest.mark.parametrize( "ops", [ pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) for ops in itertools.combinations(operations, 2) ], ) def test_generic_multi(source, subtests, ops, executing_used): def gen_code(ops, fixed, old_keys): keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] new_keys = [] args = [] print(keys) for k in keys: op = ops[k] value = op.fvalue if op.flag in fixed else op.svalue if value: args.append(f'"k_{k}": {value}') new_keys.append(k) args = ", ".join(args) code = "s = snapshot({" + args + "})\n" for k, op in enumerate(ops): code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' return code, new_keys all_flags = {op.flag for op in ops} keys = [] code, keys = gen_code(ops, {}, keys) > s = source(code) tests/test_inline_snapshot.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:125: in run changes += snapshot._changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes yield from self._value._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes yield from self._new_value[key]._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes new_code = self._file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '5 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_f14/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- [0, 1] input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |s = snapshot({"k_0": 4}) |print(5 <= s["k_0"]) # fix 4 -> 5 |print(5 >= s["k_1"]) # create -> 5 False True ________________ test_generic_multi[executing-fix(<=) trim(>=)] ________________ source = .w at 0x7f6a3ec15a80> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx=>, request==)]>>) ops = (operation(value='5', op='<=', svalue='4', fvalue='5', flag='fix'), operation(value='5', op='>=', svalue='4', fvalue='5', flag='trim')) executing_used = True @pytest.mark.parametrize( "ops", [ pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) for ops in itertools.combinations(operations, 2) ], ) def test_generic_multi(source, subtests, ops, executing_used): def gen_code(ops, fixed, old_keys): keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] new_keys = [] args = [] print(keys) for k in keys: op = ops[k] value = op.fvalue if op.flag in fixed else op.svalue if value: args.append(f'"k_{k}": {value}') new_keys.append(k) args = ", ".join(args) code = "s = snapshot({" + args + "})\n" for k, op in enumerate(ops): code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' return code, new_keys all_flags = {op.flag for op in ops} keys = [] code, keys = gen_code(ops, {}, keys) > s = source(code) tests/test_inline_snapshot.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:125: in run changes += snapshot._changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes yield from self._value._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes yield from self._new_value[key]._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes new_code = self._file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '5 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_f15/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- [0, 1] input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |s = snapshot({"k_0": 4, "k_1": 4}) |print(5 <= s["k_0"]) # fix 4 -> 5 |print(5 >= s["k_1"]) # trim 4 -> 5 False True ________________ test_generic_multi[executing-fix(<=) fix(>=)] _________________ source = .w at 0x7f6a3ec17880> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx=>, request==)]>>) ops = (operation(value='5', op='<=', svalue='4', fvalue='5', flag='fix'), operation(value='4', op='>=', svalue='5', fvalue='4', flag='fix')) executing_used = True @pytest.mark.parametrize( "ops", [ pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) for ops in itertools.combinations(operations, 2) ], ) def test_generic_multi(source, subtests, ops, executing_used): def gen_code(ops, fixed, old_keys): keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] new_keys = [] args = [] print(keys) for k in keys: op = ops[k] value = op.fvalue if op.flag in fixed else op.svalue if value: args.append(f'"k_{k}": {value}') new_keys.append(k) args = ", ".join(args) code = "s = snapshot({" + args + "})\n" for k, op in enumerate(ops): code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' return code, new_keys all_flags = {op.flag for op in ops} keys = [] code, keys = gen_code(ops, {}, keys) > s = source(code) tests/test_inline_snapshot.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:125: in run changes += snapshot._changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes yield from self._value._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes yield from self._new_value[key]._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes new_code = self._file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '5 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_f16/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- [0, 1] input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |s = snapshot({"k_0": 4, "k_1": 5}) |print(5 <= s["k_0"]) # fix 4 -> 5 |print(4 >= s["k_1"]) # fix 5 -> 4 False False _______________ test_generic_multi[executing-fix(<=) update(>=)] _______________ source = .w at 0x7f6a3ec16480> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx=>, request==)]>>) ops = (operation(value='5', op='<=', svalue='4', fvalue='5', flag='fix'), operation(value='5', op='>=', svalue='3+2', fvalue='5', flag='update')) executing_used = True @pytest.mark.parametrize( "ops", [ pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) for ops in itertools.combinations(operations, 2) ], ) def test_generic_multi(source, subtests, ops, executing_used): def gen_code(ops, fixed, old_keys): keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] new_keys = [] args = [] print(keys) for k in keys: op = ops[k] value = op.fvalue if op.flag in fixed else op.svalue if value: args.append(f'"k_{k}": {value}') new_keys.append(k) args = ", ".join(args) code = "s = snapshot({" + args + "})\n" for k, op in enumerate(ops): code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' return code, new_keys all_flags = {op.flag for op in ops} keys = [] code, keys = gen_code(ops, {}, keys) > s = source(code) tests/test_inline_snapshot.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:125: in run changes += snapshot._changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes yield from self._value._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes yield from self._new_value[key]._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes new_code = self._file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '5 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_f17/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- [0, 1] input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |s = snapshot({"k_0": 4, "k_1": 3+2}) |print(5 <= s["k_0"]) # fix 4 -> 5 |print(5 >= s["k_1"]) # update 3+2 -> 5 False True _______________ test_generic_multi[executing-fix(<=) create(in)] _______________ source = .w at 0x7f6a3ee8c720> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx=>, request=>) ops = (operation(value='5', op='<=', svalue='4', fvalue='5', flag='fix'), operation(value='5', op='in', svalue='', fvalue='[5]', flag='create')) executing_used = True @pytest.mark.parametrize( "ops", [ pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) for ops in itertools.combinations(operations, 2) ], ) def test_generic_multi(source, subtests, ops, executing_used): def gen_code(ops, fixed, old_keys): keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] new_keys = [] args = [] print(keys) for k in keys: op = ops[k] value = op.fvalue if op.flag in fixed else op.svalue if value: args.append(f'"k_{k}": {value}') new_keys.append(k) args = ", ".join(args) code = "s = snapshot({" + args + "})\n" for k, op in enumerate(ops): code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' return code, new_keys all_flags = {op.flag for op in ops} keys = [] code, keys = gen_code(ops, {}, keys) > s = source(code) tests/test_inline_snapshot.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:125: in run changes += snapshot._changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes yield from self._value._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes yield from self._new_value[key]._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes new_code = self._file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '5 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_f18/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- [0, 1] input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |s = snapshot({"k_0": 4}) |print(5 <= s["k_0"]) # fix 4 -> 5 |print(5 in s["k_1"]) # create -> [5] False True ________________ test_generic_multi[executing-fix(<=) trim(in)] ________________ source = .w at 0x7f6a3f8c89a0> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx=>, request=>) ops = (operation(value='5', op='<=', svalue='4', fvalue='5', flag='fix'), operation(value='5', op='in', svalue='[4, 5]', fvalue='[5]', flag='trim')) executing_used = True @pytest.mark.parametrize( "ops", [ pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) for ops in itertools.combinations(operations, 2) ], ) def test_generic_multi(source, subtests, ops, executing_used): def gen_code(ops, fixed, old_keys): keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] new_keys = [] args = [] print(keys) for k in keys: op = ops[k] value = op.fvalue if op.flag in fixed else op.svalue if value: args.append(f'"k_{k}": {value}') new_keys.append(k) args = ", ".join(args) code = "s = snapshot({" + args + "})\n" for k, op in enumerate(ops): code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' return code, new_keys all_flags = {op.flag for op in ops} keys = [] code, keys = gen_code(ops, {}, keys) > s = source(code) tests/test_inline_snapshot.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:125: in run changes += snapshot._changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes yield from self._value._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes yield from self._new_value[key]._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes new_code = self._file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '5 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_f19/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- [0, 1] input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |s = snapshot({"k_0": 4, "k_1": [4, 5]}) |print(5 <= s["k_0"]) # fix 4 -> 5 |print(5 in s["k_1"]) # trim [4, 5] -> [5] False True ________________ test_generic_multi[executing-fix(<=) fix(in)] _________________ source = .w at 0x7f6a3ee8c720> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx=>, request=>) ops = (operation(value='5', op='<=', svalue='4', fvalue='5', flag='fix'), operation(value='5', op='in', svalue='[]', fvalue='[5]', flag='fix')) executing_used = True @pytest.mark.parametrize( "ops", [ pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) for ops in itertools.combinations(operations, 2) ], ) def test_generic_multi(source, subtests, ops, executing_used): def gen_code(ops, fixed, old_keys): keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] new_keys = [] args = [] print(keys) for k in keys: op = ops[k] value = op.fvalue if op.flag in fixed else op.svalue if value: args.append(f'"k_{k}": {value}') new_keys.append(k) args = ", ".join(args) code = "s = snapshot({" + args + "})\n" for k, op in enumerate(ops): code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' return code, new_keys all_flags = {op.flag for op in ops} keys = [] code, keys = gen_code(ops, {}, keys) > s = source(code) tests/test_inline_snapshot.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:125: in run changes += snapshot._changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes yield from self._value._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes yield from self._new_value[key]._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes new_code = self._file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '5 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_f20/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- [0, 1] input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |s = snapshot({"k_0": 4, "k_1": []}) |print(5 <= s["k_0"]) # fix 4 -> 5 |print(5 in s["k_1"]) # fix [] -> [5] False False _______________ test_generic_multi[executing-fix(<=) update(in)] _______________ source = .w at 0x7f6a3f8c85e0> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx=>, request=>) ops = (operation(value='5', op='<=', svalue='4', fvalue='5', flag='fix'), operation(value='5', op='in', svalue='[3+2]', fvalue='[5]', flag='update')) executing_used = True @pytest.mark.parametrize( "ops", [ pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) for ops in itertools.combinations(operations, 2) ], ) def test_generic_multi(source, subtests, ops, executing_used): def gen_code(ops, fixed, old_keys): keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] new_keys = [] args = [] print(keys) for k in keys: op = ops[k] value = op.fvalue if op.flag in fixed else op.svalue if value: args.append(f'"k_{k}": {value}') new_keys.append(k) args = ", ".join(args) code = "s = snapshot({" + args + "})\n" for k, op in enumerate(ops): code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' return code, new_keys all_flags = {op.flag for op in ops} keys = [] code, keys = gen_code(ops, {}, keys) > s = source(code) tests/test_inline_snapshot.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:125: in run changes += snapshot._changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes yield from self._value._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes yield from self._new_value[key]._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes new_code = self._file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '5 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_f21/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- [0, 1] input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |s = snapshot({"k_0": 4, "k_1": [3+2]}) |print(5 <= s["k_0"]) # fix 4 -> 5 |print(5 in s["k_1"]) # update [3+2] -> [5] False True _____________ test_generic_multi[executing-update(<=) create(>=)] ______________ source = .w at 0x7f6a3f8c9a80> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx=>, request==)]>>) ops = (operation(value='5', op='<=', svalue='3+2', fvalue='5', flag='update'), operation(value='5', op='>=', svalue='', fvalue='5', flag='create')) executing_used = True @pytest.mark.parametrize( "ops", [ pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) for ops in itertools.combinations(operations, 2) ], ) def test_generic_multi(source, subtests, ops, executing_used): def gen_code(ops, fixed, old_keys): keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] new_keys = [] args = [] print(keys) for k in keys: op = ops[k] value = op.fvalue if op.flag in fixed else op.svalue if value: args.append(f'"k_{k}": {value}') new_keys.append(k) args = ", ".join(args) code = "s = snapshot({" + args + "})\n" for k, op in enumerate(ops): code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' return code, new_keys all_flags = {op.flag for op in ops} keys = [] code, keys = gen_code(ops, {}, keys) > s = source(code) tests/test_inline_snapshot.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:125: in run changes += snapshot._changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes yield from self._value._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes yield from self._new_value[key]._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes new_code = self._file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '5 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_u12/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- [0, 1] input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |s = snapshot({"k_0": 3+2}) |print(5 <= s["k_0"]) # update 3+2 -> 5 |print(5 >= s["k_1"]) # create -> 5 True True ______________ test_generic_multi[executing-update(<=) trim(>=)] _______________ source = .w at 0x7f6a3ec177e0> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx=>, request==)]>>) ops = (operation(value='5', op='<=', svalue='3+2', fvalue='5', flag='update'), operation(value='5', op='>=', svalue='4', fvalue='5', flag='trim')) executing_used = True @pytest.mark.parametrize( "ops", [ pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) for ops in itertools.combinations(operations, 2) ], ) def test_generic_multi(source, subtests, ops, executing_used): def gen_code(ops, fixed, old_keys): keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] new_keys = [] args = [] print(keys) for k in keys: op = ops[k] value = op.fvalue if op.flag in fixed else op.svalue if value: args.append(f'"k_{k}": {value}') new_keys.append(k) args = ", ".join(args) code = "s = snapshot({" + args + "})\n" for k, op in enumerate(ops): code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' return code, new_keys all_flags = {op.flag for op in ops} keys = [] code, keys = gen_code(ops, {}, keys) > s = source(code) tests/test_inline_snapshot.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:125: in run changes += snapshot._changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes yield from self._value._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes yield from self._new_value[key]._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes new_code = self._file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '5 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_u13/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- [0, 1] input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |s = snapshot({"k_0": 3+2, "k_1": 4}) |print(5 <= s["k_0"]) # update 3+2 -> 5 |print(5 >= s["k_1"]) # trim 4 -> 5 True True _______________ test_generic_multi[executing-update(<=) fix(>=)] _______________ source = .w at 0x7f6a3f8c94e0> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx=>, request==)]>>) ops = (operation(value='5', op='<=', svalue='3+2', fvalue='5', flag='update'), operation(value='4', op='>=', svalue='5', fvalue='4', flag='fix')) executing_used = True @pytest.mark.parametrize( "ops", [ pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) for ops in itertools.combinations(operations, 2) ], ) def test_generic_multi(source, subtests, ops, executing_used): def gen_code(ops, fixed, old_keys): keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] new_keys = [] args = [] print(keys) for k in keys: op = ops[k] value = op.fvalue if op.flag in fixed else op.svalue if value: args.append(f'"k_{k}": {value}') new_keys.append(k) args = ", ".join(args) code = "s = snapshot({" + args + "})\n" for k, op in enumerate(ops): code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' return code, new_keys all_flags = {op.flag for op in ops} keys = [] code, keys = gen_code(ops, {}, keys) > s = source(code) tests/test_inline_snapshot.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:125: in run changes += snapshot._changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes yield from self._value._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes yield from self._new_value[key]._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes new_code = self._file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '5 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_u14/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- [0, 1] input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |s = snapshot({"k_0": 3+2, "k_1": 5}) |print(5 <= s["k_0"]) # update 3+2 -> 5 |print(4 >= s["k_1"]) # fix 5 -> 4 True False _____________ test_generic_multi[executing-update(<=) update(>=)] ______________ source = .w at 0x7f6a3f8cab60> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx=>, request==)]>>) ops = (operation(value='5', op='<=', svalue='3+2', fvalue='5', flag='update'), operation(value='5', op='>=', svalue='3+2', fvalue='5', flag='update')) executing_used = True @pytest.mark.parametrize( "ops", [ pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) for ops in itertools.combinations(operations, 2) ], ) def test_generic_multi(source, subtests, ops, executing_used): def gen_code(ops, fixed, old_keys): keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] new_keys = [] args = [] print(keys) for k in keys: op = ops[k] value = op.fvalue if op.flag in fixed else op.svalue if value: args.append(f'"k_{k}": {value}') new_keys.append(k) args = ", ".join(args) code = "s = snapshot({" + args + "})\n" for k, op in enumerate(ops): code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' return code, new_keys all_flags = {op.flag for op in ops} keys = [] code, keys = gen_code(ops, {}, keys) > s = source(code) tests/test_inline_snapshot.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:125: in run changes += snapshot._changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes yield from self._value._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes yield from self._new_value[key]._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes new_code = self._file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '5 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_u15/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- [0, 1] input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |s = snapshot({"k_0": 3+2, "k_1": 3+2}) |print(5 <= s["k_0"]) # update 3+2 -> 5 |print(5 >= s["k_1"]) # update 3+2 -> 5 True True _____________ test_generic_multi[executing-update(<=) create(in)] ______________ source = .w at 0x7f6a3ec15ee0> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx=>, request=>) ops = (operation(value='5', op='<=', svalue='3+2', fvalue='5', flag='update'), operation(value='5', op='in', svalue='', fvalue='[5]', flag='create')) executing_used = True @pytest.mark.parametrize( "ops", [ pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) for ops in itertools.combinations(operations, 2) ], ) def test_generic_multi(source, subtests, ops, executing_used): def gen_code(ops, fixed, old_keys): keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] new_keys = [] args = [] print(keys) for k in keys: op = ops[k] value = op.fvalue if op.flag in fixed else op.svalue if value: args.append(f'"k_{k}": {value}') new_keys.append(k) args = ", ".join(args) code = "s = snapshot({" + args + "})\n" for k, op in enumerate(ops): code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' return code, new_keys all_flags = {op.flag for op in ops} keys = [] code, keys = gen_code(ops, {}, keys) > s = source(code) tests/test_inline_snapshot.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:125: in run changes += snapshot._changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes yield from self._value._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes yield from self._new_value[key]._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes new_code = self._file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '5 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_u16/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- [0, 1] input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |s = snapshot({"k_0": 3+2}) |print(5 <= s["k_0"]) # update 3+2 -> 5 |print(5 in s["k_1"]) # create -> [5] True True ______________ test_generic_multi[executing-update(<=) trim(in)] _______________ source = .w at 0x7f6a3f8caac0> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx=>, request=>) ops = (operation(value='5', op='<=', svalue='3+2', fvalue='5', flag='update'), operation(value='5', op='in', svalue='[4, 5]', fvalue='[5]', flag='trim')) executing_used = True @pytest.mark.parametrize( "ops", [ pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) for ops in itertools.combinations(operations, 2) ], ) def test_generic_multi(source, subtests, ops, executing_used): def gen_code(ops, fixed, old_keys): keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] new_keys = [] args = [] print(keys) for k in keys: op = ops[k] value = op.fvalue if op.flag in fixed else op.svalue if value: args.append(f'"k_{k}": {value}') new_keys.append(k) args = ", ".join(args) code = "s = snapshot({" + args + "})\n" for k, op in enumerate(ops): code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' return code, new_keys all_flags = {op.flag for op in ops} keys = [] code, keys = gen_code(ops, {}, keys) > s = source(code) tests/test_inline_snapshot.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:125: in run changes += snapshot._changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes yield from self._value._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes yield from self._new_value[key]._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes new_code = self._file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '5 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_u17/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- [0, 1] input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |s = snapshot({"k_0": 3+2, "k_1": [4, 5]}) |print(5 <= s["k_0"]) # update 3+2 -> 5 |print(5 in s["k_1"]) # trim [4, 5] -> [5] True True _______________ test_generic_multi[executing-update(<=) fix(in)] _______________ source = .w at 0x7f6a3f8cbba0> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx=>, request=>) ops = (operation(value='5', op='<=', svalue='3+2', fvalue='5', flag='update'), operation(value='5', op='in', svalue='[]', fvalue='[5]', flag='fix')) executing_used = True @pytest.mark.parametrize( "ops", [ pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) for ops in itertools.combinations(operations, 2) ], ) def test_generic_multi(source, subtests, ops, executing_used): def gen_code(ops, fixed, old_keys): keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] new_keys = [] args = [] print(keys) for k in keys: op = ops[k] value = op.fvalue if op.flag in fixed else op.svalue if value: args.append(f'"k_{k}": {value}') new_keys.append(k) args = ", ".join(args) code = "s = snapshot({" + args + "})\n" for k, op in enumerate(ops): code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' return code, new_keys all_flags = {op.flag for op in ops} keys = [] code, keys = gen_code(ops, {}, keys) > s = source(code) tests/test_inline_snapshot.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:125: in run changes += snapshot._changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes yield from self._value._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes yield from self._new_value[key]._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes new_code = self._file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '5 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_u18/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- [0, 1] input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |s = snapshot({"k_0": 3+2, "k_1": []}) |print(5 <= s["k_0"]) # update 3+2 -> 5 |print(5 in s["k_1"]) # fix [] -> [5] True False _____________ test_generic_multi[executing-update(<=) update(in)] ______________ source = .w at 0x7f6a3ee8c040> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx=>, request=>) ops = (operation(value='5', op='<=', svalue='3+2', fvalue='5', flag='update'), operation(value='5', op='in', svalue='[3+2]', fvalue='[5]', flag='update')) executing_used = True @pytest.mark.parametrize( "ops", [ pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) for ops in itertools.combinations(operations, 2) ], ) def test_generic_multi(source, subtests, ops, executing_used): def gen_code(ops, fixed, old_keys): keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] new_keys = [] args = [] print(keys) for k in keys: op = ops[k] value = op.fvalue if op.flag in fixed else op.svalue if value: args.append(f'"k_{k}": {value}') new_keys.append(k) args = ", ".join(args) code = "s = snapshot({" + args + "})\n" for k, op in enumerate(ops): code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' return code, new_keys all_flags = {op.flag for op in ops} keys = [] code, keys = gen_code(ops, {}, keys) > s = source(code) tests/test_inline_snapshot.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:125: in run changes += snapshot._changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes yield from self._value._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes yield from self._new_value[key]._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes new_code = self._file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '5 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_u19/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- [0, 1] input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |s = snapshot({"k_0": 3+2, "k_1": [3+2]}) |print(5 <= s["k_0"]) # update 3+2 -> 5 |print(5 in s["k_1"]) # update [3+2] -> [5] True True ______________ test_generic_multi[executing-create(>=) trim(>=)] _______________ source = .w at 0x7f6a3ee8d4e0> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx=>, request==) trim(>=)]>>) ops = (operation(value='5', op='>=', svalue='', fvalue='5', flag='create'), operation(value='5', op='>=', svalue='4', fvalue='5', flag='trim')) executing_used = True @pytest.mark.parametrize( "ops", [ pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) for ops in itertools.combinations(operations, 2) ], ) def test_generic_multi(source, subtests, ops, executing_used): def gen_code(ops, fixed, old_keys): keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] new_keys = [] args = [] print(keys) for k in keys: op = ops[k] value = op.fvalue if op.flag in fixed else op.svalue if value: args.append(f'"k_{k}": {value}') new_keys.append(k) args = ", ".join(args) code = "s = snapshot({" + args + "})\n" for k, op in enumerate(ops): code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' return code, new_keys all_flags = {op.flag for op in ops} keys = [] code, keys = gen_code(ops, {}, keys) > s = source(code) tests/test_inline_snapshot.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:125: in run changes += snapshot._changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes yield from self._value._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes yield from self._new_value[key]._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes new_code = self._file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '5 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_c25/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- [0, 1] input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |s = snapshot({"k_1": 4}) |print(5 >= s["k_0"]) # create -> 5 |print(5 >= s["k_1"]) # trim 4 -> 5 True True _______________ test_generic_multi[executing-create(>=) fix(>=)] _______________ source = .w at 0x7f6a3ec179c0> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx=>, request==) fix(>=)]>>) ops = (operation(value='5', op='>=', svalue='', fvalue='5', flag='create'), operation(value='4', op='>=', svalue='5', fvalue='4', flag='fix')) executing_used = True @pytest.mark.parametrize( "ops", [ pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) for ops in itertools.combinations(operations, 2) ], ) def test_generic_multi(source, subtests, ops, executing_used): def gen_code(ops, fixed, old_keys): keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] new_keys = [] args = [] print(keys) for k in keys: op = ops[k] value = op.fvalue if op.flag in fixed else op.svalue if value: args.append(f'"k_{k}": {value}') new_keys.append(k) args = ", ".join(args) code = "s = snapshot({" + args + "})\n" for k, op in enumerate(ops): code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' return code, new_keys all_flags = {op.flag for op in ops} keys = [] code, keys = gen_code(ops, {}, keys) > s = source(code) tests/test_inline_snapshot.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:125: in run changes += snapshot._changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes yield from self._value._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes yield from self._new_value[key]._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes new_code = self._file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_c26/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- [0, 1] input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |s = snapshot({"k_1": 5}) |print(5 >= s["k_0"]) # create -> 5 |print(4 >= s["k_1"]) # fix 5 -> 4 True False _____________ test_generic_multi[executing-create(>=) update(>=)] ______________ source = .w at 0x7f6a3ef482c0> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx=>, request==) update(>=)]>>) ops = (operation(value='5', op='>=', svalue='', fvalue='5', flag='create'), operation(value='5', op='>=', svalue='3+2', fvalue='5', flag='update')) executing_used = True @pytest.mark.parametrize( "ops", [ pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) for ops in itertools.combinations(operations, 2) ], ) def test_generic_multi(source, subtests, ops, executing_used): def gen_code(ops, fixed, old_keys): keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] new_keys = [] args = [] print(keys) for k in keys: op = ops[k] value = op.fvalue if op.flag in fixed else op.svalue if value: args.append(f'"k_{k}": {value}') new_keys.append(k) args = ", ".join(args) code = "s = snapshot({" + args + "})\n" for k, op in enumerate(ops): code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' return code, new_keys all_flags = {op.flag for op in ops} keys = [] code, keys = gen_code(ops, {}, keys) > s = source(code) tests/test_inline_snapshot.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:125: in run changes += snapshot._changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes yield from self._value._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes yield from self._new_value[key]._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes new_code = self._file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '5 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_c27/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- [0, 1] input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |s = snapshot({"k_1": 3+2}) |print(5 >= s["k_0"]) # create -> 5 |print(5 >= s["k_1"]) # update 3+2 -> 5 True True _____________ test_generic_multi[executing-create(>=) create(in)] ______________ source = .w at 0x7f6a3ee8ec00> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx=>, request==) create(in)]>>) ops = (operation(value='5', op='>=', svalue='', fvalue='5', flag='create'), operation(value='5', op='in', svalue='', fvalue='[5]', flag='create')) executing_used = True @pytest.mark.parametrize( "ops", [ pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) for ops in itertools.combinations(operations, 2) ], ) def test_generic_multi(source, subtests, ops, executing_used): def gen_code(ops, fixed, old_keys): keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] new_keys = [] args = [] print(keys) for k in keys: op = ops[k] value = op.fvalue if op.flag in fixed else op.svalue if value: args.append(f'"k_{k}": {value}') new_keys.append(k) args = ", ".join(args) code = "s = snapshot({" + args + "})\n" for k, op in enumerate(ops): code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' return code, new_keys all_flags = {op.flag for op in ops} keys = [] code, keys = gen_code(ops, {}, keys) > s = source(code) tests/test_inline_snapshot.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:125: in run changes += snapshot._changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes yield from self._value._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:534: in _get_changes to_insert.append((key, new_value_element._new_code())) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:321: in _new_code return self._file._value_to_code(self._new_value) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code return self._token_to_code(value_to_token(value)) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '5 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_c28/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- [0, 1] input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |s = snapshot({}) |print(5 >= s["k_0"]) # create -> 5 |print(5 in s["k_1"]) # create -> [5] True True ______________ test_generic_multi[executing-create(>=) trim(in)] _______________ source = .w at 0x7f6a3ec162a0> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx=>, request==) trim(in)]>>) ops = (operation(value='5', op='>=', svalue='', fvalue='5', flag='create'), operation(value='5', op='in', svalue='[4, 5]', fvalue='[5]', flag='trim')) executing_used = True @pytest.mark.parametrize( "ops", [ pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) for ops in itertools.combinations(operations, 2) ], ) def test_generic_multi(source, subtests, ops, executing_used): def gen_code(ops, fixed, old_keys): keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] new_keys = [] args = [] print(keys) for k in keys: op = ops[k] value = op.fvalue if op.flag in fixed else op.svalue if value: args.append(f'"k_{k}": {value}') new_keys.append(k) args = ", ".join(args) code = "s = snapshot({" + args + "})\n" for k, op in enumerate(ops): code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' return code, new_keys all_flags = {op.flag for op in ops} keys = [] code, keys = gen_code(ops, {}, keys) > s = source(code) tests/test_inline_snapshot.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:125: in run changes += snapshot._changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes yield from self._value._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:534: in _get_changes to_insert.append((key, new_value_element._new_code())) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:321: in _new_code return self._file._value_to_code(self._new_value) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code return self._token_to_code(value_to_token(value)) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '5 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_c29/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- [0, 1] input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |s = snapshot({"k_1": [4, 5]}) |print(5 >= s["k_0"]) # create -> 5 |print(5 in s["k_1"]) # trim [4, 5] -> [5] True True _______________ test_generic_multi[executing-create(>=) fix(in)] _______________ source = .w at 0x7f6a3ec16e80> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx=>, request==) fix(in)]>>) ops = (operation(value='5', op='>=', svalue='', fvalue='5', flag='create'), operation(value='5', op='in', svalue='[]', fvalue='[5]', flag='fix')) executing_used = True @pytest.mark.parametrize( "ops", [ pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) for ops in itertools.combinations(operations, 2) ], ) def test_generic_multi(source, subtests, ops, executing_used): def gen_code(ops, fixed, old_keys): keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] new_keys = [] args = [] print(keys) for k in keys: op = ops[k] value = op.fvalue if op.flag in fixed else op.svalue if value: args.append(f'"k_{k}": {value}') new_keys.append(k) args = ", ".join(args) code = "s = snapshot({" + args + "})\n" for k, op in enumerate(ops): code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' return code, new_keys all_flags = {op.flag for op in ops} keys = [] code, keys = gen_code(ops, {}, keys) > s = source(code) tests/test_inline_snapshot.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:125: in run changes += snapshot._changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes yield from self._value._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes yield from self._new_value[key]._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:456: in _get_changes new_code=[self._file._value_to_code(v) for v in new_values], /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code return self._token_to_code(value_to_token(value)) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '5 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_c30/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- [0, 1] input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |s = snapshot({"k_1": []}) |print(5 >= s["k_0"]) # create -> 5 |print(5 in s["k_1"]) # fix [] -> [5] True False _____________ test_generic_multi[executing-create(>=) update(in)] ______________ source = .w at 0x7f6a3ee8ec00> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx=>, request==) update(in)]>>) ops = (operation(value='5', op='>=', svalue='', fvalue='5', flag='create'), operation(value='5', op='in', svalue='[3+2]', fvalue='[5]', flag='update')) executing_used = True @pytest.mark.parametrize( "ops", [ pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) for ops in itertools.combinations(operations, 2) ], ) def test_generic_multi(source, subtests, ops, executing_used): def gen_code(ops, fixed, old_keys): keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] new_keys = [] args = [] print(keys) for k in keys: op = ops[k] value = op.fvalue if op.flag in fixed else op.svalue if value: args.append(f'"k_{k}": {value}') new_keys.append(k) args = ", ".join(args) code = "s = snapshot({" + args + "})\n" for k, op in enumerate(ops): code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' return code, new_keys all_flags = {op.flag for op in ops} keys = [] code, keys = gen_code(ops, {}, keys) > s = source(code) tests/test_inline_snapshot.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:125: in run changes += snapshot._changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes yield from self._value._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes yield from self._new_value[key]._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:438: in _get_changes new_code = self._file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '5 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_c31/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- [0, 1] input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |s = snapshot({"k_1": [3+2]}) |print(5 >= s["k_0"]) # create -> 5 |print(5 in s["k_1"]) # update [3+2] -> [5] True True ________________ test_generic_multi[executing-trim(>=) fix(>=)] ________________ source = .w at 0x7f6a3edc8040> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx=>, request==) fix(>=)]>>) ops = (operation(value='5', op='>=', svalue='4', fvalue='5', flag='trim'), operation(value='4', op='>=', svalue='5', fvalue='4', flag='fix')) executing_used = True @pytest.mark.parametrize( "ops", [ pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) for ops in itertools.combinations(operations, 2) ], ) def test_generic_multi(source, subtests, ops, executing_used): def gen_code(ops, fixed, old_keys): keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] new_keys = [] args = [] print(keys) for k in keys: op = ops[k] value = op.fvalue if op.flag in fixed else op.svalue if value: args.append(f'"k_{k}": {value}') new_keys.append(k) args = ", ".join(args) code = "s = snapshot({" + args + "})\n" for k, op in enumerate(ops): code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' return code, new_keys all_flags = {op.flag for op in ops} keys = [] code, keys = gen_code(ops, {}, keys) > s = source(code) tests/test_inline_snapshot.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:125: in run changes += snapshot._changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes yield from self._value._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes yield from self._new_value[key]._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes new_code = self._file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '5 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_t10/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- [0, 1] input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |s = snapshot({"k_0": 4, "k_1": 5}) |print(5 >= s["k_0"]) # trim 4 -> 5 |print(4 >= s["k_1"]) # fix 5 -> 4 True False ______________ test_generic_multi[executing-trim(>=) update(>=)] _______________ source = .w at 0x7f6a3edc8900> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx=>, request==) update(>=)]>>) ops = (operation(value='5', op='>=', svalue='4', fvalue='5', flag='trim'), operation(value='5', op='>=', svalue='3+2', fvalue='5', flag='update')) executing_used = True @pytest.mark.parametrize( "ops", [ pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) for ops in itertools.combinations(operations, 2) ], ) def test_generic_multi(source, subtests, ops, executing_used): def gen_code(ops, fixed, old_keys): keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] new_keys = [] args = [] print(keys) for k in keys: op = ops[k] value = op.fvalue if op.flag in fixed else op.svalue if value: args.append(f'"k_{k}": {value}') new_keys.append(k) args = ", ".join(args) code = "s = snapshot({" + args + "})\n" for k, op in enumerate(ops): code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' return code, new_keys all_flags = {op.flag for op in ops} keys = [] code, keys = gen_code(ops, {}, keys) > s = source(code) tests/test_inline_snapshot.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:125: in run changes += snapshot._changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes yield from self._value._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes yield from self._new_value[key]._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes new_code = self._file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '5 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_t11/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- [0, 1] input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |s = snapshot({"k_0": 4, "k_1": 3+2}) |print(5 >= s["k_0"]) # trim 4 -> 5 |print(5 >= s["k_1"]) # update 3+2 -> 5 True True ______________ test_generic_multi[executing-trim(>=) create(in)] _______________ source = .w at 0x7f6a3ec16ca0> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx=>, request==) create(in)]>>) ops = (operation(value='5', op='>=', svalue='4', fvalue='5', flag='trim'), operation(value='5', op='in', svalue='', fvalue='[5]', flag='create')) executing_used = True @pytest.mark.parametrize( "ops", [ pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) for ops in itertools.combinations(operations, 2) ], ) def test_generic_multi(source, subtests, ops, executing_used): def gen_code(ops, fixed, old_keys): keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] new_keys = [] args = [] print(keys) for k in keys: op = ops[k] value = op.fvalue if op.flag in fixed else op.svalue if value: args.append(f'"k_{k}": {value}') new_keys.append(k) args = ", ".join(args) code = "s = snapshot({" + args + "})\n" for k, op in enumerate(ops): code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' return code, new_keys all_flags = {op.flag for op in ops} keys = [] code, keys = gen_code(ops, {}, keys) > s = source(code) tests/test_inline_snapshot.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:125: in run changes += snapshot._changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes yield from self._value._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes yield from self._new_value[key]._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes new_code = self._file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '5 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_t12/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- [0, 1] input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |s = snapshot({"k_0": 4}) |print(5 >= s["k_0"]) # trim 4 -> 5 |print(5 in s["k_1"]) # create -> [5] True True _______________ test_generic_multi[executing-trim(>=) trim(in)] ________________ source = .w at 0x7f6a3f8ca2a0> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx=>, request==) trim(in)]>>) ops = (operation(value='5', op='>=', svalue='4', fvalue='5', flag='trim'), operation(value='5', op='in', svalue='[4, 5]', fvalue='[5]', flag='trim')) executing_used = True @pytest.mark.parametrize( "ops", [ pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) for ops in itertools.combinations(operations, 2) ], ) def test_generic_multi(source, subtests, ops, executing_used): def gen_code(ops, fixed, old_keys): keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] new_keys = [] args = [] print(keys) for k in keys: op = ops[k] value = op.fvalue if op.flag in fixed else op.svalue if value: args.append(f'"k_{k}": {value}') new_keys.append(k) args = ", ".join(args) code = "s = snapshot({" + args + "})\n" for k, op in enumerate(ops): code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' return code, new_keys all_flags = {op.flag for op in ops} keys = [] code, keys = gen_code(ops, {}, keys) > s = source(code) tests/test_inline_snapshot.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:125: in run changes += snapshot._changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes yield from self._value._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes yield from self._new_value[key]._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes new_code = self._file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '5 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_t13/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- [0, 1] input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |s = snapshot({"k_0": 4, "k_1": [4, 5]}) |print(5 >= s["k_0"]) # trim 4 -> 5 |print(5 in s["k_1"]) # trim [4, 5] -> [5] True True ________________ test_generic_multi[executing-trim(>=) fix(in)] ________________ source = .w at 0x7f6a3ee8ec00> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx=>, request==) fix(in)]>>) ops = (operation(value='5', op='>=', svalue='4', fvalue='5', flag='trim'), operation(value='5', op='in', svalue='[]', fvalue='[5]', flag='fix')) executing_used = True @pytest.mark.parametrize( "ops", [ pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) for ops in itertools.combinations(operations, 2) ], ) def test_generic_multi(source, subtests, ops, executing_used): def gen_code(ops, fixed, old_keys): keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] new_keys = [] args = [] print(keys) for k in keys: op = ops[k] value = op.fvalue if op.flag in fixed else op.svalue if value: args.append(f'"k_{k}": {value}') new_keys.append(k) args = ", ".join(args) code = "s = snapshot({" + args + "})\n" for k, op in enumerate(ops): code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' return code, new_keys all_flags = {op.flag for op in ops} keys = [] code, keys = gen_code(ops, {}, keys) > s = source(code) tests/test_inline_snapshot.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:125: in run changes += snapshot._changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes yield from self._value._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes yield from self._new_value[key]._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes new_code = self._file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '5 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_t14/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- [0, 1] input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |s = snapshot({"k_0": 4, "k_1": []}) |print(5 >= s["k_0"]) # trim 4 -> 5 |print(5 in s["k_1"]) # fix [] -> [5] True False ______________ test_generic_multi[executing-trim(>=) update(in)] _______________ source = .w at 0x7f6a3f8c93a0> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx=>, request==) update(in)]>>) ops = (operation(value='5', op='>=', svalue='4', fvalue='5', flag='trim'), operation(value='5', op='in', svalue='[3+2]', fvalue='[5]', flag='update')) executing_used = True @pytest.mark.parametrize( "ops", [ pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) for ops in itertools.combinations(operations, 2) ], ) def test_generic_multi(source, subtests, ops, executing_used): def gen_code(ops, fixed, old_keys): keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] new_keys = [] args = [] print(keys) for k in keys: op = ops[k] value = op.fvalue if op.flag in fixed else op.svalue if value: args.append(f'"k_{k}": {value}') new_keys.append(k) args = ", ".join(args) code = "s = snapshot({" + args + "})\n" for k, op in enumerate(ops): code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' return code, new_keys all_flags = {op.flag for op in ops} keys = [] code, keys = gen_code(ops, {}, keys) > s = source(code) tests/test_inline_snapshot.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:125: in run changes += snapshot._changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes yield from self._value._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes yield from self._new_value[key]._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes new_code = self._file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '5 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_t15/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- [0, 1] input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |s = snapshot({"k_0": 4, "k_1": [3+2]}) |print(5 >= s["k_0"]) # trim 4 -> 5 |print(5 in s["k_1"]) # update [3+2] -> [5] True True _______________ test_generic_multi[executing-fix(>=) update(>=)] _______________ source = .w at 0x7f6a3f8c9620> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx=>, request==) update(>=)]>>) ops = (operation(value='4', op='>=', svalue='5', fvalue='4', flag='fix'), operation(value='5', op='>=', svalue='3+2', fvalue='5', flag='update')) executing_used = True @pytest.mark.parametrize( "ops", [ pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) for ops in itertools.combinations(operations, 2) ], ) def test_generic_multi(source, subtests, ops, executing_used): def gen_code(ops, fixed, old_keys): keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] new_keys = [] args = [] print(keys) for k in keys: op = ops[k] value = op.fvalue if op.flag in fixed else op.svalue if value: args.append(f'"k_{k}": {value}') new_keys.append(k) args = ", ".join(args) code = "s = snapshot({" + args + "})\n" for k, op in enumerate(ops): code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' return code, new_keys all_flags = {op.flag for op in ops} keys = [] code, keys = gen_code(ops, {}, keys) > s = source(code) tests/test_inline_snapshot.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:125: in run changes += snapshot._changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes yield from self._value._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes yield from self._new_value[key]._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes new_code = self._file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_f22/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- [0, 1] input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |s = snapshot({"k_0": 5, "k_1": 3+2}) |print(4 >= s["k_0"]) # fix 5 -> 4 |print(5 >= s["k_1"]) # update 3+2 -> 5 False True _______________ test_generic_multi[executing-fix(>=) create(in)] _______________ source = .w at 0x7f6a3f8c8220> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx=>, request==) create(in)]>>) ops = (operation(value='4', op='>=', svalue='5', fvalue='4', flag='fix'), operation(value='5', op='in', svalue='', fvalue='[5]', flag='create')) executing_used = True @pytest.mark.parametrize( "ops", [ pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) for ops in itertools.combinations(operations, 2) ], ) def test_generic_multi(source, subtests, ops, executing_used): def gen_code(ops, fixed, old_keys): keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] new_keys = [] args = [] print(keys) for k in keys: op = ops[k] value = op.fvalue if op.flag in fixed else op.svalue if value: args.append(f'"k_{k}": {value}') new_keys.append(k) args = ", ".join(args) code = "s = snapshot({" + args + "})\n" for k, op in enumerate(ops): code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' return code, new_keys all_flags = {op.flag for op in ops} keys = [] code, keys = gen_code(ops, {}, keys) > s = source(code) tests/test_inline_snapshot.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:125: in run changes += snapshot._changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes yield from self._value._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes yield from self._new_value[key]._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes new_code = self._file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_f23/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- [0, 1] input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |s = snapshot({"k_0": 5}) |print(4 >= s["k_0"]) # fix 5 -> 4 |print(5 in s["k_1"]) # create -> [5] False True ________________ test_generic_multi[executing-fix(>=) trim(in)] ________________ source = .w at 0x7f6a3edcb060> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx=>, request==) trim(in)]>>) ops = (operation(value='4', op='>=', svalue='5', fvalue='4', flag='fix'), operation(value='5', op='in', svalue='[4, 5]', fvalue='[5]', flag='trim')) executing_used = True @pytest.mark.parametrize( "ops", [ pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) for ops in itertools.combinations(operations, 2) ], ) def test_generic_multi(source, subtests, ops, executing_used): def gen_code(ops, fixed, old_keys): keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] new_keys = [] args = [] print(keys) for k in keys: op = ops[k] value = op.fvalue if op.flag in fixed else op.svalue if value: args.append(f'"k_{k}": {value}') new_keys.append(k) args = ", ".join(args) code = "s = snapshot({" + args + "})\n" for k, op in enumerate(ops): code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' return code, new_keys all_flags = {op.flag for op in ops} keys = [] code, keys = gen_code(ops, {}, keys) > s = source(code) tests/test_inline_snapshot.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:125: in run changes += snapshot._changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes yield from self._value._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes yield from self._new_value[key]._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes new_code = self._file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_f24/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- [0, 1] input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |s = snapshot({"k_0": 5, "k_1": [4, 5]}) |print(4 >= s["k_0"]) # fix 5 -> 4 |print(5 in s["k_1"]) # trim [4, 5] -> [5] False True ________________ test_generic_multi[executing-fix(>=) fix(in)] _________________ source = .w at 0x7f6a3ead4c20> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx=>, request==) fix(in)]>>) ops = (operation(value='4', op='>=', svalue='5', fvalue='4', flag='fix'), operation(value='5', op='in', svalue='[]', fvalue='[5]', flag='fix')) executing_used = True @pytest.mark.parametrize( "ops", [ pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) for ops in itertools.combinations(operations, 2) ], ) def test_generic_multi(source, subtests, ops, executing_used): def gen_code(ops, fixed, old_keys): keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] new_keys = [] args = [] print(keys) for k in keys: op = ops[k] value = op.fvalue if op.flag in fixed else op.svalue if value: args.append(f'"k_{k}": {value}') new_keys.append(k) args = ", ".join(args) code = "s = snapshot({" + args + "})\n" for k, op in enumerate(ops): code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' return code, new_keys all_flags = {op.flag for op in ops} keys = [] code, keys = gen_code(ops, {}, keys) > s = source(code) tests/test_inline_snapshot.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:125: in run changes += snapshot._changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes yield from self._value._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes yield from self._new_value[key]._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes new_code = self._file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_f25/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- [0, 1] input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |s = snapshot({"k_0": 5, "k_1": []}) |print(4 >= s["k_0"]) # fix 5 -> 4 |print(5 in s["k_1"]) # fix [] -> [5] False False _______________ test_generic_multi[executing-fix(>=) update(in)] _______________ source = .w at 0x7f6a3ee8d620> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx=>, request==) update(in)]>>) ops = (operation(value='4', op='>=', svalue='5', fvalue='4', flag='fix'), operation(value='5', op='in', svalue='[3+2]', fvalue='[5]', flag='update')) executing_used = True @pytest.mark.parametrize( "ops", [ pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) for ops in itertools.combinations(operations, 2) ], ) def test_generic_multi(source, subtests, ops, executing_used): def gen_code(ops, fixed, old_keys): keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] new_keys = [] args = [] print(keys) for k in keys: op = ops[k] value = op.fvalue if op.flag in fixed else op.svalue if value: args.append(f'"k_{k}": {value}') new_keys.append(k) args = ", ".join(args) code = "s = snapshot({" + args + "})\n" for k, op in enumerate(ops): code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' return code, new_keys all_flags = {op.flag for op in ops} keys = [] code, keys = gen_code(ops, {}, keys) > s = source(code) tests/test_inline_snapshot.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:125: in run changes += snapshot._changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes yield from self._value._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes yield from self._new_value[key]._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes new_code = self._file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_f26/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- [0, 1] input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |s = snapshot({"k_0": 5, "k_1": [3+2]}) |print(4 >= s["k_0"]) # fix 5 -> 4 |print(5 in s["k_1"]) # update [3+2] -> [5] False True _____________ test_generic_multi[executing-update(>=) create(in)] ______________ source = .w at 0x7f6a3ead5580> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx=>, request==) create(in)]>>) ops = (operation(value='5', op='>=', svalue='3+2', fvalue='5', flag='update'), operation(value='5', op='in', svalue='', fvalue='[5]', flag='create')) executing_used = True @pytest.mark.parametrize( "ops", [ pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) for ops in itertools.combinations(operations, 2) ], ) def test_generic_multi(source, subtests, ops, executing_used): def gen_code(ops, fixed, old_keys): keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] new_keys = [] args = [] print(keys) for k in keys: op = ops[k] value = op.fvalue if op.flag in fixed else op.svalue if value: args.append(f'"k_{k}": {value}') new_keys.append(k) args = ", ".join(args) code = "s = snapshot({" + args + "})\n" for k, op in enumerate(ops): code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' return code, new_keys all_flags = {op.flag for op in ops} keys = [] code, keys = gen_code(ops, {}, keys) > s = source(code) tests/test_inline_snapshot.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:125: in run changes += snapshot._changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes yield from self._value._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes yield from self._new_value[key]._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes new_code = self._file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '5 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_u20/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- [0, 1] input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |s = snapshot({"k_0": 3+2}) |print(5 >= s["k_0"]) # update 3+2 -> 5 |print(5 in s["k_1"]) # create -> [5] True True ______________ test_generic_multi[executing-update(>=) trim(in)] _______________ source = .w at 0x7f6a3ead5c60> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx=>, request==) trim(in)]>>) ops = (operation(value='5', op='>=', svalue='3+2', fvalue='5', flag='update'), operation(value='5', op='in', svalue='[4, 5]', fvalue='[5]', flag='trim')) executing_used = True @pytest.mark.parametrize( "ops", [ pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) for ops in itertools.combinations(operations, 2) ], ) def test_generic_multi(source, subtests, ops, executing_used): def gen_code(ops, fixed, old_keys): keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] new_keys = [] args = [] print(keys) for k in keys: op = ops[k] value = op.fvalue if op.flag in fixed else op.svalue if value: args.append(f'"k_{k}": {value}') new_keys.append(k) args = ", ".join(args) code = "s = snapshot({" + args + "})\n" for k, op in enumerate(ops): code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' return code, new_keys all_flags = {op.flag for op in ops} keys = [] code, keys = gen_code(ops, {}, keys) > s = source(code) tests/test_inline_snapshot.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:125: in run changes += snapshot._changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes yield from self._value._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes yield from self._new_value[key]._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes new_code = self._file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '5 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_u21/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- [0, 1] input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |s = snapshot({"k_0": 3+2, "k_1": [4, 5]}) |print(5 >= s["k_0"]) # update 3+2 -> 5 |print(5 in s["k_1"]) # trim [4, 5] -> [5] True True _______________ test_generic_multi[executing-update(>=) fix(in)] _______________ source = .w at 0x7f6a3ec14cc0> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx=>, request==) fix(in)]>>) ops = (operation(value='5', op='>=', svalue='3+2', fvalue='5', flag='update'), operation(value='5', op='in', svalue='[]', fvalue='[5]', flag='fix')) executing_used = True @pytest.mark.parametrize( "ops", [ pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) for ops in itertools.combinations(operations, 2) ], ) def test_generic_multi(source, subtests, ops, executing_used): def gen_code(ops, fixed, old_keys): keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] new_keys = [] args = [] print(keys) for k in keys: op = ops[k] value = op.fvalue if op.flag in fixed else op.svalue if value: args.append(f'"k_{k}": {value}') new_keys.append(k) args = ", ".join(args) code = "s = snapshot({" + args + "})\n" for k, op in enumerate(ops): code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' return code, new_keys all_flags = {op.flag for op in ops} keys = [] code, keys = gen_code(ops, {}, keys) > s = source(code) tests/test_inline_snapshot.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:125: in run changes += snapshot._changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes yield from self._value._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes yield from self._new_value[key]._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes new_code = self._file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '5 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_u22/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- [0, 1] input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |s = snapshot({"k_0": 3+2, "k_1": []}) |print(5 >= s["k_0"]) # update 3+2 -> 5 |print(5 in s["k_1"]) # fix [] -> [5] True False _____________ test_generic_multi[executing-update(>=) update(in)] ______________ source = .w at 0x7f6a3ead49a0> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx=>, request==) update(in)]>>) ops = (operation(value='5', op='>=', svalue='3+2', fvalue='5', flag='update'), operation(value='5', op='in', svalue='[3+2]', fvalue='[5]', flag='update')) executing_used = True @pytest.mark.parametrize( "ops", [ pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) for ops in itertools.combinations(operations, 2) ], ) def test_generic_multi(source, subtests, ops, executing_used): def gen_code(ops, fixed, old_keys): keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] new_keys = [] args = [] print(keys) for k in keys: op = ops[k] value = op.fvalue if op.flag in fixed else op.svalue if value: args.append(f'"k_{k}": {value}') new_keys.append(k) args = ", ".join(args) code = "s = snapshot({" + args + "})\n" for k, op in enumerate(ops): code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' return code, new_keys all_flags = {op.flag for op in ops} keys = [] code, keys = gen_code(ops, {}, keys) > s = source(code) tests/test_inline_snapshot.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:125: in run changes += snapshot._changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes yield from self._value._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes yield from self._new_value[key]._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:337: in _get_changes new_code = self._file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '5 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_u23/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- [0, 1] input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |s = snapshot({"k_0": 3+2, "k_1": [3+2]}) |print(5 >= s["k_0"]) # update 3+2 -> 5 |print(5 in s["k_1"]) # update [3+2] -> [5] True True ______________ test_generic_multi[executing-create(in) trim(in)] _______________ source = .w at 0x7f6a3ead6c00> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx=>, request=>) ops = (operation(value='5', op='in', svalue='', fvalue='[5]', flag='create'), operation(value='5', op='in', svalue='[4, 5]', fvalue='[5]', flag='trim')) executing_used = True @pytest.mark.parametrize( "ops", [ pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) for ops in itertools.combinations(operations, 2) ], ) def test_generic_multi(source, subtests, ops, executing_used): def gen_code(ops, fixed, old_keys): keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] new_keys = [] args = [] print(keys) for k in keys: op = ops[k] value = op.fvalue if op.flag in fixed else op.svalue if value: args.append(f'"k_{k}": {value}') new_keys.append(k) args = ", ".join(args) code = "s = snapshot({" + args + "})\n" for k, op in enumerate(ops): code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' return code, new_keys all_flags = {op.flag for op in ops} keys = [] code, keys = gen_code(ops, {}, keys) > s = source(code) tests/test_inline_snapshot.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:125: in run changes += snapshot._changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes yield from self._value._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:534: in _get_changes to_insert.append((key, new_value_element._new_code())) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:411: in _new_code return self._file._value_to_code(self._new_value) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code return self._token_to_code(value_to_token(value)) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '[5 ]' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_c32/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- [0, 1] input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |s = snapshot({"k_1": [4, 5]}) |print(5 in s["k_0"]) # create -> [5] |print(5 in s["k_1"]) # trim [4, 5] -> [5] True True _______________ test_generic_multi[executing-create(in) fix(in)] _______________ source = .w at 0x7f6a3f8cb7e0> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx=>, request=>) ops = (operation(value='5', op='in', svalue='', fvalue='[5]', flag='create'), operation(value='5', op='in', svalue='[]', fvalue='[5]', flag='fix')) executing_used = True @pytest.mark.parametrize( "ops", [ pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) for ops in itertools.combinations(operations, 2) ], ) def test_generic_multi(source, subtests, ops, executing_used): def gen_code(ops, fixed, old_keys): keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] new_keys = [] args = [] print(keys) for k in keys: op = ops[k] value = op.fvalue if op.flag in fixed else op.svalue if value: args.append(f'"k_{k}": {value}') new_keys.append(k) args = ", ".join(args) code = "s = snapshot({" + args + "})\n" for k, op in enumerate(ops): code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' return code, new_keys all_flags = {op.flag for op in ops} keys = [] code, keys = gen_code(ops, {}, keys) > s = source(code) tests/test_inline_snapshot.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:125: in run changes += snapshot._changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes yield from self._value._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes yield from self._new_value[key]._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:456: in _get_changes new_code=[self._file._value_to_code(v) for v in new_values], /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code return self._token_to_code(value_to_token(value)) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '5 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_c33/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- [0, 1] input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |s = snapshot({"k_1": []}) |print(5 in s["k_0"]) # create -> [5] |print(5 in s["k_1"]) # fix [] -> [5] True False _____________ test_generic_multi[executing-create(in) update(in)] ______________ source = .w at 0x7f6a3ead6980> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx=>, request=>) ops = (operation(value='5', op='in', svalue='', fvalue='[5]', flag='create'), operation(value='5', op='in', svalue='[3+2]', fvalue='[5]', flag='update')) executing_used = True @pytest.mark.parametrize( "ops", [ pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) for ops in itertools.combinations(operations, 2) ], ) def test_generic_multi(source, subtests, ops, executing_used): def gen_code(ops, fixed, old_keys): keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] new_keys = [] args = [] print(keys) for k in keys: op = ops[k] value = op.fvalue if op.flag in fixed else op.svalue if value: args.append(f'"k_{k}": {value}') new_keys.append(k) args = ", ".join(args) code = "s = snapshot({" + args + "})\n" for k, op in enumerate(ops): code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' return code, new_keys all_flags = {op.flag for op in ops} keys = [] code, keys = gen_code(ops, {}, keys) > s = source(code) tests/test_inline_snapshot.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:125: in run changes += snapshot._changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes yield from self._value._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes yield from self._new_value[key]._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:438: in _get_changes new_code = self._file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '5 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_c34/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- [0, 1] input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |s = snapshot({"k_1": [3+2]}) |print(5 in s["k_0"]) # create -> [5] |print(5 in s["k_1"]) # update [3+2] -> [5] True True ________________ test_generic_multi[executing-trim(in) fix(in)] ________________ source = .w at 0x7f6a3ead7d80> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx=>, request=>) ops = (operation(value='5', op='in', svalue='[4, 5]', fvalue='[5]', flag='trim'), operation(value='5', op='in', svalue='[]', fvalue='[5]', flag='fix')) executing_used = True @pytest.mark.parametrize( "ops", [ pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) for ops in itertools.combinations(operations, 2) ], ) def test_generic_multi(source, subtests, ops, executing_used): def gen_code(ops, fixed, old_keys): keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] new_keys = [] args = [] print(keys) for k in keys: op = ops[k] value = op.fvalue if op.flag in fixed else op.svalue if value: args.append(f'"k_{k}": {value}') new_keys.append(k) args = ", ".join(args) code = "s = snapshot({" + args + "})\n" for k, op in enumerate(ops): code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' return code, new_keys all_flags = {op.flag for op in ops} keys = [] code, keys = gen_code(ops, {}, keys) > s = source(code) tests/test_inline_snapshot.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:125: in run changes += snapshot._changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes yield from self._value._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes yield from self._new_value[key]._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:456: in _get_changes new_code=[self._file._value_to_code(v) for v in new_values], /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code return self._token_to_code(value_to_token(value)) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '5 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_t16/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- [0, 1] input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |s = snapshot({"k_0": [4, 5], "k_1": []}) |print(5 in s["k_0"]) # trim [4, 5] -> [5] |print(5 in s["k_1"]) # fix [] -> [5] True False ______________ test_generic_multi[executing-trim(in) update(in)] _______________ source = .w at 0x7f6a3f8caf20> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx=>, request=>) 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')) executing_used = True @pytest.mark.parametrize( "ops", [ pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) for ops in itertools.combinations(operations, 2) ], ) def test_generic_multi(source, subtests, ops, executing_used): def gen_code(ops, fixed, old_keys): keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] new_keys = [] args = [] print(keys) for k in keys: op = ops[k] value = op.fvalue if op.flag in fixed else op.svalue if value: args.append(f'"k_{k}": {value}') new_keys.append(k) args = ", ".join(args) code = "s = snapshot({" + args + "})\n" for k, op in enumerate(ops): code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' return code, new_keys all_flags = {op.flag for op in ops} keys = [] code, keys = gen_code(ops, {}, keys) > s = source(code) tests/test_inline_snapshot.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:125: in run changes += snapshot._changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes yield from self._value._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes yield from self._new_value[key]._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:438: in _get_changes new_code = self._file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '5 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_t17/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- [0, 1] input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |s = snapshot({"k_0": [4, 5], "k_1": [3+2]}) |print(5 in s["k_0"]) # trim [4, 5] -> [5] |print(5 in s["k_1"]) # update [3+2] -> [5] True True _______________ test_generic_multi[executing-fix(in) update(in)] _______________ source = .w at 0x7f6a3ead7880> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx=>, request=>) ops = (operation(value='5', op='in', svalue='[]', fvalue='[5]', flag='fix'), operation(value='5', op='in', svalue='[3+2]', fvalue='[5]', flag='update')) executing_used = True @pytest.mark.parametrize( "ops", [ pytest.param(ops, id=" ".join(f"{op.flag}({op.op})" for op in ops)) for ops in itertools.combinations(operations, 2) ], ) def test_generic_multi(source, subtests, ops, executing_used): def gen_code(ops, fixed, old_keys): keys = old_keys + [k for k in range(len(ops)) if k not in old_keys] new_keys = [] args = [] print(keys) for k in keys: op = ops[k] value = op.fvalue if op.flag in fixed else op.svalue if value: args.append(f'"k_{k}": {value}') new_keys.append(k) args = ", ".join(args) code = "s = snapshot({" + args + "})\n" for k, op in enumerate(ops): code += f'print({op.value} {op.op} s["k_{k}"]) # {op.flag} {op.svalue or ""} -> {op.fvalue}\n' return code, new_keys all_flags = {op.flag for op in ops} keys = [] code, keys = gen_code(ops, {}, keys) > s = source(code) tests/test_inline_snapshot.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:125: in run changes += snapshot._changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes yield from self._value._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:523: in _get_changes yield from self._new_value[key]._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:456: in _get_changes new_code=[self._file._value_to_code(v) for v in new_values], /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code return self._token_to_code(value_to_token(value)) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '5 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic_multi_executing_f27/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- [0, 1] input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |s = snapshot({"k_0": [], "k_1": [3+2]}) |print(5 in s["k_0"]) # fix [] -> [5] |print(5 in s["k_1"]) # update [3+2] -> [5] False True _____________________________ test_mutable_values ______________________________ check_update = .w at 0x7f6a3ea50040> def test_mutable_values(check_update): assert ( > check_update( """ l=[1,2] assert l==snapshot() l.append(3) assert l==snapshot() """, flags="create", number=2, ) == snapshot( """\ l=[1,2] assert l==snapshot([1, 2]) l.append(3) assert l==snapshot([1, 2, 3]) """ ) ) tests/test_inline_snapshot.py:168: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:49: in w s = source(source_code) tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_mutable_values0/test_1.py:11: in assert l==snapshot() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_mutable_values0/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | | |l=[1,2] |assert l==snapshot() |l.append(3) |assert l==snapshot() _______________________________ test_comparison ________________________________ check_update = .w at 0x7f6a3ea53a60> def test_comparison(check_update): > assert check_update("assert 5==snapshot()", flags="create") == snapshot( "assert 5==snapshot(5)" ) tests/test_inline_snapshot.py:257: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:49: in w s = source(source_code) tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_comparison0/test_1.py:9: in assert 5==snapshot() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_comparison0/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert 5==snapshot() ___________________________________ test_ge ____________________________________ check_update = .w at 0x7f6a3ea50040> def test_ge(check_update): > assert check_update("assert 5<=snapshot()", flags="create") == snapshot( "assert 5<=snapshot(5)" ) tests/test_inline_snapshot.py:309: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:49: in w s = source(source_code) tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:125: in run changes += snapshot._changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:657: in _changes new_code = self._value._new_code() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:321: in _new_code return self._file._value_to_code(self._new_value) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code return self._token_to_code(value_to_token(value)) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '5 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_ge0/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert 5<=snapshot() ___________________________________ test_le ____________________________________ check_update = .w at 0x7f6a3ea50860> def test_le(check_update): > assert check_update("assert 5>=snapshot()", flags="create") == snapshot( "assert 5>=snapshot(5)" ) tests/test_inline_snapshot.py:381: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:49: in w s = source(source_code) tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:125: in run changes += snapshot._changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:657: in _changes new_code = self._value._new_code() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:321: in _new_code return self._file._value_to_code(self._new_value) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code return self._token_to_code(value_to_token(value)) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '5 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_le0/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert 5>=snapshot() ________________________________ test_contains _________________________________ check_update = .w at 0x7f6a3f8cad40> def test_contains(check_update): > assert check_update("assert 5 in snapshot()", flags="create") == snapshot( "assert 5 in snapshot([5])" ) tests/test_inline_snapshot.py:449: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:49: in w s = source(source_code) tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:125: in run changes += snapshot._changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:657: in _changes new_code = self._value._new_code() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:411: in _new_code return self._file._value_to_code(self._new_value) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code return self._token_to_code(value_to_token(value)) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '[5 ]' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_contains0/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert 5 in snapshot() _________________________________ test_getitem _________________________________ check_update = .w at 0x7f6a3ea50860> def test_getitem(check_update): > assert check_update('assert 5 == snapshot()["test"]', flags="create") == snapshot( 'assert 5 == snapshot({"test": 5})["test"]' ) tests/test_inline_snapshot.py:492: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:49: in w s = source(source_code) tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_getitem0/test_1.py:9: in assert 5 == snapshot()["test"] /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_getitem0/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert 5 == snapshot()["test"] _________________________________ test_assert __________________________________ check_update = .w at 0x7f6a3ea51ee0> def test_assert(check_update): > assert check_update("assert 2 == snapshot(5)", reported_flags="fix") tests/test_inline_snapshot.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:49: in w s = source(source_code) tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_assert0/test_1.py:9: in assert 2 == snapshot(5) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '2 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_assert0/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert 2 == snapshot(5) _______________________________ test_format_file _______________________________ check_update = .w at 0x7f6a3ead5260> def test_format_file(check_update): > assert check_update( 'assert ["aaaaaaaaaaaaaaaaa"] * 5 == snapshot()\n', flags="create" ) == snapshot( """\ assert ["aaaaaaaaaaaaaaaaa"] * 5 == snapshot([ "aaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaa", ]) """ ) tests/test_inline_snapshot.py:588: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:49: in w s = source(source_code) tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_format_file0/test_1.py:9: in assert ["aaaaaaaaaaaaaaaaa"] * 5 == snapshot() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_format_file0/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert ["aaaaaaaaaaaaaaaaa"] * 5 == snapshot() ______________________________ test_format_value _______________________________ check_update = .w at 0x7f6a3ea52160> def test_format_value(check_update): > assert check_update( 'assert ["aaaaaaaaaaaaaaaaa"] * 5== snapshot()\n', flags="create" ) == snapshot( """\ assert ["aaaaaaaaaaaaaaaaa"] * 5== snapshot([ "aaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaa", ]) """ ) tests/test_inline_snapshot.py:604: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:49: in w s = source(source_code) tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_format_value0/test_1.py:9: in assert ["aaaaaaaaaaaaaaaaa"] * 5== snapshot() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_format_value0/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert ["aaaaaaaaaaaaaaaaa"] * 5== snapshot() _______________________________ test_type_error ________________________________ check_update = .w at 0x7f6a3ead6c00> def test_type_error(check_update): tests = ["5 == s", "5 <= s", "5 >= s", "5 in s", "5 == s[0]"] for test1, test2 in itertools.product(tests, tests): with pytest.raises(TypeError) if test1 != test2 else nullcontext() as error: > check_update( f""" s = snapshot() assert {test1} assert {test2} """, reported_flags="create", ) tests/test_inline_snapshot.py:631: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:49: in w s = source(source_code) tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_type_error0/test_1.py:11: in assert 5 == s /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_type_error0/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | | |s = snapshot() |assert 5 == s |assert 5 == s _________________________ test_different_snapshot_name _________________________ check_update = .w at 0x7f6a3ea52160> def test_different_snapshot_name(check_update): assert ( > check_update( """\ from inline_snapshot import snapshot as s assert 4==s() """, flags="create", ) == snapshot( """\ from inline_snapshot import snapshot as s assert 4==s(4) """ ) ) tests/test_inline_snapshot.py:695: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:49: in w s = source(source_code) tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_different_snapshot_name0/test_1.py:10: in assert 4==s() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_different_snapshot_name0/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |from inline_snapshot import snapshot as s |assert 4==s() | _______________________ test_quoting_change_is_no_update _______________________ source = .w at 0x7f6a3f8cbf60> def test_quoting_change_is_no_update(source): > s = source( """\ from inline_snapshot import external,snapshot class X: def __init__(self,a): self.a=a pass def __repr__(self): return f'X("{self.a}")' def __eq__(self,other): if not hasattr(other,"a"): return NotImplemented return other.a==self.a assert X("a") == snapshot() """ ) tests/test_inline_snapshot.py:731: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_quoting_change_is_no_upda0/test_1.py:24: in assert X("a") == snapshot() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_quoting_change_is_no_upda0/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |from inline_snapshot import external,snapshot | |class X: | def __init__(self,a): | self.a=a | pass | | def __repr__(self): | return f'X("{self.a}")' | | def __eq__(self,other): | if not hasattr(other,"a"): | return NotImplemented | return other.a==self.a | |assert X("a") == snapshot() _____________________________ test_trailing_comma ______________________________ project = .Project object at 0x7f6a3e93f710> def test_trailing_comma(project): project.setup( """\ from inline_snapshot import external, snapshot class X: def __init__(self, *args): self.args = args def __repr__(self): return f"X({', '.join(map(repr,self.args))})" def __eq__(self,other): if not isinstance(other,X): return NotImplemented return self.args == other.args def test_thing(): assert X("a" * 40, "a" * 40) == snapshot() """ ) > project.format() /tmp/autopkgtest.ImMzGl/autopkgtest_tmp/tests/test_inline_snapshot.py:805: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /tmp/autopkgtest.ImMzGl/autopkgtest_tmp/tests/conftest.py:315: in format format_code(self._filename.read_text("utf-8"), self._filename), "utf-8" _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 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' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_trailing_comma0/test_file.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- write code: # äöß 🐍 from inline_snapshot import snapshot from inline_snapshot import outsource from inline_snapshot import external, snapshot class X: def __init__(self, *args): self.args = args def __repr__(self): return f"X({', '.join(map(repr,self.args))})" def __eq__(self,other): if not isinstance(other,X): return NotImplemented return self.args == other.args def test_thing(): assert X("a" * 40, "a" * 40) == snapshot() ___________________________________ test_is ____________________________________ def test_is(): Example( """ from inline_snapshot import snapshot,Is def test_Is(): for i in range(3): assert ["hello",i] == snapshot(["hi",Is(i)]) assert ["hello",i] == snapshot({1:["hi",Is(i)]})[i] """ > ).run_inline( ["--inline-snapshot=create"], changed_files=snapshot( { "test_something.py": """\ from inline_snapshot import snapshot,Is def test_Is(): for i in range(3): assert ["hello",i] == snapshot(["hi",Is(i)]) assert ["hello",i] == snapshot({1:["hi",Is(i)], 0: ["hello", 0], 2: ["hello", 2]})[i] """ } ), ).run_inline( ["--inline-snapshot=fix"], changed_files=snapshot( { "test_something.py": """\ from inline_snapshot import snapshot,Is def test_Is(): for i in range(3): assert ["hello",i] == snapshot(["hello",Is(i)]) assert ["hello",i] == snapshot({1:["hello",Is(i)], 0: ["hello", 0], 2: ["hello", 2]})[i] """ } ), ) tests/test_inline_snapshot.py:912: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = args = ['--inline-snapshot=create'] def run_inline( self, args: list[str] = [], *, reported_categories: Snapshot[list[Category]] | None = None, changed_files: Snapshot[dict[str, str]] | None = None, report: Snapshot[str] | None = None, raises: Snapshot[str] | None = None, ) -> Example: """Execute the example files in process and run every `test_*` function. This is useful for fast test execution. Parameters: args: inline-snapshot arguments (supports only "--inline-snapshot=fix|create|..." ). reported_categories: snapshot of categories which inline-snapshot thinks could be applied. changed_files: snapshot of files which are changed by this run. raises: snapshot of the exception which is raised during the test execution. It is required if your code raises an exception. Returns: A new Example instance which contains the changed files. """ parser = ArgumentParser() parser.add_argument( "--inline-snapshot", metavar="(disable,short-report,report,review,create,update,trim,fix)*", dest="inline_snapshot", help="update specific snapshot values:\n" "disable: disable the snapshot logic\n" "short-report: show a short report\n" "report: show a longer report with a diff report\n" "review: allow to approve the changes interactive\n" "create: creates snapshots which are currently not defined\n" "update: update snapshots even if they are defined\n" "trim: changes the snapshot in a way which will make the snapshot more precise.\n" "fix: change snapshots which currently break your tests\n", ) parsed_args = parser.parse_args(args) flags = (parsed_args.inline_snapshot or "").split(",") with TemporaryDirectory() as dir: tmp_path = Path(dir) self._write_files(tmp_path) raised_exception = None with snapshot_env(): with ChangeRecorder().activate() as recorder: _inline_snapshot._update_flags = Flags({*flags}) inline_snapshot._external.storage = ( inline_snapshot._external.DiscStorage(tmp_path / ".storage") ) try: for filename in tmp_path.glob("*.py"): globals: dict[str, Any] = {} print("run> pytest", filename) exec( compile(filename.read_text("utf-8"), filename, "exec"), globals, ) # run all test_* functions for k, v in globals.items(): if k.startswith("test_") and callable(v): v() except Exception as e: traceback.print_exc() raised_exception = e finally: _inline_snapshot._active = False changes = [] for snapshot in _inline_snapshot.snapshots.values(): changes += snapshot._changes() snapshot_flags = {change.flag for change in changes} apply_all( [ change for change in changes if change.flag in _inline_snapshot._update_flags.to_set() ] ) recorder.fix_all() report_output = StringIO() console = Console(file=report_output) # TODO: add all the report output here report_problems(console) if reported_categories is not None: assert sorted(snapshot_flags) == reported_categories if raised_exception is not None: > assert raises == f"{type(raised_exception).__name__}:\n" + str( raised_exception ) E assert None == ('TypeError:\n' + "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'") E + where "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'" = str(TypeError("CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'")) /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: AssertionError ----------------------------- Captured stdout call ----------------------------- file: test_something.py from inline_snapshot import snapshot,Is def test_Is(): for i in range(3): assert ["hello",i] == snapshot(["hi",Is(i)]) assert ["hello",i] == snapshot({1:["hi",Is(i)]})[i] run> pytest /tmp/tmpync6w1te/test_something.py ----------------------------- Captured stderr call ----------------------------- Traceback (most recent call last): File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 193, in run_inline v() File "/tmp/tmpync6w1te/test_something.py", line 6, in test_Is assert ["hello",i] == snapshot(["hi",Is(i)]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ return self == other ^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ self._changes.append(next(it)) ^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py", line 79, in assign v = yield from self.get_adapter( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign new_code = self.context.file._token_to_code(new_token) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format return format_code(text, Path(self._source.filename)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code runner = CliRunner(mix_stderr=False) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' _______________________________ test_missing_is ________________________________ def test_missing_is(): Example( """\ from inline_snapshot import snapshot def test_is(): for i in (1,2): assert i == snapshot(i) """ > ).run_inline( raises=snapshot( """\ UsageError: snapshot value should not change. Use Is(...) for dynamic snapshot parts.\ """ ) ) tests/test_is.py:15: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: in run_inline assert raises == f"{type(raised_exception).__name__}:\n" + str( /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '"""\\\nTypeError:\nCliRunner.__init__() got an unexpected keyword argument \'mix_stderr\'\\\n"""' filename = PosixPath('/tmp/autopkgtest.ImMzGl/autopkgtest_tmp/tests/test_is.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- file: test_something.py from inline_snapshot import snapshot def test_is(): for i in (1,2): assert i == snapshot(i) run> pytest /tmp/tmpk9cqb19i/test_something.py ----------------------------- Captured stderr call ----------------------------- Traceback (most recent call last): File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 193, in run_inline v() File "/tmp/tmpk9cqb19i/test_something.py", line 5, in test_is assert i == snapshot(i) ^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ return self == other ^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ self._changes.append(next(it)) ^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign new_code = self.context.file._token_to_code(new_token) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format return format_code(text, Path(self._source.filename)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code runner = CliRunner(mix_stderr=False) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' __________________________________ test_repr ___________________________________ def test_repr(): Example( """\ from inline_snapshot import snapshot from tests._is_normalized import IsNormalized def test_a(): n=IsNormalized(sorted,snapshot()) assert [3,5,2] == n assert repr(n)==snapshot() """ > ).run_inline( ["--inline-snapshot=create"], changed_files=snapshot( { "test_something.py": """\ from inline_snapshot import snapshot from tests._is_normalized import IsNormalized def test_a(): n=IsNormalized(sorted,snapshot([2, 3, 5])) assert [3,5,2] == n assert repr(n)==snapshot("IsNormalized([2, 3, 5], should_be=[2, 3, 5])") """ } ), ) tests/test_is_normalized.py:16: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = args = ['--inline-snapshot=create'] def run_inline( self, args: list[str] = [], *, reported_categories: Snapshot[list[Category]] | None = None, changed_files: Snapshot[dict[str, str]] | None = None, report: Snapshot[str] | None = None, raises: Snapshot[str] | None = None, ) -> Example: """Execute the example files in process and run every `test_*` function. This is useful for fast test execution. Parameters: args: inline-snapshot arguments (supports only "--inline-snapshot=fix|create|..." ). reported_categories: snapshot of categories which inline-snapshot thinks could be applied. changed_files: snapshot of files which are changed by this run. raises: snapshot of the exception which is raised during the test execution. It is required if your code raises an exception. Returns: A new Example instance which contains the changed files. """ parser = ArgumentParser() parser.add_argument( "--inline-snapshot", metavar="(disable,short-report,report,review,create,update,trim,fix)*", dest="inline_snapshot", help="update specific snapshot values:\n" "disable: disable the snapshot logic\n" "short-report: show a short report\n" "report: show a longer report with a diff report\n" "review: allow to approve the changes interactive\n" "create: creates snapshots which are currently not defined\n" "update: update snapshots even if they are defined\n" "trim: changes the snapshot in a way which will make the snapshot more precise.\n" "fix: change snapshots which currently break your tests\n", ) parsed_args = parser.parse_args(args) flags = (parsed_args.inline_snapshot or "").split(",") with TemporaryDirectory() as dir: tmp_path = Path(dir) self._write_files(tmp_path) raised_exception = None with snapshot_env(): with ChangeRecorder().activate() as recorder: _inline_snapshot._update_flags = Flags({*flags}) inline_snapshot._external.storage = ( inline_snapshot._external.DiscStorage(tmp_path / ".storage") ) try: for filename in tmp_path.glob("*.py"): globals: dict[str, Any] = {} print("run> pytest", filename) exec( compile(filename.read_text("utf-8"), filename, "exec"), globals, ) # run all test_* functions for k, v in globals.items(): if k.startswith("test_") and callable(v): v() except Exception as e: traceback.print_exc() raised_exception = e finally: _inline_snapshot._active = False changes = [] for snapshot in _inline_snapshot.snapshots.values(): changes += snapshot._changes() snapshot_flags = {change.flag for change in changes} apply_all( [ change for change in changes if change.flag in _inline_snapshot._update_flags.to_set() ] ) recorder.fix_all() report_output = StringIO() console = Console(file=report_output) # TODO: add all the report output here report_problems(console) if reported_categories is not None: assert sorted(snapshot_flags) == reported_categories if raised_exception is not None: > assert raises == f"{type(raised_exception).__name__}:\n" + str( raised_exception ) E assert None == ('TypeError:\n' + "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'") E + where "CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'" = str(TypeError("CliRunner.__init__() got an unexpected keyword argument 'mix_stderr'")) /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:226: AssertionError ----------------------------- Captured stdout call ----------------------------- file: test_something.py from inline_snapshot import snapshot from tests._is_normalized import IsNormalized def test_a(): n=IsNormalized(sorted,snapshot()) assert [3,5,2] == n assert repr(n)==snapshot() run> pytest /tmp/tmpda7d7yr5/test_something.py ----------------------------- Captured stderr call ----------------------------- Traceback (most recent call last): File "/usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py", line 193, in run_inline v() File "/tmp/tmpda7d7yr5/test_something.py", line 6, in test_a assert [3,5,2] == n ^^^^^^^^^^^^ File "/tmp/autopkgtest.ImMzGl/autopkgtest_tmp/tests/_is_normalized.py", line 13, in __eq__ return self._last_value == self._value ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 224, in __eq__ return self == other ^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py", line 275, in __eq__ self._changes.append(next(it)) ^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py", line 60, in assign new_code = self.context.file._token_to_code(new_token) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 34, in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_source_file.py", line 28, in _format return format_code(text, Path(self._source.filename)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code runner = CliRunner(mix_stderr=False) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' ______________________________ test_fix_list_fix _______________________________ check_update = .w at 0x7f6a3eaf1260> def test_fix_list_fix(check_update): > assert check_update( """assert [1,2]==snapshot([0+1,3])""", reported_flags="update,fix", flags="fix" ) == snapshot("assert [1,2]==snapshot([0+1,2])") tests/test_preserve_values.py:9: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:49: in w s = source(source_code) tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_fix_list_fix0/test_1.py:9: in assert [1,2]==snapshot([0+1,3]) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign v = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '1 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_fix_list_fix0/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert [1,2]==snapshot([0+1,3]) _____________________________ test_fix_list_insert _____________________________ check_update = .w at 0x7f6a3eaf1ee0> def test_fix_list_insert(check_update): > assert check_update( """assert [1,2,3,4,5,6]==snapshot([0+1,3])""", reported_flags="update,fix", flags="fix", ) == snapshot("assert [1,2,3,4,5,6]==snapshot([0+1, 2, 3, 4, 5, 6])") tests/test_preserve_values.py:15: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:49: in w s = source(source_code) tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_fix_list_insert0/test_1.py:9: in assert [1,2,3,4,5,6]==snapshot([0+1,3]) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign v = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '1 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_fix_list_insert0/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert [1,2,3,4,5,6]==snapshot([0+1,3]) _____________________________ test_fix_list_delete _____________________________ check_update = .w at 0x7f6a3eaf1260> def test_fix_list_delete(check_update): > assert check_update( """assert [1,5]==snapshot([0+1,2,3,4,5])""", reported_flags="update,fix", flags="fix", ) == snapshot("assert [1,5]==snapshot([0+1, 5])") tests/test_preserve_values.py:23: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:49: in w s = source(source_code) tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_fix_list_delete0/test_1.py:9: in assert [1,5]==snapshot([0+1,2,3,4,5]) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign v = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '1 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_fix_list_delete0/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert [1,5]==snapshot([0+1,2,3,4,5]) ____________________________ test_fix_tuple_delete _____________________________ check_update = .w at 0x7f6a3eaf2660> def test_fix_tuple_delete(check_update): > assert check_update( """assert (1,5)==snapshot((0+1,2,3,4,5))""", reported_flags="update,fix", flags="fix", ) == snapshot("assert (1,5)==snapshot((0+1, 5))") tests/test_preserve_values.py:31: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:49: in w s = source(source_code) tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_fix_tuple_delete0/test_1.py:9: in assert (1,5)==snapshot((0+1,2,3,4,5)) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign v = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '1 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_fix_tuple_delete0/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert (1,5)==snapshot((0+1,2,3,4,5)) _____________________________ test_fix_dict_change _____________________________ check_update = .w at 0x7f6a3eaf31a0> def test_fix_dict_change(check_update): > assert check_update( """assert {1:1, 2:2}==snapshot({1:0+1, 2:3})""", reported_flags="update,fix", flags="fix", ) == snapshot("assert {1:1, 2:2}==snapshot({1:0+1, 2:2})") tests/test_preserve_values.py:39: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:49: in w s = source(source_code) tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_fix_dict_change0/test_1.py:9: in assert {1:1, 2:2}==snapshot({1:0+1, 2:3}) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign result[key] = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '1 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_fix_dict_change0/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert {1:1, 2:2}==snapshot({1:0+1, 2:3}) _____________________________ test_fix_dict_remove _____________________________ check_update = .w at 0x7f6a3eaf2e80> def test_fix_dict_remove(check_update): > assert check_update( """assert {1:1}==snapshot({0:0, 1:0+1, 2:2})""", reported_flags="update,fix", flags="fix", ) == snapshot("assert {1:1}==snapshot({1:0+1})") tests/test_preserve_values.py:47: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:49: in w s = source(source_code) tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_fix_dict_remove0/test_1.py:9: in assert {1:1}==snapshot({0:0, 1:0+1, 2:2}) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign result[key] = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '1 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_fix_dict_remove0/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert {1:1}==snapshot({0:0, 1:0+1, 2:2}) _____________________________ test_fix_dict_insert _____________________________ check_update = .w at 0x7f6a3eaf31a0> def test_fix_dict_insert(check_update): > assert check_update( """assert {0:"before",1:1,2:"after"}==snapshot({1:0+1})""", reported_flags="update,fix", flags="fix", ) == snapshot( 'assert {0:"before",1:1,2:"after"}==snapshot({0: "before", 1:0+1, 2: "after"})' ) tests/test_preserve_values.py:61: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:49: in w s = source(source_code) tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_fix_dict_insert0/test_1.py:9: in assert {0:"before",1:1,2:"after"}==snapshot({1:0+1}) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign result[key] = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '1 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_fix_dict_insert0/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert {0:"before",1:1,2:"after"}==snapshot({1:0+1}) _____________________ test_fix_dict_with_non_literal_keys ______________________ check_update = .w at 0x7f6a3eaf3f60> def test_fix_dict_with_non_literal_keys(check_update): > assert check_update( """assert {1+2:"3"}==snapshot({1+2:"5"})""", reported_flags="fix", flags="fix", ) == snapshot('assert {1+2:"3"}==snapshot({1+2:"3"})') tests/test_preserve_values.py:71: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:49: in w s = source(source_code) tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_fix_dict_with_non_literal0/test_1.py:9: in assert {1+2:"3"}==snapshot({1+2:"5"}) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign result[key] = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = "'3'" filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_fix_dict_with_non_literal0/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert {1+2:"3"}==snapshot({1+2:"5"}) _______________________ test_no_update_for_dirty_equals ________________________ check_update = .w at 0x7f6a3ebb4a40> @pytest.mark.skipif( sys.version_info < (3, 8), reason="dirty equals has dropped the 3.7 support" ) def test_no_update_for_dirty_equals(check_update): assert ( > check_update( """\ from dirty_equals import IsInt assert {5:5,2:2}==snapshot({5:IsInt(),2:1+1}) """, reported_flags="update", flags="update", ) == snapshot( """\ from dirty_equals import IsInt assert {5:5,2:2}==snapshot({5:IsInt(),2:2}) """ ) ) tests/test_preserve_values.py:83: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:49: in w s = source(source_code) tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_no_update_for_dirty_equal0/test_1.py:10: in assert {5:5,2:2}==snapshot({5:IsInt(),2:1+1}) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign result[key] = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '2 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_no_update_for_dirty_equal0/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |from dirty_equals import IsInt |assert {5:5,2:2}==snapshot({5:IsInt(),2:1+1}) _____________________ test_preserve_case_from_original_mr ______________________ check_update = .w at 0x7f6a3eaf2840> def test_preserve_case_from_original_mr(check_update): assert ( > check_update( """\ left = { "a": 1, "b": { "c": 2, "d": [ 3, 4, 5, ], }, "e": ( { "f": 6, "g": 7, }, ), } assert left == snapshot( { "a": 10, "b": { "c": 2 * 1 + 0, "d": [ int(3), 40, 5, ], "h": 8, }, "e": ( { "f": 3 + 3, }, 9, ), } ) """, reported_flags="update,fix", flags="fix", ) == snapshot( """\ left = { "a": 1, "b": { "c": 2, "d": [ 3, 4, 5, ], }, "e": ( { "f": 6, "g": 7, }, ), } assert left == snapshot( { "a": 1, "b": { "c": 2 * 1 + 0, "d": [ int(3), 4, 5, ]}, "e": ({"f": 6, "g": 7},), } ) """ ) ) tests/test_preserve_values.py:103: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:49: in w s = source(source_code) tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_preserve_case_from_origin0/test_1.py:26: in assert left == snapshot( /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign result[key] = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '1 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_preserve_case_from_origin0/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |left = { | "a": 1, | "b": { | "c": 2, | "d": [ | 3, | 4, | 5, | ], | }, | "e": ( | { | "f": 6, | "g": 7, | }, | ), |} |assert left == snapshot( | { | "a": 10, | "b": { | "c": 2 * 1 + 0, | "d": [ | int(3), | 40, | 5, | ], | "h": 8, | }, | "e": ( | { | "f": 3 + 3, | }, | 9, | ), | } |) _____________________ test_generic [[5, 5, 5] -> [] ] _____________________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): s1 = source(code) print("source:", code) assert set(s1.flags) == flags assert ("fix" in flags) == s1.error for f in all_flags: c3 = build( [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] ) new_code = f"assert {c2}==snapshot({c3})" print(f"{set(f)}:") print(" ", code) print(" ", new_code) > s2 = s1.run(*f) tests/test_preserve_values.py:245: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:137: in run recorder.fix_all() /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all file.rewrite() /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite new_code = self.new_code() /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code format_whole_file = enforce_formatting() or code == format_code( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 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])' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_3.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert []==snapshot([5, 5, 5]) reported_flags: {'fix'} run: pytest --inline-snapshot= output: |assert []==snapshot([5, 5, 5]) source: assert []==snapshot([5, 5, 5]) set(): assert []==snapshot([5, 5, 5]) assert []==snapshot([5, 5, 5]) input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert []==snapshot([5, 5, 5]) reported_flags: {'fix'} run: pytest --inline-snapshot= output: |assert []==snapshot([5, 5, 5]) {'fix'}: assert []==snapshot([5, 5, 5]) assert []==snapshot([]) input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert []==snapshot([5, 5, 5]) ----------------------------- Captured stderr call ----------------------------- Traceback (most recent call last): File "/tmp/autopkgtest.ImMzGl/autopkgtest_tmp/tests/conftest.py", line 114, in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) File "/tmp/pytest-of-unshare/pytest-0/test_generic0/test_1.py", line 9, in assert []==snapshot([5, 5, 5]) ^^^^^^^^^^^^^^^^^^^^^^^ AssertionError Traceback (most recent call last): File "/tmp/autopkgtest.ImMzGl/autopkgtest_tmp/tests/conftest.py", line 114, in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) File "/tmp/pytest-of-unshare/pytest-0/test_generic0/test_2.py", line 9, in assert []==snapshot([5, 5, 5]) ^^^^^^^^^^^^^^^^^^^^^^^ AssertionError ------------------------------ Captured log call ------------------------------- ______________________ test_generic [[5, 5] -> [8] ] ______________________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_4.py:9: in assert [8]==snapshot([5, 5]) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign new_code = self.context.file._value_to_code(new_value_element) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code return self._token_to_code(value_to_token(value)) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '8 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_4.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert [8]==snapshot([5, 5]) ------------------------------ Captured log call ------------------------------- _______________ test_generic [[5, 5, 2+2] -> [4] ] ________________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_5.py:9: in assert [4]==snapshot([5, 5, 2+2]) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign v = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_5.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert [4]==snapshot([5, 5, 2+2]) ------------------------------ Captured log call ------------------------------- ____________________ test_generic [[5, 5, 3] -> [3] ] _____________________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): s1 = source(code) print("source:", code) assert set(s1.flags) == flags assert ("fix" in flags) == s1.error for f in all_flags: c3 = build( [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] ) new_code = f"assert {c2}==snapshot({c3})" print(f"{set(f)}:") print(" ", code) print(" ", new_code) > s2 = s1.run(*f) tests/test_preserve_values.py:245: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:137: in run recorder.fix_all() /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all file.rewrite() /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite new_code = self.new_code() /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code format_whole_file = enforce_formatting() or code == format_code( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 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])' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_8.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert [3]==snapshot([5, 5, 3]) reported_flags: {'fix'} run: pytest --inline-snapshot= output: |assert [3]==snapshot([5, 5, 3]) source: assert [3]==snapshot([5, 5, 3]) set(): assert [3]==snapshot([5, 5, 3]) assert [3]==snapshot([5, 5, 3]) input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert [3]==snapshot([5, 5, 3]) reported_flags: {'fix'} run: pytest --inline-snapshot= output: |assert [3]==snapshot([5, 5, 3]) {'fix'}: assert [3]==snapshot([5, 5, 3]) assert [3]==snapshot([3]) input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert [3]==snapshot([5, 5, 3]) ----------------------------- Captured stderr call ----------------------------- Traceback (most recent call last): File "/tmp/autopkgtest.ImMzGl/autopkgtest_tmp/tests/conftest.py", line 114, in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) File "/tmp/pytest-of-unshare/pytest-0/test_generic0/test_6.py", line 9, in assert [3]==snapshot([5, 5, 3]) ^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError Traceback (most recent call last): File "/tmp/autopkgtest.ImMzGl/autopkgtest_tmp/tests/conftest.py", line 114, in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) File "/tmp/pytest-of-unshare/pytest-0/test_generic0/test_7.py", line 9, in assert [3]==snapshot([5, 5, 3]) ^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError ------------------------------ Captured log call ------------------------------- ______________________ test_generic [[5, 5] -> [8] ] ______________________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_9.py:9: in assert [8]==snapshot([5, 5]) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign new_code = self.context.file._value_to_code(new_value_element) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code return self._token_to_code(value_to_token(value)) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '8 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_9.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert [8]==snapshot([5, 5]) ------------------------------ Captured log call ------------------------------- ______________________ test_generic [[5] -> [8, 8] ] ______________________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_10.py:9: in assert [8, 8]==snapshot([5]) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign new_code = self.context.file._value_to_code(new_value_element) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code return self._token_to_code(value_to_token(value)) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '8 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_10.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert [8, 8]==snapshot([5]) ------------------------------ Captured log call ------------------------------- _______________ test_generic [[5, 2+2] -> [8, 4] ] ________________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_11.py:9: in assert [8, 4]==snapshot([5, 2+2]) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign v = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '8 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_11.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert [8, 4]==snapshot([5, 2+2]) ------------------------------ Captured log call ------------------------------- ____________________ test_generic [[5, 3] -> [8, 3] ] _____________________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_12.py:9: in assert [8, 3]==snapshot([5, 3]) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign v = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '8 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_12.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert [8, 3]==snapshot([5, 3]) ------------------------------ Captured log call ------------------------------- _______________ test_generic [[5, 2+2, 5] -> [4] ] ________________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_13.py:9: in assert [4]==snapshot([5, 2+2, 5]) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign v = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_13.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert [4]==snapshot([5, 2+2, 5]) ------------------------------ Captured log call ------------------------------- _______________ test_generic [[5, 2+2] -> [4, 8] ] ________________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_14.py:9: in assert [4, 8]==snapshot([5, 2+2]) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign v = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_14.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert [4, 8]==snapshot([5, 2+2]) ------------------------------ Captured log call ------------------------------- _____________ test_generic [[5, 2+2, 2+2] -> [4, 4] ] _____________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_15.py:9: in assert [4, 4]==snapshot([5, 2+2, 2+2]) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign v = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_15.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert [4, 4]==snapshot([5, 2+2, 2+2]) ------------------------------ Captured log call ------------------------------- ______________ test_generic [[5, 2+2, 3] -> [4, 3] ] ______________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_16.py:9: in assert [4, 3]==snapshot([5, 2+2, 3]) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign v = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_16.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert [4, 3]==snapshot([5, 2+2, 3]) ------------------------------ Captured log call ------------------------------- ____________________ test_generic [[5, 3, 5] -> [3] ] _____________________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): s1 = source(code) print("source:", code) assert set(s1.flags) == flags assert ("fix" in flags) == s1.error for f in all_flags: c3 = build( [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] ) new_code = f"assert {c2}==snapshot({c3})" print(f"{set(f)}:") print(" ", code) print(" ", new_code) > s2 = s1.run(*f) tests/test_preserve_values.py:245: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:137: in run recorder.fix_all() /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all file.rewrite() /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite new_code = self.new_code() /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code format_whole_file = enforce_formatting() or code == format_code( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 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])' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_19.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert [3]==snapshot([5, 3, 5]) reported_flags: {'fix'} run: pytest --inline-snapshot= output: |assert [3]==snapshot([5, 3, 5]) source: assert [3]==snapshot([5, 3, 5]) set(): assert [3]==snapshot([5, 3, 5]) assert [3]==snapshot([5, 3, 5]) input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert [3]==snapshot([5, 3, 5]) reported_flags: {'fix'} run: pytest --inline-snapshot= output: |assert [3]==snapshot([5, 3, 5]) {'fix'}: assert [3]==snapshot([5, 3, 5]) assert [3]==snapshot([3]) input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert [3]==snapshot([5, 3, 5]) ----------------------------- Captured stderr call ----------------------------- Traceback (most recent call last): File "/tmp/autopkgtest.ImMzGl/autopkgtest_tmp/tests/conftest.py", line 114, in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) File "/tmp/pytest-of-unshare/pytest-0/test_generic0/test_17.py", line 9, in assert [3]==snapshot([5, 3, 5]) ^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError Traceback (most recent call last): File "/tmp/autopkgtest.ImMzGl/autopkgtest_tmp/tests/conftest.py", line 114, in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) File "/tmp/pytest-of-unshare/pytest-0/test_generic0/test_18.py", line 9, in assert [3]==snapshot([5, 3, 5]) ^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError ------------------------------ Captured log call ------------------------------- ____________________ test_generic [[5, 3] -> [3, 8] ] _____________________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_20.py:9: in assert [3, 8]==snapshot([5, 3]) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign new_code = self.context.file._value_to_code(new_value_element) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code return self._token_to_code(value_to_token(value)) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '8 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_20.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert [3, 8]==snapshot([5, 3]) ------------------------------ Captured log call ------------------------------- ______________ test_generic [[5, 3, 2+2] -> [3, 4] ] ______________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_21.py:9: in assert [3, 4]==snapshot([5, 3, 2+2]) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign v = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_21.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert [3, 4]==snapshot([5, 3, 2+2]) ------------------------------ Captured log call ------------------------------- ___________________ test_generic [[5, 3, 3] -> [3, 3] ] ___________________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): s1 = source(code) print("source:", code) assert set(s1.flags) == flags assert ("fix" in flags) == s1.error for f in all_flags: c3 = build( [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] ) new_code = f"assert {c2}==snapshot({c3})" print(f"{set(f)}:") print(" ", code) print(" ", new_code) > s2 = s1.run(*f) tests/test_preserve_values.py:245: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:137: in run recorder.fix_all() /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all file.rewrite() /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite new_code = self.new_code() /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code format_whole_file = enforce_formatting() or code == format_code( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 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])' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_24.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert [3, 3]==snapshot([5, 3, 3]) reported_flags: {'fix'} run: pytest --inline-snapshot= output: |assert [3, 3]==snapshot([5, 3, 3]) source: assert [3, 3]==snapshot([5, 3, 3]) set(): assert [3, 3]==snapshot([5, 3, 3]) assert [3, 3]==snapshot([5, 3, 3]) input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert [3, 3]==snapshot([5, 3, 3]) reported_flags: {'fix'} run: pytest --inline-snapshot= output: |assert [3, 3]==snapshot([5, 3, 3]) {'fix'}: assert [3, 3]==snapshot([5, 3, 3]) assert [3, 3]==snapshot([3, 3]) input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert [3, 3]==snapshot([5, 3, 3]) ----------------------------- Captured stderr call ----------------------------- Traceback (most recent call last): File "/tmp/autopkgtest.ImMzGl/autopkgtest_tmp/tests/conftest.py", line 114, in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) File "/tmp/pytest-of-unshare/pytest-0/test_generic0/test_22.py", line 9, in assert [3, 3]==snapshot([5, 3, 3]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError Traceback (most recent call last): File "/tmp/autopkgtest.ImMzGl/autopkgtest_tmp/tests/conftest.py", line 114, in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) File "/tmp/pytest-of-unshare/pytest-0/test_generic0/test_23.py", line 9, in assert [3, 3]==snapshot([5, 3, 3]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError ------------------------------ Captured log call ------------------------------- ______________________ test_generic [[5, 5] -> [8] ] ______________________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_25.py:9: in assert [8]==snapshot([5, 5]) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign new_code = self.context.file._value_to_code(new_value_element) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code return self._token_to_code(value_to_token(value)) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '8 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_25.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert [8]==snapshot([5, 5]) ------------------------------ Captured log call ------------------------------- ______________________ test_generic [[5] -> [8, 8] ] ______________________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_26.py:9: in assert [8, 8]==snapshot([5]) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign new_code = self.context.file._value_to_code(new_value_element) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code return self._token_to_code(value_to_token(value)) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '8 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_26.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert [8, 8]==snapshot([5]) ------------------------------ Captured log call ------------------------------- _______________ test_generic [[5, 2+2] -> [8, 4] ] ________________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_27.py:9: in assert [8, 4]==snapshot([5, 2+2]) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign v = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '8 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_27.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert [8, 4]==snapshot([5, 2+2]) ------------------------------ Captured log call ------------------------------- ____________________ test_generic [[5, 3] -> [8, 3] ] _____________________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_28.py:9: in assert [8, 3]==snapshot([5, 3]) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign v = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '8 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_28.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert [8, 3]==snapshot([5, 3]) ------------------------------ Captured log call ------------------------------- ______________________ test_generic [[5] -> [8, 8] ] ______________________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_29.py:9: in assert [8, 8]==snapshot([5]) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign new_code = self.context.file._value_to_code(new_value_element) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code return self._token_to_code(value_to_token(value)) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '8 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_29.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert [8, 8]==snapshot([5]) ------------------------------ Captured log call ------------------------------- _____________________ test_generic [[] -> [8, 8, 8] ] _____________________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_30.py:9: in assert [8, 8, 8]==snapshot([]) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign new_code = self.context.file._value_to_code(new_value_element) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code return self._token_to_code(value_to_token(value)) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '8 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_30.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert [8, 8, 8]==snapshot([]) ------------------------------ Captured log call ------------------------------- _______________ test_generic [[2+2] -> [8, 8, 4] ] ________________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_31.py:9: in assert [8, 8, 4]==snapshot([2+2]) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign new_code = self.context.file._value_to_code(new_value_element) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code return self._token_to_code(value_to_token(value)) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '8 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_31.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert [8, 8, 4]==snapshot([2+2]) ------------------------------ Captured log call ------------------------------- ____________________ test_generic [[3] -> [8, 8, 3] ] _____________________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_32.py:9: in assert [8, 8, 3]==snapshot([3]) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign new_code = self.context.file._value_to_code(new_value_element) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code return self._token_to_code(value_to_token(value)) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '8 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_32.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert [8, 8, 3]==snapshot([3]) ------------------------------ Captured log call ------------------------------- _______________ test_generic [[2+2, 5] -> [8, 4] ] ________________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_33.py:9: in assert [8, 4]==snapshot([2+2, 5]) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign new_code = self.context.file._value_to_code(new_value_element) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code return self._token_to_code(value_to_token(value)) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '8 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_33.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert [8, 4]==snapshot([2+2, 5]) ------------------------------ Captured log call ------------------------------- _______________ test_generic [[2+2] -> [8, 4, 8] ] ________________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_34.py:9: in assert [8, 4, 8]==snapshot([2+2]) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign new_code = self.context.file._value_to_code(new_value_element) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code return self._token_to_code(value_to_token(value)) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '8 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_34.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert [8, 4, 8]==snapshot([2+2]) ------------------------------ Captured log call ------------------------------- _____________ test_generic [[2+2, 2+2] -> [8, 4, 4] ] _____________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_35.py:9: in assert [8, 4, 4]==snapshot([2+2, 2+2]) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign new_code = self.context.file._value_to_code(new_value_element) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code return self._token_to_code(value_to_token(value)) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '8 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_35.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert [8, 4, 4]==snapshot([2+2, 2+2]) ------------------------------ Captured log call ------------------------------- ______________ test_generic [[2+2, 3] -> [8, 4, 3] ] ______________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_36.py:9: in assert [8, 4, 3]==snapshot([2+2, 3]) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign new_code = self.context.file._value_to_code(new_value_element) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code return self._token_to_code(value_to_token(value)) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '8 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_36.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert [8, 4, 3]==snapshot([2+2, 3]) ------------------------------ Captured log call ------------------------------- ____________________ test_generic [[3, 5] -> [8, 3] ] _____________________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_37.py:9: in assert [8, 3]==snapshot([3, 5]) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign new_code = self.context.file._value_to_code(new_value_element) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code return self._token_to_code(value_to_token(value)) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '8 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_37.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert [8, 3]==snapshot([3, 5]) ------------------------------ Captured log call ------------------------------- ____________________ test_generic [[3] -> [8, 3, 8] ] _____________________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_38.py:9: in assert [8, 3, 8]==snapshot([3]) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign new_code = self.context.file._value_to_code(new_value_element) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code return self._token_to_code(value_to_token(value)) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '8 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_38.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert [8, 3, 8]==snapshot([3]) ------------------------------ Captured log call ------------------------------- ______________ test_generic [[3, 2+2] -> [8, 3, 4] ] ______________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_39.py:9: in assert [8, 3, 4]==snapshot([3, 2+2]) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign new_code = self.context.file._value_to_code(new_value_element) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code return self._token_to_code(value_to_token(value)) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '8 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_39.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert [8, 3, 4]==snapshot([3, 2+2]) ------------------------------ Captured log call ------------------------------- ___________________ test_generic [[3, 3] -> [8, 3, 3] ] ___________________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_40.py:9: in assert [8, 3, 3]==snapshot([3, 3]) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign new_code = self.context.file._value_to_code(new_value_element) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code return self._token_to_code(value_to_token(value)) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '8 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_40.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert [8, 3, 3]==snapshot([3, 3]) ------------------------------ Captured log call ------------------------------- _______________ test_generic [[2+2, 5, 5] -> [4] ] ________________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_41.py:9: in assert [4]==snapshot([2+2, 5, 5]) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign v = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_41.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert [4]==snapshot([2+2, 5, 5]) ------------------------------ Captured log call ------------------------------- _______________ test_generic [[2+2, 5] -> [4, 8] ] ________________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_42.py:9: in assert [4, 8]==snapshot([2+2, 5]) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign v = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_42.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert [4, 8]==snapshot([2+2, 5]) ------------------------------ Captured log call ------------------------------- _____________ test_generic [[2+2, 5, 2+2] -> [4, 4] ] _____________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_43.py:9: in assert [4, 4]==snapshot([2+2, 5, 2+2]) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign v = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_43.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert [4, 4]==snapshot([2+2, 5, 2+2]) ------------------------------ Captured log call ------------------------------- ______________ test_generic [[2+2, 5, 3] -> [4, 3] ] ______________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_44.py:9: in assert [4, 3]==snapshot([2+2, 5, 3]) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign v = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_44.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert [4, 3]==snapshot([2+2, 5, 3]) ------------------------------ Captured log call ------------------------------- _______________ test_generic [[2+2, 5] -> [4, 8] ] ________________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_45.py:9: in assert [4, 8]==snapshot([2+2, 5]) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign v = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_45.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert [4, 8]==snapshot([2+2, 5]) ------------------------------ Captured log call ------------------------------- _______________ test_generic [[2+2] -> [4, 8, 8] ] ________________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_46.py:9: in assert [4, 8, 8]==snapshot([2+2]) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign v = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_46.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert [4, 8, 8]==snapshot([2+2]) ------------------------------ Captured log call ------------------------------- _____________ test_generic [[2+2, 2+2] -> [4, 8, 4] ] _____________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_47.py:9: in assert [4, 8, 4]==snapshot([2+2, 2+2]) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign v = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_47.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert [4, 8, 4]==snapshot([2+2, 2+2]) ------------------------------ Captured log call ------------------------------- ______________ test_generic [[2+2, 3] -> [4, 8, 3] ] ______________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_48.py:9: in assert [4, 8, 3]==snapshot([2+2, 3]) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign v = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_48.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert [4, 8, 3]==snapshot([2+2, 3]) ------------------------------ Captured log call ------------------------------- _____________ test_generic [[2+2, 2+2, 5] -> [4, 4] ] _____________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_49.py:9: in assert [4, 4]==snapshot([2+2, 2+2, 5]) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign v = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_49.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert [4, 4]==snapshot([2+2, 2+2, 5]) ------------------------------ Captured log call ------------------------------- _____________ test_generic [[2+2, 2+2] -> [4, 4, 8] ] _____________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_50.py:9: in assert [4, 4, 8]==snapshot([2+2, 2+2]) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign v = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_50.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert [4, 4, 8]==snapshot([2+2, 2+2]) ------------------------------ Captured log call ------------------------------- _____________ test_generic [[2+2, 2+2, 2+2] -> [4, 4, 4] ] _____________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_51.py:9: in assert [4, 4, 4]==snapshot([2+2, 2+2, 2+2]) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign v = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_51.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert [4, 4, 4]==snapshot([2+2, 2+2, 2+2]) ------------------------------ Captured log call ------------------------------- ______________ test_generic [[2+2, 2+2, 3] -> [4, 4, 3] ] ______________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_52.py:9: in assert [4, 4, 3]==snapshot([2+2, 2+2, 3]) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign v = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_52.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert [4, 4, 3]==snapshot([2+2, 2+2, 3]) ------------------------------ Captured log call ------------------------------- ______________ test_generic [[2+2, 3, 5] -> [4, 3] ] ______________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_53.py:9: in assert [4, 3]==snapshot([2+2, 3, 5]) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign v = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_53.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert [4, 3]==snapshot([2+2, 3, 5]) ------------------------------ Captured log call ------------------------------- ______________ test_generic [[2+2, 3] -> [4, 3, 8] ] ______________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_54.py:9: in assert [4, 3, 8]==snapshot([2+2, 3]) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign v = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_54.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert [4, 3, 8]==snapshot([2+2, 3]) ------------------------------ Captured log call ------------------------------- ______________ test_generic [[2+2, 3, 2+2] -> [4, 3, 4] ] ______________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_55.py:9: in assert [4, 3, 4]==snapshot([2+2, 3, 2+2]) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign v = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_55.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert [4, 3, 4]==snapshot([2+2, 3, 2+2]) ------------------------------ Captured log call ------------------------------- _______________ test_generic [[2+2, 3, 3] -> [4, 3, 3] ] _______________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_56.py:9: in assert [4, 3, 3]==snapshot([2+2, 3, 3]) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign v = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_56.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert [4, 3, 3]==snapshot([2+2, 3, 3]) ------------------------------ Captured log call ------------------------------- ____________________ test_generic [[3, 5, 5] -> [3] ] _____________________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): s1 = source(code) print("source:", code) assert set(s1.flags) == flags assert ("fix" in flags) == s1.error for f in all_flags: c3 = build( [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] ) new_code = f"assert {c2}==snapshot({c3})" print(f"{set(f)}:") print(" ", code) print(" ", new_code) > s2 = s1.run(*f) tests/test_preserve_values.py:245: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:137: in run recorder.fix_all() /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all file.rewrite() /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite new_code = self.new_code() /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code format_whole_file = enforce_formatting() or code == format_code( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 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])' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_59.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert [3]==snapshot([3, 5, 5]) reported_flags: {'fix'} run: pytest --inline-snapshot= output: |assert [3]==snapshot([3, 5, 5]) source: assert [3]==snapshot([3, 5, 5]) set(): assert [3]==snapshot([3, 5, 5]) assert [3]==snapshot([3, 5, 5]) input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert [3]==snapshot([3, 5, 5]) reported_flags: {'fix'} run: pytest --inline-snapshot= output: |assert [3]==snapshot([3, 5, 5]) {'fix'}: assert [3]==snapshot([3, 5, 5]) assert [3]==snapshot([3]) input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert [3]==snapshot([3, 5, 5]) ----------------------------- Captured stderr call ----------------------------- Traceback (most recent call last): File "/tmp/autopkgtest.ImMzGl/autopkgtest_tmp/tests/conftest.py", line 114, in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) File "/tmp/pytest-of-unshare/pytest-0/test_generic0/test_57.py", line 9, in assert [3]==snapshot([3, 5, 5]) ^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError Traceback (most recent call last): File "/tmp/autopkgtest.ImMzGl/autopkgtest_tmp/tests/conftest.py", line 114, in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) File "/tmp/pytest-of-unshare/pytest-0/test_generic0/test_58.py", line 9, in assert [3]==snapshot([3, 5, 5]) ^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError ------------------------------ Captured log call ------------------------------- ____________________ test_generic [[3, 5] -> [3, 8] ] _____________________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_60.py:9: in assert [3, 8]==snapshot([3, 5]) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign v = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '8 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_60.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert [3, 8]==snapshot([3, 5]) ------------------------------ Captured log call ------------------------------- ______________ test_generic [[3, 5, 2+2] -> [3, 4] ] ______________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_61.py:9: in assert [3, 4]==snapshot([3, 5, 2+2]) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign v = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_61.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert [3, 4]==snapshot([3, 5, 2+2]) ------------------------------ Captured log call ------------------------------- ___________________ test_generic [[3, 5, 3] -> [3, 3] ] ___________________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): s1 = source(code) print("source:", code) assert set(s1.flags) == flags assert ("fix" in flags) == s1.error for f in all_flags: c3 = build( [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] ) new_code = f"assert {c2}==snapshot({c3})" print(f"{set(f)}:") print(" ", code) print(" ", new_code) > s2 = s1.run(*f) tests/test_preserve_values.py:245: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:137: in run recorder.fix_all() /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all file.rewrite() /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite new_code = self.new_code() /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code format_whole_file = enforce_formatting() or code == format_code( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 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])' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_64.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert [3, 3]==snapshot([3, 5, 3]) reported_flags: {'fix'} run: pytest --inline-snapshot= output: |assert [3, 3]==snapshot([3, 5, 3]) source: assert [3, 3]==snapshot([3, 5, 3]) set(): assert [3, 3]==snapshot([3, 5, 3]) assert [3, 3]==snapshot([3, 5, 3]) input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert [3, 3]==snapshot([3, 5, 3]) reported_flags: {'fix'} run: pytest --inline-snapshot= output: |assert [3, 3]==snapshot([3, 5, 3]) {'fix'}: assert [3, 3]==snapshot([3, 5, 3]) assert [3, 3]==snapshot([3, 3]) input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert [3, 3]==snapshot([3, 5, 3]) ----------------------------- Captured stderr call ----------------------------- Traceback (most recent call last): File "/tmp/autopkgtest.ImMzGl/autopkgtest_tmp/tests/conftest.py", line 114, in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) File "/tmp/pytest-of-unshare/pytest-0/test_generic0/test_62.py", line 9, in assert [3, 3]==snapshot([3, 5, 3]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError Traceback (most recent call last): File "/tmp/autopkgtest.ImMzGl/autopkgtest_tmp/tests/conftest.py", line 114, in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) File "/tmp/pytest-of-unshare/pytest-0/test_generic0/test_63.py", line 9, in assert [3, 3]==snapshot([3, 5, 3]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError ------------------------------ Captured log call ------------------------------- ____________________ test_generic [[3, 5] -> [3, 8] ] _____________________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_65.py:9: in assert [3, 8]==snapshot([3, 5]) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign v = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '8 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_65.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert [3, 8]==snapshot([3, 5]) ------------------------------ Captured log call ------------------------------- ____________________ test_generic [[3] -> [3, 8, 8] ] _____________________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_66.py:9: in assert [3, 8, 8]==snapshot([3]) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign new_code = self.context.file._value_to_code(new_value_element) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code return self._token_to_code(value_to_token(value)) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '8 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_66.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert [3, 8, 8]==snapshot([3]) ------------------------------ Captured log call ------------------------------- ______________ test_generic [[3, 2+2] -> [3, 8, 4] ] ______________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_67.py:9: in assert [3, 8, 4]==snapshot([3, 2+2]) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign new_code = self.context.file._value_to_code(new_value_element) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code return self._token_to_code(value_to_token(value)) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '8 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_67.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert [3, 8, 4]==snapshot([3, 2+2]) ------------------------------ Captured log call ------------------------------- ___________________ test_generic [[3, 3] -> [3, 8, 3] ] ___________________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_68.py:9: in assert [3, 8, 3]==snapshot([3, 3]) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign new_code = self.context.file._value_to_code(new_value_element) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code return self._token_to_code(value_to_token(value)) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '8 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_68.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert [3, 8, 3]==snapshot([3, 3]) ------------------------------ Captured log call ------------------------------- ______________ test_generic [[3, 2+2, 5] -> [3, 4] ] ______________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_69.py:9: in assert [3, 4]==snapshot([3, 2+2, 5]) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign v = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_69.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert [3, 4]==snapshot([3, 2+2, 5]) ------------------------------ Captured log call ------------------------------- ______________ test_generic [[3, 2+2] -> [3, 4, 8] ] ______________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_70.py:9: in assert [3, 4, 8]==snapshot([3, 2+2]) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign v = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_70.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert [3, 4, 8]==snapshot([3, 2+2]) ------------------------------ Captured log call ------------------------------- ______________ test_generic [[3, 2+2, 2+2] -> [3, 4, 4] ] ______________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_71.py:9: in assert [3, 4, 4]==snapshot([3, 2+2, 2+2]) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign v = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_71.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert [3, 4, 4]==snapshot([3, 2+2, 2+2]) ------------------------------ Captured log call ------------------------------- _______________ test_generic [[3, 2+2, 3] -> [3, 4, 3] ] _______________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_72.py:9: in assert [3, 4, 3]==snapshot([3, 2+2, 3]) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign v = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_72.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert [3, 4, 3]==snapshot([3, 2+2, 3]) ------------------------------ Captured log call ------------------------------- ___________________ test_generic [[3, 3, 5] -> [3, 3] ] ___________________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): s1 = source(code) print("source:", code) assert set(s1.flags) == flags assert ("fix" in flags) == s1.error for f in all_flags: c3 = build( [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] ) new_code = f"assert {c2}==snapshot({c3})" print(f"{set(f)}:") print(" ", code) print(" ", new_code) > s2 = s1.run(*f) tests/test_preserve_values.py:245: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:137: in run recorder.fix_all() /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all file.rewrite() /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite new_code = self.new_code() /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code format_whole_file = enforce_formatting() or code == format_code( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 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])' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_75.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert [3, 3]==snapshot([3, 3, 5]) reported_flags: {'fix'} run: pytest --inline-snapshot= output: |assert [3, 3]==snapshot([3, 3, 5]) source: assert [3, 3]==snapshot([3, 3, 5]) set(): assert [3, 3]==snapshot([3, 3, 5]) assert [3, 3]==snapshot([3, 3, 5]) input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert [3, 3]==snapshot([3, 3, 5]) reported_flags: {'fix'} run: pytest --inline-snapshot= output: |assert [3, 3]==snapshot([3, 3, 5]) {'fix'}: assert [3, 3]==snapshot([3, 3, 5]) assert [3, 3]==snapshot([3, 3]) input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert [3, 3]==snapshot([3, 3, 5]) ----------------------------- Captured stderr call ----------------------------- Traceback (most recent call last): File "/tmp/autopkgtest.ImMzGl/autopkgtest_tmp/tests/conftest.py", line 114, in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) File "/tmp/pytest-of-unshare/pytest-0/test_generic0/test_73.py", line 9, in assert [3, 3]==snapshot([3, 3, 5]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError Traceback (most recent call last): File "/tmp/autopkgtest.ImMzGl/autopkgtest_tmp/tests/conftest.py", line 114, in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) File "/tmp/pytest-of-unshare/pytest-0/test_generic0/test_74.py", line 9, in assert [3, 3]==snapshot([3, 3, 5]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError ------------------------------ Captured log call ------------------------------- ___________________ test_generic [[3, 3] -> [3, 3, 8] ] ___________________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_76.py:9: in assert [3, 3, 8]==snapshot([3, 3]) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign new_code = self.context.file._value_to_code(new_value_element) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code return self._token_to_code(value_to_token(value)) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '8 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_76.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert [3, 3, 8]==snapshot([3, 3]) ------------------------------ Captured log call ------------------------------- _______________ test_generic [[3, 3, 2+2] -> [3, 3, 4] ] _______________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_77.py:9: in assert [3, 3, 4]==snapshot([3, 3, 2+2]) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign v = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_77.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert [3, 3, 4]==snapshot([3, 3, 2+2]) ------------------------------ Captured log call ------------------------------- _____________________ test_generic [(5, 5, 5) -> () ] _____________________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): s1 = source(code) print("source:", code) assert set(s1.flags) == flags assert ("fix" in flags) == s1.error for f in all_flags: c3 = build( [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] ) new_code = f"assert {c2}==snapshot({c3})" print(f"{set(f)}:") print(" ", code) print(" ", new_code) > s2 = s1.run(*f) tests/test_preserve_values.py:245: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:137: in run recorder.fix_all() /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all file.rewrite() /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite new_code = self.new_code() /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code format_whole_file = enforce_formatting() or code == format_code( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 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))' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_82.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert ()==snapshot((5, 5, 5)) reported_flags: {'fix'} run: pytest --inline-snapshot= output: |assert ()==snapshot((5, 5, 5)) source: assert ()==snapshot((5, 5, 5)) set(): assert ()==snapshot((5, 5, 5)) assert ()==snapshot((5, 5, 5)) input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert ()==snapshot((5, 5, 5)) reported_flags: {'fix'} run: pytest --inline-snapshot= output: |assert ()==snapshot((5, 5, 5)) {'fix'}: assert ()==snapshot((5, 5, 5)) assert ()==snapshot(()) input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert ()==snapshot((5, 5, 5)) ----------------------------- Captured stderr call ----------------------------- Traceback (most recent call last): File "/tmp/autopkgtest.ImMzGl/autopkgtest_tmp/tests/conftest.py", line 114, in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) File "/tmp/pytest-of-unshare/pytest-0/test_generic0/test_80.py", line 9, in assert ()==snapshot((5, 5, 5)) ^^^^^^^^^^^^^^^^^^^^^^^ AssertionError Traceback (most recent call last): File "/tmp/autopkgtest.ImMzGl/autopkgtest_tmp/tests/conftest.py", line 114, in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) File "/tmp/pytest-of-unshare/pytest-0/test_generic0/test_81.py", line 9, in assert ()==snapshot((5, 5, 5)) ^^^^^^^^^^^^^^^^^^^^^^^ AssertionError ------------------------------ Captured log call ------------------------------- _____________________ test_generic [(5, 5) -> (8,) ] ______________________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_83.py:9: in assert (8,)==snapshot((5, 5)) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign new_code = self.context.file._value_to_code(new_value_element) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code return self._token_to_code(value_to_token(value)) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '8 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_83.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert (8,)==snapshot((5, 5)) ------------------------------ Captured log call ------------------------------- _______________ test_generic [(5, 5, 2+2) -> (4,) ] _______________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_84.py:9: in assert (4,)==snapshot((5, 5, 2+2)) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign v = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_84.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert (4,)==snapshot((5, 5, 2+2)) ------------------------------ Captured log call ------------------------------- ____________________ test_generic [(5, 5, 3) -> (3,) ] ____________________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): s1 = source(code) print("source:", code) assert set(s1.flags) == flags assert ("fix" in flags) == s1.error for f in all_flags: c3 = build( [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] ) new_code = f"assert {c2}==snapshot({c3})" print(f"{set(f)}:") print(" ", code) print(" ", new_code) > s2 = s1.run(*f) tests/test_preserve_values.py:245: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:137: in run recorder.fix_all() /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all file.rewrite() /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite new_code = self.new_code() /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code format_whole_file = enforce_formatting() or code == format_code( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 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))' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_87.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert (3,)==snapshot((5, 5, 3)) reported_flags: {'fix'} run: pytest --inline-snapshot= output: |assert (3,)==snapshot((5, 5, 3)) source: assert (3,)==snapshot((5, 5, 3)) set(): assert (3,)==snapshot((5, 5, 3)) assert (3,)==snapshot((5, 5, 3)) input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert (3,)==snapshot((5, 5, 3)) reported_flags: {'fix'} run: pytest --inline-snapshot= output: |assert (3,)==snapshot((5, 5, 3)) {'fix'}: assert (3,)==snapshot((5, 5, 3)) assert (3,)==snapshot((3,)) input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert (3,)==snapshot((5, 5, 3)) ----------------------------- Captured stderr call ----------------------------- Traceback (most recent call last): File "/tmp/autopkgtest.ImMzGl/autopkgtest_tmp/tests/conftest.py", line 114, in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) File "/tmp/pytest-of-unshare/pytest-0/test_generic0/test_85.py", line 9, in assert (3,)==snapshot((5, 5, 3)) ^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError Traceback (most recent call last): File "/tmp/autopkgtest.ImMzGl/autopkgtest_tmp/tests/conftest.py", line 114, in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) File "/tmp/pytest-of-unshare/pytest-0/test_generic0/test_86.py", line 9, in assert (3,)==snapshot((5, 5, 3)) ^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError ------------------------------ Captured log call ------------------------------- _____________________ test_generic [(5, 5) -> (8,) ] ______________________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_88.py:9: in assert (8,)==snapshot((5, 5)) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign new_code = self.context.file._value_to_code(new_value_element) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code return self._token_to_code(value_to_token(value)) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '8 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_88.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert (8,)==snapshot((5, 5)) ------------------------------ Captured log call ------------------------------- _____________________ test_generic [(5,) -> (8, 8) ] ______________________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_89.py:9: in assert (8, 8)==snapshot((5,)) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign new_code = self.context.file._value_to_code(new_value_element) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code return self._token_to_code(value_to_token(value)) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '8 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_89.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert (8, 8)==snapshot((5,)) ------------------------------ Captured log call ------------------------------- _______________ test_generic [(5, 2+2) -> (8, 4) ] ________________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_90.py:9: in assert (8, 4)==snapshot((5, 2+2)) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign v = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '8 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_90.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert (8, 4)==snapshot((5, 2+2)) ------------------------------ Captured log call ------------------------------- ____________________ test_generic [(5, 3) -> (8, 3) ] _____________________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_91.py:9: in assert (8, 3)==snapshot((5, 3)) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign v = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '8 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_91.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert (8, 3)==snapshot((5, 3)) ------------------------------ Captured log call ------------------------------- _______________ test_generic [(5, 2+2, 5) -> (4,) ] _______________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_92.py:9: in assert (4,)==snapshot((5, 2+2, 5)) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign v = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_92.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert (4,)==snapshot((5, 2+2, 5)) ------------------------------ Captured log call ------------------------------- _______________ test_generic [(5, 2+2) -> (4, 8) ] ________________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_93.py:9: in assert (4, 8)==snapshot((5, 2+2)) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign v = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_93.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert (4, 8)==snapshot((5, 2+2)) ------------------------------ Captured log call ------------------------------- _____________ test_generic [(5, 2+2, 2+2) -> (4, 4) ] _____________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_94.py:9: in assert (4, 4)==snapshot((5, 2+2, 2+2)) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign v = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_94.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert (4, 4)==snapshot((5, 2+2, 2+2)) ------------------------------ Captured log call ------------------------------- ______________ test_generic [(5, 2+2, 3) -> (4, 3) ] ______________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_95.py:9: in assert (4, 3)==snapshot((5, 2+2, 3)) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign v = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_95.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert (4, 3)==snapshot((5, 2+2, 3)) ------------------------------ Captured log call ------------------------------- ____________________ test_generic [(5, 3, 5) -> (3,) ] ____________________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): s1 = source(code) print("source:", code) assert set(s1.flags) == flags assert ("fix" in flags) == s1.error for f in all_flags: c3 = build( [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] ) new_code = f"assert {c2}==snapshot({c3})" print(f"{set(f)}:") print(" ", code) print(" ", new_code) > s2 = s1.run(*f) tests/test_preserve_values.py:245: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:137: in run recorder.fix_all() /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all file.rewrite() /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite new_code = self.new_code() /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code format_whole_file = enforce_formatting() or code == format_code( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 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))' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_98.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert (3,)==snapshot((5, 3, 5)) reported_flags: {'fix'} run: pytest --inline-snapshot= output: |assert (3,)==snapshot((5, 3, 5)) source: assert (3,)==snapshot((5, 3, 5)) set(): assert (3,)==snapshot((5, 3, 5)) assert (3,)==snapshot((5, 3, 5)) input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert (3,)==snapshot((5, 3, 5)) reported_flags: {'fix'} run: pytest --inline-snapshot= output: |assert (3,)==snapshot((5, 3, 5)) {'fix'}: assert (3,)==snapshot((5, 3, 5)) assert (3,)==snapshot((3,)) input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert (3,)==snapshot((5, 3, 5)) ----------------------------- Captured stderr call ----------------------------- Traceback (most recent call last): File "/tmp/autopkgtest.ImMzGl/autopkgtest_tmp/tests/conftest.py", line 114, in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) File "/tmp/pytest-of-unshare/pytest-0/test_generic0/test_96.py", line 9, in assert (3,)==snapshot((5, 3, 5)) ^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError Traceback (most recent call last): File "/tmp/autopkgtest.ImMzGl/autopkgtest_tmp/tests/conftest.py", line 114, in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) File "/tmp/pytest-of-unshare/pytest-0/test_generic0/test_97.py", line 9, in assert (3,)==snapshot((5, 3, 5)) ^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError ------------------------------ Captured log call ------------------------------- ____________________ test_generic [(5, 3) -> (3, 8) ] _____________________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_99.py:9: in assert (3, 8)==snapshot((5, 3)) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign new_code = self.context.file._value_to_code(new_value_element) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code return self._token_to_code(value_to_token(value)) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '8 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_99.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert (3, 8)==snapshot((5, 3)) ------------------------------ Captured log call ------------------------------- ______________ test_generic [(5, 3, 2+2) -> (3, 4) ] ______________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_100.py:9: in assert (3, 4)==snapshot((5, 3, 2+2)) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign v = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_100.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert (3, 4)==snapshot((5, 3, 2+2)) ------------------------------ Captured log call ------------------------------- ___________________ test_generic [(5, 3, 3) -> (3, 3) ] ___________________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): s1 = source(code) print("source:", code) assert set(s1.flags) == flags assert ("fix" in flags) == s1.error for f in all_flags: c3 = build( [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] ) new_code = f"assert {c2}==snapshot({c3})" print(f"{set(f)}:") print(" ", code) print(" ", new_code) > s2 = s1.run(*f) tests/test_preserve_values.py:245: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:137: in run recorder.fix_all() /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all file.rewrite() /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite new_code = self.new_code() /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code format_whole_file = enforce_formatting() or code == format_code( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 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))' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_103.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert (3, 3)==snapshot((5, 3, 3)) reported_flags: {'fix'} run: pytest --inline-snapshot= output: |assert (3, 3)==snapshot((5, 3, 3)) source: assert (3, 3)==snapshot((5, 3, 3)) set(): assert (3, 3)==snapshot((5, 3, 3)) assert (3, 3)==snapshot((5, 3, 3)) input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert (3, 3)==snapshot((5, 3, 3)) reported_flags: {'fix'} run: pytest --inline-snapshot= output: |assert (3, 3)==snapshot((5, 3, 3)) {'fix'}: assert (3, 3)==snapshot((5, 3, 3)) assert (3, 3)==snapshot((3, 3)) input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert (3, 3)==snapshot((5, 3, 3)) ----------------------------- Captured stderr call ----------------------------- Traceback (most recent call last): File "/tmp/autopkgtest.ImMzGl/autopkgtest_tmp/tests/conftest.py", line 114, in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) File "/tmp/pytest-of-unshare/pytest-0/test_generic0/test_101.py", line 9, in assert (3, 3)==snapshot((5, 3, 3)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError Traceback (most recent call last): File "/tmp/autopkgtest.ImMzGl/autopkgtest_tmp/tests/conftest.py", line 114, in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) File "/tmp/pytest-of-unshare/pytest-0/test_generic0/test_102.py", line 9, in assert (3, 3)==snapshot((5, 3, 3)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError ------------------------------ Captured log call ------------------------------- _____________________ test_generic [(5, 5) -> (8,) ] ______________________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_104.py:9: in assert (8,)==snapshot((5, 5)) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign new_code = self.context.file._value_to_code(new_value_element) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code return self._token_to_code(value_to_token(value)) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '8 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_104.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert (8,)==snapshot((5, 5)) ------------------------------ Captured log call ------------------------------- _____________________ test_generic [(5,) -> (8, 8) ] ______________________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_105.py:9: in assert (8, 8)==snapshot((5,)) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign new_code = self.context.file._value_to_code(new_value_element) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code return self._token_to_code(value_to_token(value)) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '8 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_105.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert (8, 8)==snapshot((5,)) ------------------------------ Captured log call ------------------------------- _______________ test_generic [(5, 2+2) -> (8, 4) ] ________________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_106.py:9: in assert (8, 4)==snapshot((5, 2+2)) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign v = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '8 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_106.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert (8, 4)==snapshot((5, 2+2)) ------------------------------ Captured log call ------------------------------- ____________________ test_generic [(5, 3) -> (8, 3) ] _____________________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_107.py:9: in assert (8, 3)==snapshot((5, 3)) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign v = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '8 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_107.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert (8, 3)==snapshot((5, 3)) ------------------------------ Captured log call ------------------------------- _____________________ test_generic [(5,) -> (8, 8) ] ______________________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_108.py:9: in assert (8, 8)==snapshot((5,)) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign new_code = self.context.file._value_to_code(new_value_element) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code return self._token_to_code(value_to_token(value)) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '8 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_108.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert (8, 8)==snapshot((5,)) ------------------------------ Captured log call ------------------------------- _____________________ test_generic [() -> (8, 8, 8) ] _____________________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_109.py:9: in assert (8, 8, 8)==snapshot(()) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign new_code = self.context.file._value_to_code(new_value_element) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code return self._token_to_code(value_to_token(value)) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '8 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_109.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert (8, 8, 8)==snapshot(()) ------------------------------ Captured log call ------------------------------- _______________ test_generic [(2+2,) -> (8, 8, 4) ] _______________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_110.py:9: in assert (8, 8, 4)==snapshot((2+2,)) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign new_code = self.context.file._value_to_code(new_value_element) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code return self._token_to_code(value_to_token(value)) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '8 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_110.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert (8, 8, 4)==snapshot((2+2,)) ------------------------------ Captured log call ------------------------------- ____________________ test_generic [(3,) -> (8, 8, 3) ] ____________________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_111.py:9: in assert (8, 8, 3)==snapshot((3,)) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign new_code = self.context.file._value_to_code(new_value_element) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code return self._token_to_code(value_to_token(value)) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '8 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_111.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert (8, 8, 3)==snapshot((3,)) ------------------------------ Captured log call ------------------------------- _______________ test_generic [(2+2, 5) -> (8, 4) ] ________________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_112.py:9: in assert (8, 4)==snapshot((2+2, 5)) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign new_code = self.context.file._value_to_code(new_value_element) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code return self._token_to_code(value_to_token(value)) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '8 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_112.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert (8, 4)==snapshot((2+2, 5)) ------------------------------ Captured log call ------------------------------- _______________ test_generic [(2+2,) -> (8, 4, 8) ] _______________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_113.py:9: in assert (8, 4, 8)==snapshot((2+2,)) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign new_code = self.context.file._value_to_code(new_value_element) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code return self._token_to_code(value_to_token(value)) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '8 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_113.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert (8, 4, 8)==snapshot((2+2,)) ------------------------------ Captured log call ------------------------------- _____________ test_generic [(2+2, 2+2) -> (8, 4, 4) ] _____________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_114.py:9: in assert (8, 4, 4)==snapshot((2+2, 2+2)) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign new_code = self.context.file._value_to_code(new_value_element) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code return self._token_to_code(value_to_token(value)) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '8 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_114.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert (8, 4, 4)==snapshot((2+2, 2+2)) ------------------------------ Captured log call ------------------------------- ______________ test_generic [(2+2, 3) -> (8, 4, 3) ] ______________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_115.py:9: in assert (8, 4, 3)==snapshot((2+2, 3)) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign new_code = self.context.file._value_to_code(new_value_element) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code return self._token_to_code(value_to_token(value)) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '8 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_115.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert (8, 4, 3)==snapshot((2+2, 3)) ------------------------------ Captured log call ------------------------------- ____________________ test_generic [(3, 5) -> (8, 3) ] _____________________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_116.py:9: in assert (8, 3)==snapshot((3, 5)) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign new_code = self.context.file._value_to_code(new_value_element) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code return self._token_to_code(value_to_token(value)) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '8 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_116.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert (8, 3)==snapshot((3, 5)) ------------------------------ Captured log call ------------------------------- ____________________ test_generic [(3,) -> (8, 3, 8) ] ____________________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_117.py:9: in assert (8, 3, 8)==snapshot((3,)) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign new_code = self.context.file._value_to_code(new_value_element) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code return self._token_to_code(value_to_token(value)) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '8 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_117.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert (8, 3, 8)==snapshot((3,)) ------------------------------ Captured log call ------------------------------- ______________ test_generic [(3, 2+2) -> (8, 3, 4) ] ______________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_118.py:9: in assert (8, 3, 4)==snapshot((3, 2+2)) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign new_code = self.context.file._value_to_code(new_value_element) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code return self._token_to_code(value_to_token(value)) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '8 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_118.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert (8, 3, 4)==snapshot((3, 2+2)) ------------------------------ Captured log call ------------------------------- ___________________ test_generic [(3, 3) -> (8, 3, 3) ] ___________________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_119.py:9: in assert (8, 3, 3)==snapshot((3, 3)) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign new_code = self.context.file._value_to_code(new_value_element) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code return self._token_to_code(value_to_token(value)) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '8 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_119.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert (8, 3, 3)==snapshot((3, 3)) ------------------------------ Captured log call ------------------------------- _______________ test_generic [(2+2, 5, 5) -> (4,) ] _______________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_120.py:9: in assert (4,)==snapshot((2+2, 5, 5)) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign v = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_120.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert (4,)==snapshot((2+2, 5, 5)) ------------------------------ Captured log call ------------------------------- _______________ test_generic [(2+2, 5) -> (4, 8) ] ________________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_121.py:9: in assert (4, 8)==snapshot((2+2, 5)) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign v = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_121.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert (4, 8)==snapshot((2+2, 5)) ------------------------------ Captured log call ------------------------------- _____________ test_generic [(2+2, 5, 2+2) -> (4, 4) ] _____________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_122.py:9: in assert (4, 4)==snapshot((2+2, 5, 2+2)) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign v = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_122.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert (4, 4)==snapshot((2+2, 5, 2+2)) ------------------------------ Captured log call ------------------------------- ______________ test_generic [(2+2, 5, 3) -> (4, 3) ] ______________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_123.py:9: in assert (4, 3)==snapshot((2+2, 5, 3)) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign v = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_123.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert (4, 3)==snapshot((2+2, 5, 3)) ------------------------------ Captured log call ------------------------------- _______________ test_generic [(2+2, 5) -> (4, 8) ] ________________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_124.py:9: in assert (4, 8)==snapshot((2+2, 5)) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign v = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_124.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert (4, 8)==snapshot((2+2, 5)) ------------------------------ Captured log call ------------------------------- _______________ test_generic [(2+2,) -> (4, 8, 8) ] _______________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_125.py:9: in assert (4, 8, 8)==snapshot((2+2,)) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign v = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_125.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert (4, 8, 8)==snapshot((2+2,)) ------------------------------ Captured log call ------------------------------- _____________ test_generic [(2+2, 2+2) -> (4, 8, 4) ] _____________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_126.py:9: in assert (4, 8, 4)==snapshot((2+2, 2+2)) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign v = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_126.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert (4, 8, 4)==snapshot((2+2, 2+2)) ------------------------------ Captured log call ------------------------------- ______________ test_generic [(2+2, 3) -> (4, 8, 3) ] ______________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_127.py:9: in assert (4, 8, 3)==snapshot((2+2, 3)) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign v = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_127.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert (4, 8, 3)==snapshot((2+2, 3)) ------------------------------ Captured log call ------------------------------- _____________ test_generic [(2+2, 2+2, 5) -> (4, 4) ] _____________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_128.py:9: in assert (4, 4)==snapshot((2+2, 2+2, 5)) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign v = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_128.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert (4, 4)==snapshot((2+2, 2+2, 5)) ------------------------------ Captured log call ------------------------------- _____________ test_generic [(2+2, 2+2) -> (4, 4, 8) ] _____________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_129.py:9: in assert (4, 4, 8)==snapshot((2+2, 2+2)) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign v = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_129.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert (4, 4, 8)==snapshot((2+2, 2+2)) ------------------------------ Captured log call ------------------------------- _____________ test_generic [(2+2, 2+2, 2+2) -> (4, 4, 4) ] _____________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_130.py:9: in assert (4, 4, 4)==snapshot((2+2, 2+2, 2+2)) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign v = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_130.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert (4, 4, 4)==snapshot((2+2, 2+2, 2+2)) ------------------------------ Captured log call ------------------------------- ______________ test_generic [(2+2, 2+2, 3) -> (4, 4, 3) ] ______________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_131.py:9: in assert (4, 4, 3)==snapshot((2+2, 2+2, 3)) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign v = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_131.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert (4, 4, 3)==snapshot((2+2, 2+2, 3)) ------------------------------ Captured log call ------------------------------- ______________ test_generic [(2+2, 3, 5) -> (4, 3) ] ______________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_132.py:9: in assert (4, 3)==snapshot((2+2, 3, 5)) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign v = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_132.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert (4, 3)==snapshot((2+2, 3, 5)) ------------------------------ Captured log call ------------------------------- ______________ test_generic [(2+2, 3) -> (4, 3, 8) ] ______________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_133.py:9: in assert (4, 3, 8)==snapshot((2+2, 3)) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign v = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_133.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert (4, 3, 8)==snapshot((2+2, 3)) ------------------------------ Captured log call ------------------------------- ______________ test_generic [(2+2, 3, 2+2) -> (4, 3, 4) ] ______________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_134.py:9: in assert (4, 3, 4)==snapshot((2+2, 3, 2+2)) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign v = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_134.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert (4, 3, 4)==snapshot((2+2, 3, 2+2)) ------------------------------ Captured log call ------------------------------- _______________ test_generic [(2+2, 3, 3) -> (4, 3, 3) ] _______________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_135.py:9: in assert (4, 3, 3)==snapshot((2+2, 3, 3)) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign v = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_135.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert (4, 3, 3)==snapshot((2+2, 3, 3)) ------------------------------ Captured log call ------------------------------- ____________________ test_generic [(3, 5, 5) -> (3,) ] ____________________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): s1 = source(code) print("source:", code) assert set(s1.flags) == flags assert ("fix" in flags) == s1.error for f in all_flags: c3 = build( [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] ) new_code = f"assert {c2}==snapshot({c3})" print(f"{set(f)}:") print(" ", code) print(" ", new_code) > s2 = s1.run(*f) tests/test_preserve_values.py:245: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:137: in run recorder.fix_all() /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all file.rewrite() /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite new_code = self.new_code() /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code format_whole_file = enforce_formatting() or code == format_code( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 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))' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_138.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert (3,)==snapshot((3, 5, 5)) reported_flags: {'fix'} run: pytest --inline-snapshot= output: |assert (3,)==snapshot((3, 5, 5)) source: assert (3,)==snapshot((3, 5, 5)) set(): assert (3,)==snapshot((3, 5, 5)) assert (3,)==snapshot((3, 5, 5)) input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert (3,)==snapshot((3, 5, 5)) reported_flags: {'fix'} run: pytest --inline-snapshot= output: |assert (3,)==snapshot((3, 5, 5)) {'fix'}: assert (3,)==snapshot((3, 5, 5)) assert (3,)==snapshot((3,)) input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert (3,)==snapshot((3, 5, 5)) ----------------------------- Captured stderr call ----------------------------- Traceback (most recent call last): File "/tmp/autopkgtest.ImMzGl/autopkgtest_tmp/tests/conftest.py", line 114, in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) File "/tmp/pytest-of-unshare/pytest-0/test_generic0/test_136.py", line 9, in assert (3,)==snapshot((3, 5, 5)) ^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError Traceback (most recent call last): File "/tmp/autopkgtest.ImMzGl/autopkgtest_tmp/tests/conftest.py", line 114, in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) File "/tmp/pytest-of-unshare/pytest-0/test_generic0/test_137.py", line 9, in assert (3,)==snapshot((3, 5, 5)) ^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError ------------------------------ Captured log call ------------------------------- ____________________ test_generic [(3, 5) -> (3, 8) ] _____________________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_139.py:9: in assert (3, 8)==snapshot((3, 5)) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign v = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '8 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_139.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert (3, 8)==snapshot((3, 5)) ------------------------------ Captured log call ------------------------------- ______________ test_generic [(3, 5, 2+2) -> (3, 4) ] ______________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_140.py:9: in assert (3, 4)==snapshot((3, 5, 2+2)) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign v = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_140.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert (3, 4)==snapshot((3, 5, 2+2)) ------------------------------ Captured log call ------------------------------- ___________________ test_generic [(3, 5, 3) -> (3, 3) ] ___________________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): s1 = source(code) print("source:", code) assert set(s1.flags) == flags assert ("fix" in flags) == s1.error for f in all_flags: c3 = build( [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] ) new_code = f"assert {c2}==snapshot({c3})" print(f"{set(f)}:") print(" ", code) print(" ", new_code) > s2 = s1.run(*f) tests/test_preserve_values.py:245: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:137: in run recorder.fix_all() /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all file.rewrite() /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite new_code = self.new_code() /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code format_whole_file = enforce_formatting() or code == format_code( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 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))' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_143.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert (3, 3)==snapshot((3, 5, 3)) reported_flags: {'fix'} run: pytest --inline-snapshot= output: |assert (3, 3)==snapshot((3, 5, 3)) source: assert (3, 3)==snapshot((3, 5, 3)) set(): assert (3, 3)==snapshot((3, 5, 3)) assert (3, 3)==snapshot((3, 5, 3)) input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert (3, 3)==snapshot((3, 5, 3)) reported_flags: {'fix'} run: pytest --inline-snapshot= output: |assert (3, 3)==snapshot((3, 5, 3)) {'fix'}: assert (3, 3)==snapshot((3, 5, 3)) assert (3, 3)==snapshot((3, 3)) input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert (3, 3)==snapshot((3, 5, 3)) ----------------------------- Captured stderr call ----------------------------- Traceback (most recent call last): File "/tmp/autopkgtest.ImMzGl/autopkgtest_tmp/tests/conftest.py", line 114, in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) File "/tmp/pytest-of-unshare/pytest-0/test_generic0/test_141.py", line 9, in assert (3, 3)==snapshot((3, 5, 3)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError Traceback (most recent call last): File "/tmp/autopkgtest.ImMzGl/autopkgtest_tmp/tests/conftest.py", line 114, in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) File "/tmp/pytest-of-unshare/pytest-0/test_generic0/test_142.py", line 9, in assert (3, 3)==snapshot((3, 5, 3)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError ------------------------------ Captured log call ------------------------------- ____________________ test_generic [(3, 5) -> (3, 8) ] _____________________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_144.py:9: in assert (3, 8)==snapshot((3, 5)) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign v = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '8 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_144.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert (3, 8)==snapshot((3, 5)) ------------------------------ Captured log call ------------------------------- ____________________ test_generic [(3,) -> (3, 8, 8) ] ____________________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_145.py:9: in assert (3, 8, 8)==snapshot((3,)) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign new_code = self.context.file._value_to_code(new_value_element) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code return self._token_to_code(value_to_token(value)) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '8 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_145.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert (3, 8, 8)==snapshot((3,)) ------------------------------ Captured log call ------------------------------- ______________ test_generic [(3, 2+2) -> (3, 8, 4) ] ______________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_146.py:9: in assert (3, 8, 4)==snapshot((3, 2+2)) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign new_code = self.context.file._value_to_code(new_value_element) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code return self._token_to_code(value_to_token(value)) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '8 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_146.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert (3, 8, 4)==snapshot((3, 2+2)) ------------------------------ Captured log call ------------------------------- ___________________ test_generic [(3, 3) -> (3, 8, 3) ] ___________________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_147.py:9: in assert (3, 8, 3)==snapshot((3, 3)) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign new_code = self.context.file._value_to_code(new_value_element) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code return self._token_to_code(value_to_token(value)) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '8 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_147.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert (3, 8, 3)==snapshot((3, 3)) ------------------------------ Captured log call ------------------------------- ______________ test_generic [(3, 2+2, 5) -> (3, 4) ] ______________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_148.py:9: in assert (3, 4)==snapshot((3, 2+2, 5)) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign v = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_148.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert (3, 4)==snapshot((3, 2+2, 5)) ------------------------------ Captured log call ------------------------------- ______________ test_generic [(3, 2+2) -> (3, 4, 8) ] ______________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_149.py:9: in assert (3, 4, 8)==snapshot((3, 2+2)) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign v = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_149.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert (3, 4, 8)==snapshot((3, 2+2)) ------------------------------ Captured log call ------------------------------- ______________ test_generic [(3, 2+2, 2+2) -> (3, 4, 4) ] ______________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_150.py:9: in assert (3, 4, 4)==snapshot((3, 2+2, 2+2)) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign v = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_150.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert (3, 4, 4)==snapshot((3, 2+2, 2+2)) ------------------------------ Captured log call ------------------------------- _______________ test_generic [(3, 2+2, 3) -> (3, 4, 3) ] _______________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_151.py:9: in assert (3, 4, 3)==snapshot((3, 2+2, 3)) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign v = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_151.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert (3, 4, 3)==snapshot((3, 2+2, 3)) ------------------------------ Captured log call ------------------------------- ___________________ test_generic [(3, 3, 5) -> (3, 3) ] ___________________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): s1 = source(code) print("source:", code) assert set(s1.flags) == flags assert ("fix" in flags) == s1.error for f in all_flags: c3 = build( [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] ) new_code = f"assert {c2}==snapshot({c3})" print(f"{set(f)}:") print(" ", code) print(" ", new_code) > s2 = s1.run(*f) tests/test_preserve_values.py:245: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:137: in run recorder.fix_all() /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all file.rewrite() /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite new_code = self.new_code() /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code format_whole_file = enforce_formatting() or code == format_code( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 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))' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_154.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert (3, 3)==snapshot((3, 3, 5)) reported_flags: {'fix'} run: pytest --inline-snapshot= output: |assert (3, 3)==snapshot((3, 3, 5)) source: assert (3, 3)==snapshot((3, 3, 5)) set(): assert (3, 3)==snapshot((3, 3, 5)) assert (3, 3)==snapshot((3, 3, 5)) input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert (3, 3)==snapshot((3, 3, 5)) reported_flags: {'fix'} run: pytest --inline-snapshot= output: |assert (3, 3)==snapshot((3, 3, 5)) {'fix'}: assert (3, 3)==snapshot((3, 3, 5)) assert (3, 3)==snapshot((3, 3)) input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert (3, 3)==snapshot((3, 3, 5)) ----------------------------- Captured stderr call ----------------------------- Traceback (most recent call last): File "/tmp/autopkgtest.ImMzGl/autopkgtest_tmp/tests/conftest.py", line 114, in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) File "/tmp/pytest-of-unshare/pytest-0/test_generic0/test_152.py", line 9, in assert (3, 3)==snapshot((3, 3, 5)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError Traceback (most recent call last): File "/tmp/autopkgtest.ImMzGl/autopkgtest_tmp/tests/conftest.py", line 114, in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) File "/tmp/pytest-of-unshare/pytest-0/test_generic0/test_153.py", line 9, in assert (3, 3)==snapshot((3, 3, 5)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError ------------------------------ Captured log call ------------------------------- ___________________ test_generic [(3, 3) -> (3, 3, 8) ] ___________________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_155.py:9: in assert (3, 3, 8)==snapshot((3, 3)) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:86: in assign new_code = self.context.file._value_to_code(new_value_element) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code return self._token_to_code(value_to_token(value)) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '8 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_155.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert (3, 3, 8)==snapshot((3, 3)) ------------------------------ Captured log call ------------------------------- _______________ test_generic [(3, 3, 2+2) -> (3, 3, 4) ] _______________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_156.py:9: in assert (3, 3, 4)==snapshot((3, 3, 2+2)) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/sequence_adapter.py:79: in assign v = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_156.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert (3, 3, 4)==snapshot((3, 3, 2+2)) ------------------------------ Captured log call ------------------------------- ________________ test_generic [{0: 5, 1: 5, 2: 5} -> {} ] _________________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): s1 = source(code) print("source:", code) assert set(s1.flags) == flags assert ("fix" in flags) == s1.error for f in all_flags: c3 = build( [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] ) new_code = f"assert {c2}==snapshot({c3})" print(f"{set(f)}:") print(" ", code) print(" ", new_code) > s2 = s1.run(*f) tests/test_preserve_values.py:245: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:137: in run recorder.fix_all() /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all file.rewrite() /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite new_code = self.new_code() /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code format_whole_file = enforce_formatting() or code == format_code( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 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})' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_161.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert {}==snapshot({0: 5, 1: 5, 2: 5}) reported_flags: {'fix'} run: pytest --inline-snapshot= output: |assert {}==snapshot({0: 5, 1: 5, 2: 5}) source: assert {}==snapshot({0: 5, 1: 5, 2: 5}) set(): assert {}==snapshot({0: 5, 1: 5, 2: 5}) assert {}==snapshot({0: 5, 1: 5, 2: 5}) input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert {}==snapshot({0: 5, 1: 5, 2: 5}) reported_flags: {'fix'} run: pytest --inline-snapshot= output: |assert {}==snapshot({0: 5, 1: 5, 2: 5}) {'fix'}: assert {}==snapshot({0: 5, 1: 5, 2: 5}) assert {}==snapshot({}) input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert {}==snapshot({0: 5, 1: 5, 2: 5}) ----------------------------- Captured stderr call ----------------------------- Traceback (most recent call last): File "/tmp/autopkgtest.ImMzGl/autopkgtest_tmp/tests/conftest.py", line 114, in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) File "/tmp/pytest-of-unshare/pytest-0/test_generic0/test_159.py", line 9, in assert {}==snapshot({0: 5, 1: 5, 2: 5}) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError Traceback (most recent call last): File "/tmp/autopkgtest.ImMzGl/autopkgtest_tmp/tests/conftest.py", line 114, in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) File "/tmp/pytest-of-unshare/pytest-0/test_generic0/test_160.py", line 9, in assert {}==snapshot({0: 5, 1: 5, 2: 5}) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError ------------------------------ Captured log call ------------------------------- _________________ test_generic [{0: 5, 1: 5} -> {2: 8} ] __________________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_162.py:9: in assert {2: 8}==snapshot({0: 5, 1: 5}) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:133: in assign self.context.file._value_to_code(k), /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code return self._token_to_code(value_to_token(value)) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '2 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_162.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert {2: 8}==snapshot({0: 5, 1: 5}) ------------------------------ Captured log call ------------------------------- _________ test_generic [{0: 5, 1: 5, 2: 2+2} -> {2: 4} ] __________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_163.py:9: in assert {2: 4}==snapshot({0: 5, 1: 5, 2: 2+2}) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign result[key] = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_163.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert {2: 4}==snapshot({0: 5, 1: 5, 2: 2+2}) ------------------------------ Captured log call ------------------------------- ______________ test_generic [{0: 5, 1: 5, 2: 3} -> {2: 3} ] _______________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): s1 = source(code) print("source:", code) assert set(s1.flags) == flags assert ("fix" in flags) == s1.error for f in all_flags: c3 = build( [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] ) new_code = f"assert {c2}==snapshot({c3})" print(f"{set(f)}:") print(" ", code) print(" ", new_code) > s2 = s1.run(*f) tests/test_preserve_values.py:245: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:137: in run recorder.fix_all() /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all file.rewrite() /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite new_code = self.new_code() /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code format_whole_file = enforce_formatting() or code == format_code( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 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})' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_166.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert {2: 3}==snapshot({0: 5, 1: 5, 2: 3}) reported_flags: {'fix'} run: pytest --inline-snapshot= output: |assert {2: 3}==snapshot({0: 5, 1: 5, 2: 3}) source: assert {2: 3}==snapshot({0: 5, 1: 5, 2: 3}) set(): assert {2: 3}==snapshot({0: 5, 1: 5, 2: 3}) assert {2: 3}==snapshot({0: 5, 1: 5, 2: 3}) input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert {2: 3}==snapshot({0: 5, 1: 5, 2: 3}) reported_flags: {'fix'} run: pytest --inline-snapshot= output: |assert {2: 3}==snapshot({0: 5, 1: 5, 2: 3}) {'fix'}: assert {2: 3}==snapshot({0: 5, 1: 5, 2: 3}) assert {2: 3}==snapshot({2: 3}) input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert {2: 3}==snapshot({0: 5, 1: 5, 2: 3}) ----------------------------- Captured stderr call ----------------------------- Traceback (most recent call last): File "/tmp/autopkgtest.ImMzGl/autopkgtest_tmp/tests/conftest.py", line 114, in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) File "/tmp/pytest-of-unshare/pytest-0/test_generic0/test_164.py", line 9, in assert {2: 3}==snapshot({0: 5, 1: 5, 2: 3}) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError Traceback (most recent call last): File "/tmp/autopkgtest.ImMzGl/autopkgtest_tmp/tests/conftest.py", line 114, in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) File "/tmp/pytest-of-unshare/pytest-0/test_generic0/test_165.py", line 9, in assert {2: 3}==snapshot({0: 5, 1: 5, 2: 3}) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError ------------------------------ Captured log call ------------------------------- _________________ test_generic [{0: 5, 2: 5} -> {1: 8} ] __________________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_167.py:9: in assert {1: 8}==snapshot({0: 5, 2: 5}) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:133: in assign self.context.file._value_to_code(k), /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code return self._token_to_code(value_to_token(value)) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '1 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_167.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert {1: 8}==snapshot({0: 5, 2: 5}) ------------------------------ Captured log call ------------------------------- _________________ test_generic [{0: 5} -> {1: 8, 2: 8} ] __________________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_168.py:9: in assert {1: 8, 2: 8}==snapshot({0: 5}) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:133: in assign self.context.file._value_to_code(k), /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code return self._token_to_code(value_to_token(value)) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '1 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_168.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert {1: 8, 2: 8}==snapshot({0: 5}) ------------------------------ Captured log call ------------------------------- _________ test_generic [{0: 5, 2: 2+2} -> {1: 8, 2: 4} ] __________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_169.py:9: in assert {1: 8, 2: 4}==snapshot({0: 5, 2: 2+2}) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign result[key] = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_169.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert {1: 8, 2: 4}==snapshot({0: 5, 2: 2+2}) ------------------------------ Captured log call ------------------------------- ______________ test_generic [{0: 5, 2: 3} -> {1: 8, 2: 3} ] _______________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_170.py:9: in assert {1: 8, 2: 3}==snapshot({0: 5, 2: 3}) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:113: in assign self.context.file._value_to_code(k), /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code return self._token_to_code(value_to_token(value)) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '1 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_170.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert {1: 8, 2: 3}==snapshot({0: 5, 2: 3}) ------------------------------ Captured log call ------------------------------- _________ test_generic [{0: 5, 1: 2+2, 2: 5} -> {1: 4} ] __________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_171.py:9: in assert {1: 4}==snapshot({0: 5, 1: 2+2, 2: 5}) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign result[key] = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_171.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert {1: 4}==snapshot({0: 5, 1: 2+2, 2: 5}) ------------------------------ Captured log call ------------------------------- _________ test_generic [{0: 5, 1: 2+2} -> {1: 4, 2: 8} ] __________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_172.py:9: in assert {1: 4, 2: 8}==snapshot({0: 5, 1: 2+2}) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign result[key] = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_172.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert {1: 4, 2: 8}==snapshot({0: 5, 1: 2+2}) ------------------------------ Captured log call ------------------------------- _____ test_generic [{0: 5, 1: 2+2, 2: 2+2} -> {1: 4, 2: 4} ] ______ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_173.py:9: in assert {1: 4, 2: 4}==snapshot({0: 5, 1: 2+2, 2: 2+2}) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign result[key] = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_173.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert {1: 4, 2: 4}==snapshot({0: 5, 1: 2+2, 2: 2+2}) ------------------------------ Captured log call ------------------------------- ______ test_generic [{0: 5, 1: 2+2, 2: 3} -> {1: 4, 2: 3} ] _______ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_174.py:9: in assert {1: 4, 2: 3}==snapshot({0: 5, 1: 2+2, 2: 3}) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign result[key] = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_174.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert {1: 4, 2: 3}==snapshot({0: 5, 1: 2+2, 2: 3}) ------------------------------ Captured log call ------------------------------- ______________ test_generic [{0: 5, 1: 3, 2: 5} -> {1: 3} ] _______________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): s1 = source(code) print("source:", code) assert set(s1.flags) == flags assert ("fix" in flags) == s1.error for f in all_flags: c3 = build( [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] ) new_code = f"assert {c2}==snapshot({c3})" print(f"{set(f)}:") print(" ", code) print(" ", new_code) > s2 = s1.run(*f) tests/test_preserve_values.py:245: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:137: in run recorder.fix_all() /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all file.rewrite() /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite new_code = self.new_code() /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code format_whole_file = enforce_formatting() or code == format_code( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 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})' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_177.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert {1: 3}==snapshot({0: 5, 1: 3, 2: 5}) reported_flags: {'fix'} run: pytest --inline-snapshot= output: |assert {1: 3}==snapshot({0: 5, 1: 3, 2: 5}) source: assert {1: 3}==snapshot({0: 5, 1: 3, 2: 5}) set(): assert {1: 3}==snapshot({0: 5, 1: 3, 2: 5}) assert {1: 3}==snapshot({0: 5, 1: 3, 2: 5}) input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert {1: 3}==snapshot({0: 5, 1: 3, 2: 5}) reported_flags: {'fix'} run: pytest --inline-snapshot= output: |assert {1: 3}==snapshot({0: 5, 1: 3, 2: 5}) {'fix'}: assert {1: 3}==snapshot({0: 5, 1: 3, 2: 5}) assert {1: 3}==snapshot({1: 3}) input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert {1: 3}==snapshot({0: 5, 1: 3, 2: 5}) ----------------------------- Captured stderr call ----------------------------- Traceback (most recent call last): File "/tmp/autopkgtest.ImMzGl/autopkgtest_tmp/tests/conftest.py", line 114, in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) File "/tmp/pytest-of-unshare/pytest-0/test_generic0/test_175.py", line 9, in assert {1: 3}==snapshot({0: 5, 1: 3, 2: 5}) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError Traceback (most recent call last): File "/tmp/autopkgtest.ImMzGl/autopkgtest_tmp/tests/conftest.py", line 114, in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) File "/tmp/pytest-of-unshare/pytest-0/test_generic0/test_176.py", line 9, in assert {1: 3}==snapshot({0: 5, 1: 3, 2: 5}) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError ------------------------------ Captured log call ------------------------------- ______________ test_generic [{0: 5, 1: 3} -> {1: 3, 2: 8} ] _______________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_178.py:9: in assert {1: 3, 2: 8}==snapshot({0: 5, 1: 3}) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:133: in assign self.context.file._value_to_code(k), /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code return self._token_to_code(value_to_token(value)) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '2 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_178.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert {1: 3, 2: 8}==snapshot({0: 5, 1: 3}) ------------------------------ Captured log call ------------------------------- ______ test_generic [{0: 5, 1: 3, 2: 2+2} -> {1: 3, 2: 4} ] _______ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_179.py:9: in assert {1: 3, 2: 4}==snapshot({0: 5, 1: 3, 2: 2+2}) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign result[key] = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_179.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert {1: 3, 2: 4}==snapshot({0: 5, 1: 3, 2: 2+2}) ------------------------------ Captured log call ------------------------------- ___________ test_generic [{0: 5, 1: 3, 2: 3} -> {1: 3, 2: 3} ] ____________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): s1 = source(code) print("source:", code) assert set(s1.flags) == flags assert ("fix" in flags) == s1.error for f in all_flags: c3 = build( [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] ) new_code = f"assert {c2}==snapshot({c3})" print(f"{set(f)}:") print(" ", code) print(" ", new_code) > s2 = s1.run(*f) tests/test_preserve_values.py:245: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:137: in run recorder.fix_all() /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all file.rewrite() /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite new_code = self.new_code() /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code format_whole_file = enforce_formatting() or code == format_code( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 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})' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_182.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert {1: 3, 2: 3}==snapshot({0: 5, 1: 3, 2: 3}) reported_flags: {'fix'} run: pytest --inline-snapshot= output: |assert {1: 3, 2: 3}==snapshot({0: 5, 1: 3, 2: 3}) source: assert {1: 3, 2: 3}==snapshot({0: 5, 1: 3, 2: 3}) set(): assert {1: 3, 2: 3}==snapshot({0: 5, 1: 3, 2: 3}) assert {1: 3, 2: 3}==snapshot({0: 5, 1: 3, 2: 3}) input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert {1: 3, 2: 3}==snapshot({0: 5, 1: 3, 2: 3}) reported_flags: {'fix'} run: pytest --inline-snapshot= output: |assert {1: 3, 2: 3}==snapshot({0: 5, 1: 3, 2: 3}) {'fix'}: assert {1: 3, 2: 3}==snapshot({0: 5, 1: 3, 2: 3}) assert {1: 3, 2: 3}==snapshot({1: 3, 2: 3}) input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert {1: 3, 2: 3}==snapshot({0: 5, 1: 3, 2: 3}) ----------------------------- Captured stderr call ----------------------------- Traceback (most recent call last): File "/tmp/autopkgtest.ImMzGl/autopkgtest_tmp/tests/conftest.py", line 114, in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) File "/tmp/pytest-of-unshare/pytest-0/test_generic0/test_180.py", line 9, in assert {1: 3, 2: 3}==snapshot({0: 5, 1: 3, 2: 3}) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError Traceback (most recent call last): File "/tmp/autopkgtest.ImMzGl/autopkgtest_tmp/tests/conftest.py", line 114, in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) File "/tmp/pytest-of-unshare/pytest-0/test_generic0/test_181.py", line 9, in assert {1: 3, 2: 3}==snapshot({0: 5, 1: 3, 2: 3}) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError ------------------------------ Captured log call ------------------------------- _________________ test_generic [{1: 5, 2: 5} -> {0: 8} ] __________________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_183.py:9: in assert {0: 8}==snapshot({1: 5, 2: 5}) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:133: in assign self.context.file._value_to_code(k), /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code return self._token_to_code(value_to_token(value)) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '0 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_183.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert {0: 8}==snapshot({1: 5, 2: 5}) ------------------------------ Captured log call ------------------------------- _________________ test_generic [{1: 5} -> {0: 8, 2: 8} ] __________________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_184.py:9: in assert {0: 8, 2: 8}==snapshot({1: 5}) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:133: in assign self.context.file._value_to_code(k), /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code return self._token_to_code(value_to_token(value)) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '0 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_184.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert {0: 8, 2: 8}==snapshot({1: 5}) ------------------------------ Captured log call ------------------------------- _________ test_generic [{1: 5, 2: 2+2} -> {0: 8, 2: 4} ] __________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_185.py:9: in assert {0: 8, 2: 4}==snapshot({1: 5, 2: 2+2}) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign result[key] = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_185.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert {0: 8, 2: 4}==snapshot({1: 5, 2: 2+2}) ------------------------------ Captured log call ------------------------------- ______________ test_generic [{1: 5, 2: 3} -> {0: 8, 2: 3} ] _______________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_186.py:9: in assert {0: 8, 2: 3}==snapshot({1: 5, 2: 3}) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:113: in assign self.context.file._value_to_code(k), /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code return self._token_to_code(value_to_token(value)) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '0 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_186.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert {0: 8, 2: 3}==snapshot({1: 5, 2: 3}) ------------------------------ Captured log call ------------------------------- _________________ test_generic [{2: 5} -> {0: 8, 1: 8} ] __________________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_187.py:9: in assert {0: 8, 1: 8}==snapshot({2: 5}) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:133: in assign self.context.file._value_to_code(k), /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code return self._token_to_code(value_to_token(value)) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '0 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_187.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert {0: 8, 1: 8}==snapshot({2: 5}) ------------------------------ Captured log call ------------------------------- ________________ test_generic [{} -> {0: 8, 1: 8, 2: 8} ] _________________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_188.py:9: in assert {0: 8, 1: 8, 2: 8}==snapshot({}) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:133: in assign self.context.file._value_to_code(k), /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code return self._token_to_code(value_to_token(value)) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '0 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_188.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert {0: 8, 1: 8, 2: 8}==snapshot({}) ------------------------------ Captured log call ------------------------------- _________ test_generic [{2: 2+2} -> {0: 8, 1: 8, 2: 4} ] __________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_189.py:9: in assert {0: 8, 1: 8, 2: 4}==snapshot({2: 2+2}) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign result[key] = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_189.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert {0: 8, 1: 8, 2: 4}==snapshot({2: 2+2}) ------------------------------ Captured log call ------------------------------- ______________ test_generic [{2: 3} -> {0: 8, 1: 8, 2: 3} ] _______________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_190.py:9: in assert {0: 8, 1: 8, 2: 3}==snapshot({2: 3}) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:113: in assign self.context.file._value_to_code(k), /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code return self._token_to_code(value_to_token(value)) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '0 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_190.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert {0: 8, 1: 8, 2: 3}==snapshot({2: 3}) ------------------------------ Captured log call ------------------------------- _________ test_generic [{1: 2+2, 2: 5} -> {0: 8, 1: 4} ] __________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_191.py:9: in assert {0: 8, 1: 4}==snapshot({1: 2+2, 2: 5}) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign result[key] = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_191.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert {0: 8, 1: 4}==snapshot({1: 2+2, 2: 5}) ------------------------------ Captured log call ------------------------------- _________ test_generic [{1: 2+2} -> {0: 8, 1: 4, 2: 8} ] __________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_192.py:9: in assert {0: 8, 1: 4, 2: 8}==snapshot({1: 2+2}) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign result[key] = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_192.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert {0: 8, 1: 4, 2: 8}==snapshot({1: 2+2}) ------------------------------ Captured log call ------------------------------- _____ test_generic [{1: 2+2, 2: 2+2} -> {0: 8, 1: 4, 2: 4} ] ______ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_193.py:9: in assert {0: 8, 1: 4, 2: 4}==snapshot({1: 2+2, 2: 2+2}) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign result[key] = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_193.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert {0: 8, 1: 4, 2: 4}==snapshot({1: 2+2, 2: 2+2}) ------------------------------ Captured log call ------------------------------- ______ test_generic [{1: 2+2, 2: 3} -> {0: 8, 1: 4, 2: 3} ] _______ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_194.py:9: in assert {0: 8, 1: 4, 2: 3}==snapshot({1: 2+2, 2: 3}) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign result[key] = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_194.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert {0: 8, 1: 4, 2: 3}==snapshot({1: 2+2, 2: 3}) ------------------------------ Captured log call ------------------------------- ______________ test_generic [{1: 3, 2: 5} -> {0: 8, 1: 3} ] _______________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_195.py:9: in assert {0: 8, 1: 3}==snapshot({1: 3, 2: 5}) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:113: in assign self.context.file._value_to_code(k), /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code return self._token_to_code(value_to_token(value)) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '0 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_195.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert {0: 8, 1: 3}==snapshot({1: 3, 2: 5}) ------------------------------ Captured log call ------------------------------- ______________ test_generic [{1: 3} -> {0: 8, 1: 3, 2: 8} ] _______________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_196.py:9: in assert {0: 8, 1: 3, 2: 8}==snapshot({1: 3}) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:113: in assign self.context.file._value_to_code(k), /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code return self._token_to_code(value_to_token(value)) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '0 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_196.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert {0: 8, 1: 3, 2: 8}==snapshot({1: 3}) ------------------------------ Captured log call ------------------------------- ______ test_generic [{1: 3, 2: 2+2} -> {0: 8, 1: 3, 2: 4} ] _______ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_197.py:9: in assert {0: 8, 1: 3, 2: 4}==snapshot({1: 3, 2: 2+2}) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:113: in assign self.context.file._value_to_code(k), /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code return self._token_to_code(value_to_token(value)) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '0 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_197.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert {0: 8, 1: 3, 2: 4}==snapshot({1: 3, 2: 2+2}) ------------------------------ Captured log call ------------------------------- ___________ test_generic [{1: 3, 2: 3} -> {0: 8, 1: 3, 2: 3} ] ____________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_198.py:9: in assert {0: 8, 1: 3, 2: 3}==snapshot({1: 3, 2: 3}) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:113: in assign self.context.file._value_to_code(k), /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code return self._token_to_code(value_to_token(value)) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '0 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_198.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert {0: 8, 1: 3, 2: 3}==snapshot({1: 3, 2: 3}) ------------------------------ Captured log call ------------------------------- _________ test_generic [{0: 2+2, 1: 5, 2: 5} -> {0: 4} ] __________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_199.py:9: in assert {0: 4}==snapshot({0: 2+2, 1: 5, 2: 5}) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign result[key] = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_199.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert {0: 4}==snapshot({0: 2+2, 1: 5, 2: 5}) ------------------------------ Captured log call ------------------------------- _________ test_generic [{0: 2+2, 1: 5} -> {0: 4, 2: 8} ] __________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_200.py:9: in assert {0: 4, 2: 8}==snapshot({0: 2+2, 1: 5}) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign result[key] = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_200.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert {0: 4, 2: 8}==snapshot({0: 2+2, 1: 5}) ------------------------------ Captured log call ------------------------------- _____ test_generic [{0: 2+2, 1: 5, 2: 2+2} -> {0: 4, 2: 4} ] ______ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_201.py:9: in assert {0: 4, 2: 4}==snapshot({0: 2+2, 1: 5, 2: 2+2}) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign result[key] = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_201.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert {0: 4, 2: 4}==snapshot({0: 2+2, 1: 5, 2: 2+2}) ------------------------------ Captured log call ------------------------------- ______ test_generic [{0: 2+2, 1: 5, 2: 3} -> {0: 4, 2: 3} ] _______ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_202.py:9: in assert {0: 4, 2: 3}==snapshot({0: 2+2, 1: 5, 2: 3}) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign result[key] = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_202.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert {0: 4, 2: 3}==snapshot({0: 2+2, 1: 5, 2: 3}) ------------------------------ Captured log call ------------------------------- _________ test_generic [{0: 2+2, 2: 5} -> {0: 4, 1: 8} ] __________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_203.py:9: in assert {0: 4, 1: 8}==snapshot({0: 2+2, 2: 5}) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign result[key] = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_203.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert {0: 4, 1: 8}==snapshot({0: 2+2, 2: 5}) ------------------------------ Captured log call ------------------------------- _________ test_generic [{0: 2+2} -> {0: 4, 1: 8, 2: 8} ] __________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_204.py:9: in assert {0: 4, 1: 8, 2: 8}==snapshot({0: 2+2}) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign result[key] = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_204.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert {0: 4, 1: 8, 2: 8}==snapshot({0: 2+2}) ------------------------------ Captured log call ------------------------------- _____ test_generic [{0: 2+2, 2: 2+2} -> {0: 4, 1: 8, 2: 4} ] ______ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_205.py:9: in assert {0: 4, 1: 8, 2: 4}==snapshot({0: 2+2, 2: 2+2}) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign result[key] = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_205.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert {0: 4, 1: 8, 2: 4}==snapshot({0: 2+2, 2: 2+2}) ------------------------------ Captured log call ------------------------------- ______ test_generic [{0: 2+2, 2: 3} -> {0: 4, 1: 8, 2: 3} ] _______ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_206.py:9: in assert {0: 4, 1: 8, 2: 3}==snapshot({0: 2+2, 2: 3}) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign result[key] = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_206.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert {0: 4, 1: 8, 2: 3}==snapshot({0: 2+2, 2: 3}) ------------------------------ Captured log call ------------------------------- _____ test_generic [{0: 2+2, 1: 2+2, 2: 5} -> {0: 4, 1: 4} ] ______ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_207.py:9: in assert {0: 4, 1: 4}==snapshot({0: 2+2, 1: 2+2, 2: 5}) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign result[key] = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_207.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert {0: 4, 1: 4}==snapshot({0: 2+2, 1: 2+2, 2: 5}) ------------------------------ Captured log call ------------------------------- _____ test_generic [{0: 2+2, 1: 2+2} -> {0: 4, 1: 4, 2: 8} ] ______ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_208.py:9: in assert {0: 4, 1: 4, 2: 8}==snapshot({0: 2+2, 1: 2+2}) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign result[key] = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_208.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert {0: 4, 1: 4, 2: 8}==snapshot({0: 2+2, 1: 2+2}) ------------------------------ Captured log call ------------------------------- ____ test_generic [{0: 2+2, 1: 2+2, 2: 2+2} -> {0: 4, 1: 4, 2: 4} ] ____ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_209.py:9: in assert {0: 4, 1: 4, 2: 4}==snapshot({0: 2+2, 1: 2+2, 2: 2+2}) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign result[key] = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_209.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert {0: 4, 1: 4, 2: 4}==snapshot({0: 2+2, 1: 2+2, 2: 2+2}) ------------------------------ Captured log call ------------------------------- _____ test_generic [{0: 2+2, 1: 2+2, 2: 3} -> {0: 4, 1: 4, 2: 3} ] _____ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_210.py:9: in assert {0: 4, 1: 4, 2: 3}==snapshot({0: 2+2, 1: 2+2, 2: 3}) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign result[key] = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_210.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert {0: 4, 1: 4, 2: 3}==snapshot({0: 2+2, 1: 2+2, 2: 3}) ------------------------------ Captured log call ------------------------------- ______ test_generic [{0: 2+2, 1: 3, 2: 5} -> {0: 4, 1: 3} ] _______ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_211.py:9: in assert {0: 4, 1: 3}==snapshot({0: 2+2, 1: 3, 2: 5}) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign result[key] = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_211.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert {0: 4, 1: 3}==snapshot({0: 2+2, 1: 3, 2: 5}) ------------------------------ Captured log call ------------------------------- ______ test_generic [{0: 2+2, 1: 3} -> {0: 4, 1: 3, 2: 8} ] _______ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_212.py:9: in assert {0: 4, 1: 3, 2: 8}==snapshot({0: 2+2, 1: 3}) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign result[key] = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_212.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert {0: 4, 1: 3, 2: 8}==snapshot({0: 2+2, 1: 3}) ------------------------------ Captured log call ------------------------------- _____ test_generic [{0: 2+2, 1: 3, 2: 2+2} -> {0: 4, 1: 3, 2: 4} ] _____ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_213.py:9: in assert {0: 4, 1: 3, 2: 4}==snapshot({0: 2+2, 1: 3, 2: 2+2}) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign result[key] = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_213.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert {0: 4, 1: 3, 2: 4}==snapshot({0: 2+2, 1: 3, 2: 2+2}) ------------------------------ Captured log call ------------------------------- ______ test_generic [{0: 2+2, 1: 3, 2: 3} -> {0: 4, 1: 3, 2: 3} ] ______ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_214.py:9: in assert {0: 4, 1: 3, 2: 3}==snapshot({0: 2+2, 1: 3, 2: 3}) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign result[key] = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_214.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert {0: 4, 1: 3, 2: 3}==snapshot({0: 2+2, 1: 3, 2: 3}) ------------------------------ Captured log call ------------------------------- ______________ test_generic [{0: 3, 1: 5, 2: 5} -> {0: 3} ] _______________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): s1 = source(code) print("source:", code) assert set(s1.flags) == flags assert ("fix" in flags) == s1.error for f in all_flags: c3 = build( [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] ) new_code = f"assert {c2}==snapshot({c3})" print(f"{set(f)}:") print(" ", code) print(" ", new_code) > s2 = s1.run(*f) tests/test_preserve_values.py:245: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:137: in run recorder.fix_all() /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all file.rewrite() /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite new_code = self.new_code() /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code format_whole_file = enforce_formatting() or code == format_code( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 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})' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_217.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert {0: 3}==snapshot({0: 3, 1: 5, 2: 5}) reported_flags: {'fix'} run: pytest --inline-snapshot= output: |assert {0: 3}==snapshot({0: 3, 1: 5, 2: 5}) source: assert {0: 3}==snapshot({0: 3, 1: 5, 2: 5}) set(): assert {0: 3}==snapshot({0: 3, 1: 5, 2: 5}) assert {0: 3}==snapshot({0: 3, 1: 5, 2: 5}) input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert {0: 3}==snapshot({0: 3, 1: 5, 2: 5}) reported_flags: {'fix'} run: pytest --inline-snapshot= output: |assert {0: 3}==snapshot({0: 3, 1: 5, 2: 5}) {'fix'}: assert {0: 3}==snapshot({0: 3, 1: 5, 2: 5}) assert {0: 3}==snapshot({0: 3}) input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert {0: 3}==snapshot({0: 3, 1: 5, 2: 5}) ----------------------------- Captured stderr call ----------------------------- Traceback (most recent call last): File "/tmp/autopkgtest.ImMzGl/autopkgtest_tmp/tests/conftest.py", line 114, in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) File "/tmp/pytest-of-unshare/pytest-0/test_generic0/test_215.py", line 9, in assert {0: 3}==snapshot({0: 3, 1: 5, 2: 5}) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError Traceback (most recent call last): File "/tmp/autopkgtest.ImMzGl/autopkgtest_tmp/tests/conftest.py", line 114, in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) File "/tmp/pytest-of-unshare/pytest-0/test_generic0/test_216.py", line 9, in assert {0: 3}==snapshot({0: 3, 1: 5, 2: 5}) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError ------------------------------ Captured log call ------------------------------- ______________ test_generic [{0: 3, 1: 5} -> {0: 3, 2: 8} ] _______________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_218.py:9: in assert {0: 3, 2: 8}==snapshot({0: 3, 1: 5}) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:133: in assign self.context.file._value_to_code(k), /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code return self._token_to_code(value_to_token(value)) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '2 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_218.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert {0: 3, 2: 8}==snapshot({0: 3, 1: 5}) ------------------------------ Captured log call ------------------------------- ______ test_generic [{0: 3, 1: 5, 2: 2+2} -> {0: 3, 2: 4} ] _______ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_219.py:9: in assert {0: 3, 2: 4}==snapshot({0: 3, 1: 5, 2: 2+2}) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign result[key] = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_219.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert {0: 3, 2: 4}==snapshot({0: 3, 1: 5, 2: 2+2}) ------------------------------ Captured log call ------------------------------- ___________ test_generic [{0: 3, 1: 5, 2: 3} -> {0: 3, 2: 3} ] ____________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): s1 = source(code) print("source:", code) assert set(s1.flags) == flags assert ("fix" in flags) == s1.error for f in all_flags: c3 = build( [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] ) new_code = f"assert {c2}==snapshot({c3})" print(f"{set(f)}:") print(" ", code) print(" ", new_code) > s2 = s1.run(*f) tests/test_preserve_values.py:245: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:137: in run recorder.fix_all() /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all file.rewrite() /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite new_code = self.new_code() /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code format_whole_file = enforce_formatting() or code == format_code( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 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})' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_222.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert {0: 3, 2: 3}==snapshot({0: 3, 1: 5, 2: 3}) reported_flags: {'fix'} run: pytest --inline-snapshot= output: |assert {0: 3, 2: 3}==snapshot({0: 3, 1: 5, 2: 3}) source: assert {0: 3, 2: 3}==snapshot({0: 3, 1: 5, 2: 3}) set(): assert {0: 3, 2: 3}==snapshot({0: 3, 1: 5, 2: 3}) assert {0: 3, 2: 3}==snapshot({0: 3, 1: 5, 2: 3}) input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert {0: 3, 2: 3}==snapshot({0: 3, 1: 5, 2: 3}) reported_flags: {'fix'} run: pytest --inline-snapshot= output: |assert {0: 3, 2: 3}==snapshot({0: 3, 1: 5, 2: 3}) {'fix'}: assert {0: 3, 2: 3}==snapshot({0: 3, 1: 5, 2: 3}) assert {0: 3, 2: 3}==snapshot({0: 3, 2: 3}) input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert {0: 3, 2: 3}==snapshot({0: 3, 1: 5, 2: 3}) ----------------------------- Captured stderr call ----------------------------- Traceback (most recent call last): File "/tmp/autopkgtest.ImMzGl/autopkgtest_tmp/tests/conftest.py", line 114, in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) File "/tmp/pytest-of-unshare/pytest-0/test_generic0/test_220.py", line 9, in assert {0: 3, 2: 3}==snapshot({0: 3, 1: 5, 2: 3}) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError Traceback (most recent call last): File "/tmp/autopkgtest.ImMzGl/autopkgtest_tmp/tests/conftest.py", line 114, in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) File "/tmp/pytest-of-unshare/pytest-0/test_generic0/test_221.py", line 9, in assert {0: 3, 2: 3}==snapshot({0: 3, 1: 5, 2: 3}) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError ------------------------------ Captured log call ------------------------------- ______________ test_generic [{0: 3, 2: 5} -> {0: 3, 1: 8} ] _______________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_223.py:9: in assert {0: 3, 1: 8}==snapshot({0: 3, 2: 5}) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:133: in assign self.context.file._value_to_code(k), /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code return self._token_to_code(value_to_token(value)) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '1 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_223.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert {0: 3, 1: 8}==snapshot({0: 3, 2: 5}) ------------------------------ Captured log call ------------------------------- ______________ test_generic [{0: 3} -> {0: 3, 1: 8, 2: 8} ] _______________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_224.py:9: in assert {0: 3, 1: 8, 2: 8}==snapshot({0: 3}) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:133: in assign self.context.file._value_to_code(k), /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code return self._token_to_code(value_to_token(value)) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '1 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_224.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert {0: 3, 1: 8, 2: 8}==snapshot({0: 3}) ------------------------------ Captured log call ------------------------------- ______ test_generic [{0: 3, 2: 2+2} -> {0: 3, 1: 8, 2: 4} ] _______ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_225.py:9: in assert {0: 3, 1: 8, 2: 4}==snapshot({0: 3, 2: 2+2}) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign result[key] = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_225.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert {0: 3, 1: 8, 2: 4}==snapshot({0: 3, 2: 2+2}) ------------------------------ Captured log call ------------------------------- ___________ test_generic [{0: 3, 2: 3} -> {0: 3, 1: 8, 2: 3} ] ____________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_226.py:9: in assert {0: 3, 1: 8, 2: 3}==snapshot({0: 3, 2: 3}) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:113: in assign self.context.file._value_to_code(k), /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code return self._token_to_code(value_to_token(value)) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '1 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_226.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert {0: 3, 1: 8, 2: 3}==snapshot({0: 3, 2: 3}) ------------------------------ Captured log call ------------------------------- ______ test_generic [{0: 3, 1: 2+2, 2: 5} -> {0: 3, 1: 4} ] _______ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_227.py:9: in assert {0: 3, 1: 4}==snapshot({0: 3, 1: 2+2, 2: 5}) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign result[key] = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_227.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert {0: 3, 1: 4}==snapshot({0: 3, 1: 2+2, 2: 5}) ------------------------------ Captured log call ------------------------------- ______ test_generic [{0: 3, 1: 2+2} -> {0: 3, 1: 4, 2: 8} ] _______ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_228.py:9: in assert {0: 3, 1: 4, 2: 8}==snapshot({0: 3, 1: 2+2}) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign result[key] = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_228.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert {0: 3, 1: 4, 2: 8}==snapshot({0: 3, 1: 2+2}) ------------------------------ Captured log call ------------------------------- _____ test_generic [{0: 3, 1: 2+2, 2: 2+2} -> {0: 3, 1: 4, 2: 4} ] _____ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_229.py:9: in assert {0: 3, 1: 4, 2: 4}==snapshot({0: 3, 1: 2+2, 2: 2+2}) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign result[key] = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_229.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert {0: 3, 1: 4, 2: 4}==snapshot({0: 3, 1: 2+2, 2: 2+2}) ------------------------------ Captured log call ------------------------------- ______ test_generic [{0: 3, 1: 2+2, 2: 3} -> {0: 3, 1: 4, 2: 3} ] ______ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_230.py:9: in assert {0: 3, 1: 4, 2: 3}==snapshot({0: 3, 1: 2+2, 2: 3}) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign result[key] = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_230.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert {0: 3, 1: 4, 2: 3}==snapshot({0: 3, 1: 2+2, 2: 3}) ------------------------------ Captured log call ------------------------------- ___________ test_generic [{0: 3, 1: 3, 2: 5} -> {0: 3, 1: 3} ] ____________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): s1 = source(code) print("source:", code) assert set(s1.flags) == flags assert ("fix" in flags) == s1.error for f in all_flags: c3 = build( [(spec[1] if spec[3] & f else spec[0]) for spec in value_specs] ) new_code = f"assert {c2}==snapshot({c3})" print(f"{set(f)}:") print(" ", code) print(" ", new_code) > s2 = s1.run(*f) tests/test_preserve_values.py:245: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:137: in run recorder.fix_all() /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all file.rewrite() /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite new_code = self.new_code() /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code format_whole_file = enforce_formatting() or code == format_code( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 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})' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_233.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert {0: 3, 1: 3}==snapshot({0: 3, 1: 3, 2: 5}) reported_flags: {'fix'} run: pytest --inline-snapshot= output: |assert {0: 3, 1: 3}==snapshot({0: 3, 1: 3, 2: 5}) source: assert {0: 3, 1: 3}==snapshot({0: 3, 1: 3, 2: 5}) set(): assert {0: 3, 1: 3}==snapshot({0: 3, 1: 3, 2: 5}) assert {0: 3, 1: 3}==snapshot({0: 3, 1: 3, 2: 5}) input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert {0: 3, 1: 3}==snapshot({0: 3, 1: 3, 2: 5}) reported_flags: {'fix'} run: pytest --inline-snapshot= output: |assert {0: 3, 1: 3}==snapshot({0: 3, 1: 3, 2: 5}) {'fix'}: assert {0: 3, 1: 3}==snapshot({0: 3, 1: 3, 2: 5}) assert {0: 3, 1: 3}==snapshot({0: 3, 1: 3}) input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert {0: 3, 1: 3}==snapshot({0: 3, 1: 3, 2: 5}) ----------------------------- Captured stderr call ----------------------------- Traceback (most recent call last): File "/tmp/autopkgtest.ImMzGl/autopkgtest_tmp/tests/conftest.py", line 114, in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) File "/tmp/pytest-of-unshare/pytest-0/test_generic0/test_231.py", line 9, in assert {0: 3, 1: 3}==snapshot({0: 3, 1: 3, 2: 5}) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError Traceback (most recent call last): File "/tmp/autopkgtest.ImMzGl/autopkgtest_tmp/tests/conftest.py", line 114, in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) File "/tmp/pytest-of-unshare/pytest-0/test_generic0/test_232.py", line 9, in assert {0: 3, 1: 3}==snapshot({0: 3, 1: 3, 2: 5}) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError ------------------------------ Captured log call ------------------------------- ___________ test_generic [{0: 3, 1: 3} -> {0: 3, 1: 3, 2: 8} ] ____________ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_234.py:9: in assert {0: 3, 1: 3, 2: 8}==snapshot({0: 3, 1: 3}) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:133: in assign self.context.file._value_to_code(k), /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:37: in _value_to_code return self._token_to_code(value_to_token(value)) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '2 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_234.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert {0: 3, 1: 3, 2: 8}==snapshot({0: 3, 1: 3}) ------------------------------ Captured log call ------------------------------- ______ test_generic [{0: 3, 1: 3, 2: 2+2} -> {0: 3, 1: 3, 2: 4} ] ______ source = .w at 0x7f6a3eaf2340> subtests = SubTests(ihook=<_pytest.config.compat.PathAwareHookProxy object at 0x7f6a42230710>, suspend_capture_ctx= _capture_fixture=None>>, request=>) def test_generic(source, subtests): for braces in ("[]", "()", "{}"): for value_specs in itertools.product(stuff, repeat=3): flags = set().union(*[e[3] for e in value_specs]) all_flags = { frozenset(x) - {""} for x in itertools.combinations_with_replacement( flags | {""}, len(flags) ) } def build(value_lists): value_lists = list(value_lists) if braces == "{}": values = [ f"{i}: {value_list[0]}" for i, value_list in enumerate(value_lists) if value_list ] else: values = [x for value_list in value_lists for x in value_list] code = ", ".join(values) comma = "" if len(values) == 1 and braces == "()": comma = "," return f"{braces[0]}{code}{comma}{braces[1]}" c1 = build(spec[0] for spec in value_specs) c2 = build(spec[1] for spec in value_specs) code = f"assert {c2}==snapshot({c1})" named_flags = ", ".join(flags) with subtests.test(f"{c1} -> {c2} <{named_flags}>"): > s1 = source(code) tests/test_preserve_values.py:229: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_generic0/test_235.py:9: in assert {0: 3, 1: 3, 2: 4}==snapshot({0: 3, 1: 3, 2: 2+2}) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/dict_adapter.py:106: in assign result[key] = yield from self.get_adapter( /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_generic0/test_235.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert {0: 3, 1: 3, 2: 4}==snapshot({0: 3, 1: 3, 2: 2+2}) ------------------------------ Captured log call ------------------------------- ________________________ test_pydantic_create_snapshot _________________________ def test_pydantic_create_snapshot(): Example( """ from pydantic import BaseModel from inline_snapshot import snapshot class M(BaseModel): size:int name:str age:int=4 def test_pydantic(): m=M(size=5,name="Tom") assert m==snapshot() assert m.dict()==snapshot() """ > ).run_pytest( ["--inline-snapshot=create"], changed_files=snapshot( { "test_something.py": """\ from pydantic import BaseModel from inline_snapshot import snapshot class M(BaseModel): size:int name:str age:int=4 def test_pydantic(): m=M(size=5,name="Tom") assert m==snapshot(M(size=5, name="Tom")) assert m.dict()==snapshot({"size": 5, "name": "Tom", "age": 4}) \ """ } ), ).run_pytest( ["--inline-snapshot=disable"] ) tests/test_pydantic.py:23: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = args = ['--inline-snapshot=create'] def run_pytest( self, args: list[str] = [], *, term_columns=80, env: dict[str, str] = {}, changed_files: Snapshot[dict[str, str]] | None = None, report: Snapshot[str] | None = None, stderr: Snapshot[str] | None = None, returncode: Snapshot[int] | None = None, ) -> Example: """Run pytest with the given args and env variables in an seperate process. It can be used to test the interaction between your code and pytest, but it is a bit slower than `run_inline` Parameters: args: pytest arguments like "--inline-snapshot=fix" env: dict of environment variables changed_files: snapshot of files which are changed by this run. report: snapshot of the report at the end of the pytest run. stderr: pytest stderr output returncode: snapshot of the pytest returncode. Returns: A new Example instance which contains the changed files. """ with TemporaryDirectory() as dir: tmp_path = Path(dir) self._write_files(tmp_path) cmd = [sys.executable, "-m", "pytest", *args] command_env = dict(os.environ) command_env["TERM"] = "unknown" command_env["COLUMNS"] = str( term_columns + 1 if platform.system() == "Windows" else term_columns ) command_env.pop("CI", None) command_env.update(env) result = sp.run(cmd, cwd=tmp_path, capture_output=True, env=command_env) print("run>", *cmd) print("stdout:") print(result.stdout.decode()) print("stderr:") print(result.stderr.decode()) if returncode is not None: assert result.returncode == returncode if stderr is not None: assert result.stderr.decode() == stderr if report is not None: report_list = [] record = False for line in result.stdout.decode().splitlines(): line = line.strip() if line.startswith("===="): record = False if record and line: report_list.append(line) if line.startswith("====") and "inline snapshot" in line: record = True report_str = "\n".join(report_list) assert normalize(report_str) == report, repr(report_str) if changed_files is not None: current_files = {} for name, content in sorted(self._read_files(tmp_path).items()): if name not in self.files or self.files[name] != content: current_files[name] = content > assert changed_files == current_files E AssertionError: assert {'test_someth... 4})\n\n '} == {} E E Left contains 1 more item: E {'test_something.py': '\n' E 'from pydantic import BaseModel\n' E 'from inline_snapshot import snapshot\n' E '\n' E 'class M(BaseModel):\n'... E E ...Full output truncated (12 lines hidden), use '-vv' to show /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:327: AssertionError ----------------------------- Captured stdout call ----------------------------- file: test_something.py from pydantic import BaseModel from inline_snapshot import snapshot class M(BaseModel): size:int name:str age:int=4 def test_pydantic(): m=M(size=5,name="Tom") assert m==snapshot() assert m.dict()==snapshot() run> /usr/bin/python3.12 -m pytest --inline-snapshot=create stdout: ============================= test session starts ============================== platform linux -- Python 3.12.8, pytest-8.3.4, pluggy-1.5.0 rootdir: /tmp/tmpfuyda906 plugins: inline-snapshot-0.19.3, mock-3.14.0, hypothesis-6.124.0, time-machine-2.16.0, subtests-0.13.1, pytest_freezer-0.4.9 collected 1 item test_something.py F [100%] =================================== FAILURES =================================== ________________________________ test_pydantic _________________________________ def test_pydantic(): m=M(size=5,name="Tom") > assert m==snapshot() test_something.py:12: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '', filename = PosixPath('/tmp/tmpfuyda906/test_something.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError =============================== inline snapshot ================================ =========================== short test summary info ============================ FAILED test_something.py::test_pydantic - TypeError: CliRunner.__init__() got... ============================== 1 failed in 0.16s =============================== stderr: ___________________________ test_pydantic_field_repr ___________________________ def test_pydantic_field_repr(): Example( """\ from inline_snapshot import snapshot from pydantic import BaseModel,Field class container(BaseModel): a: int b: int = Field(default=5,repr=False) assert container(a=1,b=5) == snapshot() """ > ).run_pytest( ["--inline-snapshot=create"], changed_files=snapshot( { "test_something.py": """\ from inline_snapshot import snapshot from pydantic import BaseModel,Field class container(BaseModel): a: int b: int = Field(default=5,repr=False) assert container(a=1,b=5) == snapshot(container(a=1)) """ } ), ).run_pytest( ["--inline-snapshot=disable"] ) tests/test_pydantic.py:64: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = args = ['--inline-snapshot=create'] def run_pytest( self, args: list[str] = [], *, term_columns=80, env: dict[str, str] = {}, changed_files: Snapshot[dict[str, str]] | None = None, report: Snapshot[str] | None = None, stderr: Snapshot[str] | None = None, returncode: Snapshot[int] | None = None, ) -> Example: """Run pytest with the given args and env variables in an seperate process. It can be used to test the interaction between your code and pytest, but it is a bit slower than `run_inline` Parameters: args: pytest arguments like "--inline-snapshot=fix" env: dict of environment variables changed_files: snapshot of files which are changed by this run. report: snapshot of the report at the end of the pytest run. stderr: pytest stderr output returncode: snapshot of the pytest returncode. Returns: A new Example instance which contains the changed files. """ with TemporaryDirectory() as dir: tmp_path = Path(dir) self._write_files(tmp_path) cmd = [sys.executable, "-m", "pytest", *args] command_env = dict(os.environ) command_env["TERM"] = "unknown" command_env["COLUMNS"] = str( term_columns + 1 if platform.system() == "Windows" else term_columns ) command_env.pop("CI", None) command_env.update(env) result = sp.run(cmd, cwd=tmp_path, capture_output=True, env=command_env) print("run>", *cmd) print("stdout:") print(result.stdout.decode()) print("stderr:") print(result.stderr.decode()) if returncode is not None: assert result.returncode == returncode if stderr is not None: assert result.stderr.decode() == stderr if report is not None: report_list = [] record = False for line in result.stdout.decode().splitlines(): line = line.strip() if line.startswith("===="): record = False if record and line: report_list.append(line) if line.startswith("====") and "inline snapshot" in line: record = True report_str = "\n".join(report_list) assert normalize(report_str) == report, repr(report_str) if changed_files is not None: current_files = {} for name, content in sorted(self._read_files(tmp_path).items()): if name not in self.files or self.files[name] != content: current_files[name] = content > assert changed_files == current_files E AssertionError: assert {'test_someth...iner(a=1))\n'} == {} E E Left contains 1 more item: E {'test_something.py': 'from inline_snapshot import snapshot\n' E 'from pydantic import BaseModel,Field\n' E '\n' E 'class container(BaseModel):\n' E ' a: int\n'... E E ...Full output truncated (4 lines hidden), use '-vv' to show /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:327: AssertionError ----------------------------- Captured stdout call ----------------------------- file: test_something.py from inline_snapshot import snapshot from pydantic import BaseModel,Field class container(BaseModel): a: int b: int = Field(default=5,repr=False) assert container(a=1,b=5) == snapshot() run> /usr/bin/python3.12 -m pytest --inline-snapshot=create stdout: ============================= test session starts ============================== platform linux -- Python 3.12.8, pytest-8.3.4, pluggy-1.5.0 rootdir: /tmp/tmp4dtawobv plugins: inline-snapshot-0.19.3, mock-3.14.0, hypothesis-6.124.0, time-machine-2.16.0, subtests-0.13.1, pytest_freezer-0.4.9 collected 0 items / 1 error ==================================== ERRORS ==================================== ______________________ ERROR collecting test_something.py ______________________ test_something.py:8: in assert container(a=1,b=5) == snapshot() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: in format_code runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' =============================== inline snapshot ================================ =========================== short test summary info ============================ ERROR test_something.py - TypeError: CliRunner.__init__() got an unexpected k... !!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!! =============================== 1 error in 0.21s =============================== stderr: _________________________ test_pydantic_default_value __________________________ def test_pydantic_default_value(): Example( """\ from inline_snapshot import snapshot,Is from dataclasses import dataclass,field from pydantic import BaseModel,Field class A(BaseModel): a:int b:int=2 c:list=Field(default_factory=list) def test_something(): assert A(a=1) == snapshot(A(a=1,b=2,c=[])) """ > ).run_pytest( ["--inline-snapshot=update"], changed_files=snapshot( { "test_something.py": """\ from inline_snapshot import snapshot,Is from dataclasses import dataclass,field from pydantic import BaseModel,Field class A(BaseModel): a:int b:int=2 c:list=Field(default_factory=list) def test_something(): assert A(a=1) == snapshot(A(a=1)) """ } ), ) tests/test_pydantic.py:100: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = args = ['--inline-snapshot=update'] def run_pytest( self, args: list[str] = [], *, term_columns=80, env: dict[str, str] = {}, changed_files: Snapshot[dict[str, str]] | None = None, report: Snapshot[str] | None = None, stderr: Snapshot[str] | None = None, returncode: Snapshot[int] | None = None, ) -> Example: """Run pytest with the given args and env variables in an seperate process. It can be used to test the interaction between your code and pytest, but it is a bit slower than `run_inline` Parameters: args: pytest arguments like "--inline-snapshot=fix" env: dict of environment variables changed_files: snapshot of files which are changed by this run. report: snapshot of the report at the end of the pytest run. stderr: pytest stderr output returncode: snapshot of the pytest returncode. Returns: A new Example instance which contains the changed files. """ with TemporaryDirectory() as dir: tmp_path = Path(dir) self._write_files(tmp_path) cmd = [sys.executable, "-m", "pytest", *args] command_env = dict(os.environ) command_env["TERM"] = "unknown" command_env["COLUMNS"] = str( term_columns + 1 if platform.system() == "Windows" else term_columns ) command_env.pop("CI", None) command_env.update(env) result = sp.run(cmd, cwd=tmp_path, capture_output=True, env=command_env) print("run>", *cmd) print("stdout:") print(result.stdout.decode()) print("stderr:") print(result.stderr.decode()) if returncode is not None: assert result.returncode == returncode if stderr is not None: assert result.stderr.decode() == stderr if report is not None: report_list = [] record = False for line in result.stdout.decode().splitlines(): line = line.strip() if line.startswith("===="): record = False if record and line: report_list.append(line) if line.startswith("====") and "inline snapshot" in line: record = True report_str = "\n".join(report_list) assert normalize(report_str) == report, repr(report_str) if changed_files is not None: current_files = {} for name, content in sorted(self._read_files(tmp_path).items()): if name not in self.files or self.files[name] != content: current_files[name] = content > assert changed_files == current_files E AssertionError: assert {'test_someth...ot(A(a=1))\n'} == {} E E Left contains 1 more item: E {'test_something.py': 'from inline_snapshot import snapshot,Is\n' E 'from dataclasses import dataclass,field\n' E 'from pydantic import BaseModel,Field\n' E '\n' E 'class A(BaseModel):\n'... E E ...Full output truncated (7 lines hidden), use '-vv' to show /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:327: AssertionError ----------------------------- Captured stdout call ----------------------------- file: test_something.py from inline_snapshot import snapshot,Is from dataclasses import dataclass,field from pydantic import BaseModel,Field class A(BaseModel): a:int b:int=2 c:list=Field(default_factory=list) def test_something(): assert A(a=1) == snapshot(A(a=1,b=2,c=[])) run> /usr/bin/python3.12 -m pytest --inline-snapshot=update stdout: ============================= test session starts ============================== platform linux -- Python 3.12.8, pytest-8.3.4, pluggy-1.5.0 rootdir: /tmp/tmp4v47e54q plugins: inline-snapshot-0.19.3, mock-3.14.0, hypothesis-6.124.0, time-machine-2.16.0, subtests-0.13.1, pytest_freezer-0.4.9 collected 1 item test_something.py . [100%] =============================== inline snapshot ================================ ─────────────────────────────── Update snapshots ─────────────────────────────── stderr: Traceback (most recent call last): File "", line 198, in _run_module_as_main File "", line 88, in _run_code File "/usr/lib/python3/dist-packages/pytest/__main__.py", line 9, in raise SystemExit(pytest.console_main()) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 201, in console_main code = main() ^^^^^^ File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 175, in main ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec return self._inner_hookexec(hook_name, methods, kwargs, firstresult) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall raise exception.with_traceback(exception.__traceback__) File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall res = hook_impl.function(*args) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/_pytest/main.py", line 330, in pytest_cmdline_main return wrap_session(config, _main) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/_pytest/main.py", line 318, in wrap_session config.hook.pytest_sessionfinish( File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec return self._inner_hookexec(hook_name, methods, kwargs, firstresult) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall raise exception.with_traceback(exception.__traceback__) File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall teardown.throw(exception) # type: ignore[union-attr] ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/_pytest/logging.py", line 868, in pytest_sessionfinish return (yield) ^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 124, in _multicall teardown.send(result) # type: ignore[union-attr] ^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 903, in pytest_sessionfinish self.config.hook.pytest_terminal_summary( File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec return self._inner_hookexec(hook_name, methods, kwargs, firstresult) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall raise exception.with_traceback(exception.__traceback__) File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall teardown.throw(exception) # type: ignore[union-attr] ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 925, in pytest_terminal_summary return (yield) ^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall teardown.throw(exception) # type: ignore[union-attr] ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/_pytest/warnings.py", line 132, in pytest_terminal_summary return (yield) ^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall res = hook_impl.function(*args) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/pytest_plugin.py", line 346, in pytest_terminal_summary diff = file.diff() ^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py", line 195, in diff unified_diff(self.source.splitlines(), self.new_code().splitlines()), ^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py", line 163, in new_code format_whole_file = enforce_formatting() or code == format_code( ^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code runner = CliRunner(mix_stderr=False) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' _________________________ test_pydantic_factory_method _________________________ def test_pydantic_factory_method(): Example( """\ from inline_snapshot import snapshot from pydantic import BaseModel class A(BaseModel): a:int @classmethod def from_str(cls,s): return cls(a=int(s)) def test_something(): for a in [1,2]: assert A(a=2) == snapshot(A.from_str("1")) """ > ).run_pytest( ["--inline-snapshot=fix"], changed_files=snapshot( { "test_something.py": """\ from inline_snapshot import snapshot from pydantic import BaseModel class A(BaseModel): a:int @classmethod def from_str(cls,s): return cls(a=int(s)) def test_something(): for a in [1,2]: assert A(a=2) == snapshot(A(a=2)) """ } ), ) tests/test_pydantic.py:157: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = args = ['--inline-snapshot=fix'] def run_pytest( self, args: list[str] = [], *, term_columns=80, env: dict[str, str] = {}, changed_files: Snapshot[dict[str, str]] | None = None, report: Snapshot[str] | None = None, stderr: Snapshot[str] | None = None, returncode: Snapshot[int] | None = None, ) -> Example: """Run pytest with the given args and env variables in an seperate process. It can be used to test the interaction between your code and pytest, but it is a bit slower than `run_inline` Parameters: args: pytest arguments like "--inline-snapshot=fix" env: dict of environment variables changed_files: snapshot of files which are changed by this run. report: snapshot of the report at the end of the pytest run. stderr: pytest stderr output returncode: snapshot of the pytest returncode. Returns: A new Example instance which contains the changed files. """ with TemporaryDirectory() as dir: tmp_path = Path(dir) self._write_files(tmp_path) cmd = [sys.executable, "-m", "pytest", *args] command_env = dict(os.environ) command_env["TERM"] = "unknown" command_env["COLUMNS"] = str( term_columns + 1 if platform.system() == "Windows" else term_columns ) command_env.pop("CI", None) command_env.update(env) result = sp.run(cmd, cwd=tmp_path, capture_output=True, env=command_env) print("run>", *cmd) print("stdout:") print(result.stdout.decode()) print("stderr:") print(result.stderr.decode()) if returncode is not None: assert result.returncode == returncode if stderr is not None: assert result.stderr.decode() == stderr if report is not None: report_list = [] record = False for line in result.stdout.decode().splitlines(): line = line.strip() if line.startswith("===="): record = False if record and line: report_list.append(line) if line.startswith("====") and "inline snapshot" in line: record = True report_str = "\n".join(report_list) assert normalize(report_str) == report, repr(report_str) if changed_files is not None: current_files = {} for name, content in sorted(self._read_files(tmp_path).items()): if name not in self.files or self.files[name] != content: current_files[name] = content > assert changed_files == current_files E AssertionError: assert {'test_someth...ot(A(a=2))\n'} == {} E E Left contains 1 more item: E {'test_something.py': 'from inline_snapshot import snapshot\n' E 'from pydantic import BaseModel\n' E '\n' E 'class A(BaseModel):\n' E ' a:int\n'... E E ...Full output truncated (9 lines hidden), use '-vv' to show /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:327: AssertionError ----------------------------- Captured stdout call ----------------------------- file: test_something.py from inline_snapshot import snapshot from pydantic import BaseModel class A(BaseModel): a:int @classmethod def from_str(cls,s): return cls(a=int(s)) def test_something(): for a in [1,2]: assert A(a=2) == snapshot(A.from_str("1")) run> /usr/bin/python3.12 -m pytest --inline-snapshot=fix stdout: ============================= test session starts ============================== platform linux -- Python 3.12.8, pytest-8.3.4, pluggy-1.5.0 rootdir: /tmp/tmp8_20h979 plugins: inline-snapshot-0.19.3, mock-3.14.0, hypothesis-6.124.0, time-machine-2.16.0, subtests-0.13.1, pytest_freezer-0.4.9 collected 1 item test_something.py F [100%] =================================== FAILURES =================================== ________________________________ test_something ________________________________ def test_something(): for a in [1,2]: > assert A(a=2) == snapshot(A.from_str("1")) test_something.py:13: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/generic_call_adapter.py:107: in assign result = yield from self.value_assign(old_value, old_node, new_value) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/adapter.py:87: in value_assign result = yield from adapter.assign(old_value, old_node, new_value) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = 'A (a =2 )', filename = PosixPath('/tmp/tmp8_20h979/test_something.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError =============================== inline snapshot ================================ =========================== short test summary info ============================ FAILED test_something.py::test_something - TypeError: CliRunner.__init__() go... ============================== 1 failed in 0.16s =============================== stderr: __________________________________ test_pypy ___________________________________ @pytest.mark.no_rewriting def test_pypy(): report = ( snapshot("INFO: inline-snapshot was disabled because pypy is not supported") if sys.implementation.name == "pypy" else snapshot( """\ -------------------------------- Fix snapshots --------------------------------- +----------------------------- test_something.py ------------------------------+ | @@ -1,6 +1,6 @@ | | | | from inline_snapshot import snapshot | | | | def test_example(): | | - assert 1+1==snapshot(3) | | + assert 1+1==snapshot(2) | +------------------------------------------------------------------------------+ These changes will be applied, because you used --inline-snapshot=fix\ """ ) ) Example( """\ from inline_snapshot import snapshot def test_example(): assert 1+1==snapshot(3) """ > ).run_pytest(["--inline-snapshot=fix"], report=report).run_pytest( ["--inline-snapshot=disable"], report="" ) tests/test_pypy.py:38: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:319: in run_pytest assert normalize(report_str) == report, repr(report_str) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = "''" filename = PosixPath('/tmp/autopkgtest.ImMzGl/autopkgtest_tmp/tests/test_pypy.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- file: test_something.py from inline_snapshot import snapshot def test_example(): assert 1+1==snapshot(3) run> /usr/bin/python3.12 -m pytest --inline-snapshot=fix stdout: ============================= test session starts ============================== platform linux -- Python 3.12.8, pytest-8.3.4, pluggy-1.5.0 rootdir: /tmp/tmp6pjmp8rr plugins: inline-snapshot-0.19.3, mock-3.14.0, hypothesis-6.124.0, time-machine-2.16.0, subtests-0.13.1, pytest_freezer-0.4.9 collected 1 item test_something.py F [100%] =================================== FAILURES =================================== _________________________________ test_example _________________________________ def test_example(): > assert 1+1==snapshot(3) test_something.py:4: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '2 ', filename = PosixPath('/tmp/tmp6pjmp8rr/test_something.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError =============================== inline snapshot ================================ =========================== short test summary info ============================ FAILED test_something.py::test_example - TypeError: CliRunner.__init__() got ... ============================== 1 failed in 0.12s =============================== stderr: _________________________________ test_create __________________________________ project = .Project object at 0x7f6a3dee9220> def test_create(project): project.setup( """\ def test_a(): assert 5==snapshot() """ ) result = project.run() > result.assert_outcomes(errors=1, passed=1) E AssertionError: assert {'errors': 1,...pped': 0, ...} == {'errors': 1,...pped': 0, ...} E E Omitting 4 identical items, use -vv to show E Differing items: E {'passed': 0} != {'passed': 1} E {'failed': 1} != {'failed': 0} E Use -v to get more diff /tmp/autopkgtest.ImMzGl/autopkgtest_tmp/tests/test_pytest_plugin.py:24: AssertionError ----------------------------- Captured stdout call ----------------------------- write code: # äöß 🐍 from inline_snapshot import snapshot from inline_snapshot import outsource def test_a(): assert 5==snapshot() running: pytest in: /tmp/pytest-of-unshare/pytest-0/test_create0 ============================= test session starts ============================== platform linux -- Python 3.13.1, pytest-8.3.4, pluggy-1.5.0 rootdir: /tmp/pytest-of-unshare/pytest-0/test_create0 plugins: inline-snapshot-0.19.3, mock-3.14.0, hypothesis-6.124.0, time-machine-2.16.0, subtests-0.13.1, pytest_freezer-0.4.9 collected 1 item test_file.py FE [100%] ==================================== ERRORS ==================================== _________________________ ERROR at teardown of test_a __________________________ your snapshot is missing one value. =================================== FAILURES =================================== ____________________________________ test_a ____________________________________ def test_a(): > assert 5==snapshot() test_file.py:7: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_create0/test_file.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError =============================== inline snapshot ================================ =========================== short test summary info ============================ FAILED test_file.py::test_a - TypeError: CliRunner.__init__() got an unexpect... ERROR test_file.py::test_a - Failed: your snapshot is missing one value. ========================== 1 failed, 1 error in 0.17s ========================== ___________________________________ test_fix ___________________________________ project = .Project object at 0x7f6a3deeb560> def test_fix(project): project.setup( """\ def test_a(): assert 5==snapshot(4) """ ) result = project.run() > result.assert_outcomes(failed=1, errors=1) E AssertionError: assert {'errors': 0,...pped': 0, ...} == {'errors': 1,...pped': 0, ...} E E Omitting 5 identical items, use -vv to show E Differing items: E {'errors': 0} != {'errors': 1} E Use -v to get more diff /tmp/autopkgtest.ImMzGl/autopkgtest_tmp/tests/test_pytest_plugin.py:71: AssertionError ----------------------------- Captured stdout call ----------------------------- write code: # äöß 🐍 from inline_snapshot import snapshot from inline_snapshot import outsource def test_a(): assert 5==snapshot(4) running: pytest in: /tmp/pytest-of-unshare/pytest-0/test_fix0 ============================= test session starts ============================== platform linux -- Python 3.13.1, pytest-8.3.4, pluggy-1.5.0 rootdir: /tmp/pytest-of-unshare/pytest-0/test_fix0 plugins: inline-snapshot-0.19.3, mock-3.14.0, hypothesis-6.124.0, time-machine-2.16.0, subtests-0.13.1, pytest_freezer-0.4.9 collected 1 item test_file.py F [100%] =================================== FAILURES =================================== ____________________________________ test_a ____________________________________ def test_a(): > assert 5==snapshot(4) test_file.py:7: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '5 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_fix0/test_file.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError =============================== inline snapshot ================================ =========================== short test summary info ============================ FAILED test_file.py::test_a - TypeError: CliRunner.__init__() got an unexpect... ============================== 1 failed in 0.18s =============================== _________________________________ test_update __________________________________ project = .Project object at 0x7f6a3de5c9e0> def test_update(project): project.setup( """\ def test_a(): assert "5" == snapshot('''5''') """ ) result = project.run() > result.assert_outcomes(passed=1) E AssertionError: assert {'errors': 0,...pped': 0, ...} == {'errors': 0,...pped': 0, ...} E E Omitting 4 identical items, use -vv to show E Differing items: E {'passed': 0} != {'passed': 1} E {'failed': 1} != {'failed': 0} E Use -v to get more diff /tmp/autopkgtest.ImMzGl/autopkgtest_tmp/tests/test_pytest_plugin.py:118: AssertionError ----------------------------- Captured stdout call ----------------------------- write code: # äöß 🐍 from inline_snapshot import snapshot from inline_snapshot import outsource def test_a(): assert "5" == snapshot('''5''') running: pytest in: /tmp/pytest-of-unshare/pytest-0/test_update0 ============================= test session starts ============================== platform linux -- Python 3.13.1, pytest-8.3.4, pluggy-1.5.0 rootdir: /tmp/pytest-of-unshare/pytest-0/test_update0 plugins: inline-snapshot-0.19.3, mock-3.14.0, hypothesis-6.124.0, time-machine-2.16.0, subtests-0.13.1, pytest_freezer-0.4.9 collected 1 item test_file.py F [100%] =================================== FAILURES =================================== ____________________________________ test_a ____________________________________ def test_a(): > assert "5" == snapshot('''5''') test_file.py:7: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = "'5'" filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_update0/test_file.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError =============================== inline snapshot ================================ =========================== short test summary info ============================ FAILED test_file.py::test_a - TypeError: CliRunner.__init__() got an unexpect... ============================== 1 failed in 0.18s =============================== __________________________________ test_trim ___________________________________ project = .Project object at 0x7f6a3de5c080> def test_trim(project): project.setup( """\ def test_a(): assert 5 in snapshot([4,5]) """ ) result = project.run() result.assert_outcomes(passed=1) assert result.report == snapshot( """\ Info: one snapshot can be trimmed (--inline-snapshot=trim) You can also use --inline-snapshot=review to approve the changes interactively """ ) result = project.run("--inline-snapshot=trim") > assert result.report == snapshot( """\ -------------------------------- Trim snapshots -------------------------------- +-------------------------------- test_file.py --------------------------------+ | @@ -4,4 +4,4 @@ | | | | | | | | def test_a(): | | - assert 5 in snapshot([4,5]) | | + assert 5 in snapshot([5]) | +------------------------------------------------------------------------------+ These changes will be applied, because you used --inline-snapshot=trim """ ) /tmp/autopkgtest.ImMzGl/autopkgtest_tmp/tests/test_pytest_plugin.py:178: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = "'-------------------------------- Trim snapshots --------------------------------'" filename = PosixPath('/tmp/autopkgtest.ImMzGl/autopkgtest_tmp/tests/test_pytest_plugin.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- write code: # äöß 🐍 from inline_snapshot import snapshot from inline_snapshot import outsource def test_a(): assert 5 in snapshot([4,5]) running: pytest in: /tmp/pytest-of-unshare/pytest-0/test_trim0 ============================= test session starts ============================== platform linux -- Python 3.13.1, pytest-8.3.4, pluggy-1.5.0 rootdir: /tmp/pytest-of-unshare/pytest-0/test_trim0 plugins: inline-snapshot-0.19.3, mock-3.14.0, hypothesis-6.124.0, time-machine-2.16.0, subtests-0.13.1, pytest_freezer-0.4.9 collected 1 item test_file.py . [100%] =============================== inline snapshot ================================ Info: one snapshot can be trimmed (--inline-snapshot=trim) You can also use --inline-snapshot=review to approve the changes interactively ============================== 1 passed in 0.11s =============================== running: pytest --inline-snapshot=trim in: /tmp/pytest-of-unshare/pytest-0/test_trim0 ============================= test session starts ============================== platform linux -- Python 3.13.1, pytest-8.3.4, pluggy-1.5.0 rootdir: /tmp/pytest-of-unshare/pytest-0/test_trim0 plugins: inline-snapshot-0.19.3, mock-3.14.0, hypothesis-6.124.0, time-machine-2.16.0, subtests-0.13.1, pytest_freezer-0.4.9 collected 1 item test_file.py . [100%] =============================== inline snapshot ================================ ──────────────────────────────── Trim snapshots ──────────────────────────────── ----------------------------- Captured stderr call ----------------------------- Traceback (most recent call last): File "/usr/bin/pytest", line 8, in sys.exit(console_main()) ~~~~~~~~~~~~^^ File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 201, in console_main code = main() File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 175, in main ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec return self._inner_hookexec(hook_name, methods, kwargs, firstresult) ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall raise exception.with_traceback(exception.__traceback__) File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall res = hook_impl.function(*args) File "/usr/lib/python3/dist-packages/_pytest/main.py", line 330, in pytest_cmdline_main return wrap_session(config, _main) File "/usr/lib/python3/dist-packages/_pytest/main.py", line 318, in wrap_session config.hook.pytest_sessionfinish( ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ session=session, exitstatus=session.exitstatus ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ) ^ File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec return self._inner_hookexec(hook_name, methods, kwargs, firstresult) ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall raise exception.with_traceback(exception.__traceback__) File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall teardown.throw(exception) # type: ignore[union-attr] ~~~~~~~~~~~~~~^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/_pytest/logging.py", line 868, in pytest_sessionfinish return (yield) ^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 124, in _multicall teardown.send(result) # type: ignore[union-attr] ~~~~~~~~~~~~~^^^^^^^^ File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 903, in pytest_sessionfinish self.config.hook.pytest_terminal_summary( ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ terminalreporter=self, exitstatus=exitstatus, config=self.config ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ) ^ File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__ return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec return self._inner_hookexec(hook_name, methods, kwargs, firstresult) ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall raise exception.with_traceback(exception.__traceback__) File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall teardown.throw(exception) # type: ignore[union-attr] ~~~~~~~~~~~~~~^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/_pytest/terminal.py", line 925, in pytest_terminal_summary return (yield) ^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall teardown.throw(exception) # type: ignore[union-attr] ~~~~~~~~~~~~~~^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/_pytest/warnings.py", line 132, in pytest_terminal_summary return (yield) ^^^^^ File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall res = hook_impl.function(*args) File "/usr/lib/python3/dist-packages/inline_snapshot/pytest_plugin.py", line 346, in pytest_terminal_summary diff = file.diff() File "/usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py", line 195, in diff unified_diff(self.source.splitlines(), self.new_code().splitlines()), ~~~~~~~~~~~~~^^ File "/usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py", line 163, in new_code format_whole_file = enforce_formatting() or code == format_code( ~~~~~~~~~~~^ code, self.filename ^^^^^^^^^^^^^^^^^^^ ) ^ File "/usr/lib/python3/dist-packages/inline_snapshot/_format.py", line 48, in format_code runner = CliRunner(mix_stderr=False) TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' ________________________________ test_multiple _________________________________ project = .Project object at 0x7f6a3defb140> def test_multiple(project): project.setup( """\ def test_a(): assert "5" == snapshot('''5''') assert 5 <= snapshot(8) assert 5 == snapshot(4) """ ) result = project.run() > result.assert_outcomes(failed=1, errors=1) E AssertionError: assert {'errors': 0,...pped': 0, ...} == {'errors': 1,...pped': 0, ...} E E Omitting 5 identical items, use -vv to show E Differing items: E {'errors': 0} != {'errors': 1} E Use -v to get more diff /tmp/autopkgtest.ImMzGl/autopkgtest_tmp/tests/test_pytest_plugin.py:214: AssertionError ----------------------------- Captured stdout call ----------------------------- write code: # äöß 🐍 from inline_snapshot import snapshot from inline_snapshot import outsource def test_a(): assert "5" == snapshot('''5''') assert 5 <= snapshot(8) assert 5 == snapshot(4) running: pytest in: /tmp/pytest-of-unshare/pytest-0/test_multiple0 ============================= test session starts ============================== platform linux -- Python 3.13.1, pytest-8.3.4, pluggy-1.5.0 rootdir: /tmp/pytest-of-unshare/pytest-0/test_multiple0 plugins: inline-snapshot-0.19.3, mock-3.14.0, hypothesis-6.124.0, time-machine-2.16.0, subtests-0.13.1, pytest_freezer-0.4.9 collected 1 item test_file.py F [100%] =================================== FAILURES =================================== ____________________________________ test_a ____________________________________ def test_a(): > assert "5" == snapshot('''5''') test_file.py:7: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = "'5'" filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_multiple0/test_file.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError =============================== inline snapshot ================================ =========================== short test summary info ============================ FAILED test_file.py::test_a - TypeError: CliRunner.__init__() got an unexpect... ============================== 1 failed in 0.18s =============================== _____________________________ test_multiple_report _____________________________ project = .Project object at 0x7f6a3defb110> def test_multiple_report(project): project.setup( """\ def test_a(): assert "5" == snapshot('''5''') assert 5 <= snapshot(8) assert 5 == snapshot(4) """ ) result = project.run("--inline-snapshot=trim,report") > assert result.report == snapshot( """\ -------------------------------- Fix snapshots --------------------------------- +-------------------------------- test_file.py --------------------------------+ | @@ -6,4 +6,4 @@ | | | | def test_a(): | | assert "5" == snapshot('''5''') | | assert 5 <= snapshot(8) | | - assert 5 == snapshot(4) | | + assert 5 == snapshot(5) | +------------------------------------------------------------------------------+ These changes are not applied. Use --inline-snapshot=fix to apply them, or use the interactive mode with --inline-snapshot=review -------------------------------- Trim snapshots -------------------------------- +-------------------------------- test_file.py --------------------------------+ | @@ -5,5 +5,5 @@ | | | | | | def test_a(): | | assert "5" == snapshot('''5''') | | - assert 5 <= snapshot(8) | | + assert 5 <= snapshot(5) | | assert 5 == snapshot(4) | +------------------------------------------------------------------------------+ These changes will be applied, because you used --inline-snapshot=trim ------------------------------- Update snapshots ------------------------------- +-------------------------------- test_file.py --------------------------------+ | @@ -4,6 +4,6 @@ | | | | | | | | def test_a(): | | - assert "5" == snapshot('''5''') | | + assert "5" == snapshot("5") | | assert 5 <= snapshot(5) | | assert 5 == snapshot(4) | +------------------------------------------------------------------------------+ These changes are not applied. Use --inline-snapshot=update to apply them, or use the interactive mode with --inline-snapshot=review """ ) /tmp/autopkgtest.ImMzGl/autopkgtest_tmp/tests/test_pytest_plugin.py:307: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = "''" filename = PosixPath('/tmp/autopkgtest.ImMzGl/autopkgtest_tmp/tests/test_pytest_plugin.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- write code: # äöß 🐍 from inline_snapshot import snapshot from inline_snapshot import outsource def test_a(): assert "5" == snapshot('''5''') assert 5 <= snapshot(8) assert 5 == snapshot(4) running: pytest --inline-snapshot=trim,report in: /tmp/pytest-of-unshare/pytest-0/test_multiple_report0 ============================= test session starts ============================== platform linux -- Python 3.13.1, pytest-8.3.4, pluggy-1.5.0 rootdir: /tmp/pytest-of-unshare/pytest-0/test_multiple_report0 plugins: inline-snapshot-0.19.3, mock-3.14.0, hypothesis-6.124.0, time-machine-2.16.0, subtests-0.13.1, pytest_freezer-0.4.9 collected 1 item test_file.py F [100%] =================================== FAILURES =================================== ____________________________________ test_a ____________________________________ def test_a(): > assert "5" == snapshot('''5''') test_file.py:7: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = "'5'" filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_multiple_report0/test_file.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError =============================== inline snapshot ================================ =========================== short test summary info ============================ FAILED test_file.py::test_a - TypeError: CliRunner.__init__() got an unexpect... ============================== 1 failed in 0.16s =============================== ______________________________ test_black_config _______________________________ project = .Project object at 0x7f6a3dcda060> def test_black_config(project): project.setup( """\ def test_a(): assert list(range(10)) == snapshot([]) """ ) > project.format() /tmp/autopkgtest.ImMzGl/autopkgtest_tmp/tests/test_pytest_plugin.py:370: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /tmp/autopkgtest.ImMzGl/autopkgtest_tmp/tests/conftest.py:315: in format format_code(self._filename.read_text("utf-8"), self._filename), "utf-8" _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '# äöß 🐍\nfrom inline_snapshot import snapshot\nfrom inline_snapshot import outsource\n\n\ndef test_a():\n assert list(range(10)) == snapshot([])\n' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_black_config0/test_file.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- write code: # äöß 🐍 from inline_snapshot import snapshot from inline_snapshot import outsource def test_a(): assert list(range(10)) == snapshot([]) ________________________________ test_disabled _________________________________ project = .Project object at 0x7f6a3def9bb0> def test_disabled(project): project.setup( """\ def test_a(): assert 4==snapshot(5) """ ) result = project.run("--inline-snapshot=disable") result.assert_outcomes(failed=1) result = project.run("--inline-snapshot=fix") > assert project.source == snapshot( """\ def test_a(): assert 4==snapshot(4) """ ) /tmp/autopkgtest.ImMzGl/autopkgtest_tmp/tests/test_pytest_plugin.py:409: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '"""\\\ndef test_a():\n assert 4==snapshot(5)\n"""' filename = PosixPath('/tmp/autopkgtest.ImMzGl/autopkgtest_tmp/tests/test_pytest_plugin.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- write code: # äöß 🐍 from inline_snapshot import snapshot from inline_snapshot import outsource def test_a(): assert 4==snapshot(5) running: pytest --inline-snapshot=disable in: /tmp/pytest-of-unshare/pytest-0/test_disabled0 ============================= test session starts ============================== platform linux -- Python 3.13.1, pytest-8.3.4, pluggy-1.5.0 rootdir: /tmp/pytest-of-unshare/pytest-0/test_disabled0 plugins: inline-snapshot-0.19.3, mock-3.14.0, hypothesis-6.124.0, time-machine-2.16.0, subtests-0.13.1, pytest_freezer-0.4.9 collected 1 item test_file.py F [100%] =================================== FAILURES =================================== ____________________________________ test_a ____________________________________ def test_a(): > assert 4==snapshot(5) E assert 4 == 5 E + where 5 = snapshot(5) test_file.py:7: AssertionError =========================== short test summary info ============================ FAILED test_file.py::test_a - assert 4 == 5 ============================== 1 failed in 0.11s =============================== running: pytest --inline-snapshot=fix in: /tmp/pytest-of-unshare/pytest-0/test_disabled0 ============================= test session starts ============================== platform linux -- Python 3.13.1, pytest-8.3.4, pluggy-1.5.0 rootdir: /tmp/pytest-of-unshare/pytest-0/test_disabled0 plugins: inline-snapshot-0.19.3, mock-3.14.0, hypothesis-6.124.0, time-machine-2.16.0, subtests-0.13.1, pytest_freezer-0.4.9 collected 1 item test_file.py F [100%] =================================== FAILURES =================================== ____________________________________ test_a ____________________________________ def test_a(): > assert 4==snapshot(5) test_file.py:7: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '4 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_disabled0/test_file.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError =============================== inline snapshot ================================ =========================== short test summary info ============================ FAILED test_file.py::test_a - TypeError: CliRunner.__init__() got an unexpect... ============================== 1 failed in 0.16s =============================== _________________________________ test_compare _________________________________ project = .Project object at 0x7f6a3dcdbd70> def test_compare(project): project.setup( """\ def test_a(): assert "a"==snapshot("b") """ ) result = project.run() > assert result.errorLines() == snapshot( """\ > assert "a"==snapshot("b") E AssertionError: assert 'a' == 'b' E ⏎ E - b E + a """ ) /tmp/autopkgtest.ImMzGl/autopkgtest_tmp/tests/test_pytest_plugin.py:429: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '"""\\\n> assert "a"==snapshot("b")\n> runner = CliRunner(mix_stderr=False)\nE TypeError: CliRunner.__init__() got an unexpected keyword argument \'mix_stderr\'\n"""' filename = PosixPath('/tmp/autopkgtest.ImMzGl/autopkgtest_tmp/tests/test_pytest_plugin.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- write code: # äöß 🐍 from inline_snapshot import snapshot from inline_snapshot import outsource def test_a(): assert "a"==snapshot("b") running: pytest in: /tmp/pytest-of-unshare/pytest-0/test_compare0 ============================= test session starts ============================== platform linux -- Python 3.13.1, pytest-8.3.4, pluggy-1.5.0 rootdir: /tmp/pytest-of-unshare/pytest-0/test_compare0 plugins: inline-snapshot-0.19.3, mock-3.14.0, hypothesis-6.124.0, time-machine-2.16.0, subtests-0.13.1, pytest_freezer-0.4.9 collected 1 item test_file.py F [100%] =================================== FAILURES =================================== ____________________________________ test_a ____________________________________ def test_a(): > assert "a"==snapshot("b") test_file.py:7: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = "'a'" filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_compare0/test_file.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError =============================== inline snapshot ================================ =========================== short test summary info ============================ FAILED test_file.py::test_a - TypeError: CliRunner.__init__() got an unexpect... ============================== 1 failed in 0.17s =============================== __________________________ test_assertion_error_loop ___________________________ project = .Project object at 0x7f6a3dcdaf30> def test_assertion_error_loop(project): project.setup( """\ for e in (1, 2): assert e == snapshot() """ ) result = project.run() > assert result.errorLines() == snapshot( """\ E assert 2 == 1 E + where 1 = snapshot() """ ) /tmp/autopkgtest.ImMzGl/autopkgtest_tmp/tests/test_pytest_plugin.py:466: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '"E TypeError: CliRunner.__init__() got an unexpected keyword argument \'mix_stderr\'"' filename = PosixPath('/tmp/autopkgtest.ImMzGl/autopkgtest_tmp/tests/test_pytest_plugin.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- write code: # äöß 🐍 from inline_snapshot import snapshot from inline_snapshot import outsource for e in (1, 2): assert e == snapshot() running: pytest in: /tmp/pytest-of-unshare/pytest-0/test_assertion_error_loop0 ============================= test session starts ============================== platform linux -- Python 3.13.1, pytest-8.3.4, pluggy-1.5.0 rootdir: /tmp/pytest-of-unshare/pytest-0/test_assertion_error_loop0 plugins: inline-snapshot-0.19.3, mock-3.14.0, hypothesis-6.124.0, time-machine-2.16.0, subtests-0.13.1, pytest_freezer-0.4.9 collected 0 items / 1 error ==================================== ERRORS ==================================== ________________________ ERROR collecting test_file.py _________________________ test_file.py:7: in assert e == snapshot() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: in format_code runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' =============================== inline snapshot ================================ =========================== short test summary info ============================ ERROR test_file.py - TypeError: CliRunner.__init__() got an unexpected keywor... !!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!! =============================== 1 error in 0.15s =============================== _____________________________ test_assertion_error _____________________________ project = .Project object at 0x7f6a3dc8d340> def test_assertion_error(project): project.setup("assert 2 == snapshot(1)") result = project.run() > assert result.errorLines() == snapshot( """\ E assert 2 == 1 E + where 1 = snapshot(1) """ ) /tmp/autopkgtest.ImMzGl/autopkgtest_tmp/tests/test_pytest_plugin.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '"E TypeError: CliRunner.__init__() got an unexpected keyword argument \'mix_stderr\'"' filename = PosixPath('/tmp/autopkgtest.ImMzGl/autopkgtest_tmp/tests/test_pytest_plugin.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- write code: # äöß 🐍 from inline_snapshot import snapshot from inline_snapshot import outsource assert 2 == snapshot(1) running: pytest in: /tmp/pytest-of-unshare/pytest-0/test_assertion_error0 ============================= test session starts ============================== platform linux -- Python 3.13.1, pytest-8.3.4, pluggy-1.5.0 rootdir: /tmp/pytest-of-unshare/pytest-0/test_assertion_error0 plugins: inline-snapshot-0.19.3, mock-3.14.0, hypothesis-6.124.0, time-machine-2.16.0, subtests-0.13.1, pytest_freezer-0.4.9 collected 0 items / 1 error ==================================== ERRORS ==================================== ________________________ ERROR collecting test_file.py _________________________ test_file.py:6: in assert 2 == snapshot(1) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: in format_code runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' =============================== inline snapshot ================================ =========================== short test summary info ============================ ERROR test_file.py - TypeError: CliRunner.__init__() got an unexpected keywor... !!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!! =============================== 1 error in 0.15s =============================== _______________________ test_pytest_inlinesnapshot_auto ________________________ project = .Project object at 0x7f6a3dc8de20> def test_pytest_inlinesnapshot_auto(project): project.setup( """\ def test_something(): assert 2 == snapshot(1) """ ) result = project.run("--inline-snapshot=review", stdin=b"y\n") > assert result.errorLines() == snapshot("") /tmp/autopkgtest.ImMzGl/autopkgtest_tmp/tests/test_pytest_plugin.py:526: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '"""\\\n> assert 2 == snapshot(1)\n> runner = CliRunner(mix_stderr=False)\nE TypeError: CliRunner.__init__() got an unexpected keyword argument \'mix_stderr\'\n"""' filename = PosixPath('/tmp/autopkgtest.ImMzGl/autopkgtest_tmp/tests/test_pytest_plugin.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- write code: # äöß 🐍 from inline_snapshot import snapshot from inline_snapshot import outsource def test_something(): assert 2 == snapshot(1) running: pytest --inline-snapshot=review in: /tmp/pytest-of-unshare/pytest-0/test_pytest_inlinesnapshot_auto0 ============================= test session starts ============================== platform linux -- Python 3.13.1, pytest-8.3.4, pluggy-1.5.0 rootdir: /tmp/pytest-of-unshare/pytest-0/test_pytest_inlinesnapshot_auto0 plugins: inline-snapshot-0.19.3, mock-3.14.0, hypothesis-6.124.0, time-machine-2.16.0, subtests-0.13.1, pytest_freezer-0.4.9 collected 1 item test_file.py F [100%] =================================== FAILURES =================================== ________________________________ test_something ________________________________ def test_something(): > assert 2 == snapshot(1) test_file.py:7: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '2 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_pytest_inlinesnapshot_auto0/test_file.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError =============================== inline snapshot ================================ =========================== short test summary info ============================ FAILED test_file.py::test_something - TypeError: CliRunner.__init__() got an ... ============================== 1 failed in 0.16s =============================== ________________________ test_persist_unknown_external _________________________ project = .Project object at 0x7f6a3dcbe630> def test_persist_unknown_external(project): project.setup( """\ from inline_snapshot import external, snapshot def test_sub_snapshot(): external("123*.png") assert 1==snapshot(2) """ ) result = project.run("--inline-snapshot=fix") > assert project.source == snapshot( """\ from inline_snapshot import external, snapshot def test_sub_snapshot(): external("123*.png") assert 1==snapshot(1) """ ) /tmp/autopkgtest.ImMzGl/autopkgtest_tmp/tests/test_pytest_plugin.py:596: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '"""\\\nfrom inline_snapshot import external, snapshot\n\ndef test_sub_snapshot():\n external("123*.png")\n assert 1==snapshot(2)\n"""' filename = PosixPath('/tmp/autopkgtest.ImMzGl/autopkgtest_tmp/tests/test_pytest_plugin.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- write code: # äöß 🐍 from inline_snapshot import snapshot from inline_snapshot import outsource from inline_snapshot import external, snapshot def test_sub_snapshot(): external("123*.png") assert 1==snapshot(2) running: pytest --inline-snapshot=fix in: /tmp/pytest-of-unshare/pytest-0/test_persist_unknown_external0 ============================= test session starts ============================== platform linux -- Python 3.13.1, pytest-8.3.4, pluggy-1.5.0 rootdir: /tmp/pytest-of-unshare/pytest-0/test_persist_unknown_external0 plugins: inline-snapshot-0.19.3, mock-3.14.0, hypothesis-6.124.0, time-machine-2.16.0, subtests-0.13.1, pytest_freezer-0.4.9 collected 1 item test_file.py F [100%] =================================== FAILURES =================================== ______________________________ test_sub_snapshot _______________________________ def test_sub_snapshot(): external("123*.png") > assert 1==snapshot(2) test_file.py:8: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '1 ' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_persist_unknown_external0/test_file.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError =============================== inline snapshot ================================ =========================== short test summary info ============================ FAILED test_file.py::test_sub_snapshot - TypeError: CliRunner.__init__() got ... ============================== 1 failed in 0.16s =============================== ___________________________ test_diff_multiple_files ___________________________ def test_diff_multiple_files(): Example( { "test_a.py": """ from inline_snapshot import snapshot def test_a(): assert 1==snapshot(2) """, "test_b.py": """ from inline_snapshot import snapshot def test_b(): assert 1==snapshot() """, } > ).run_pytest( ["--inline-snapshot=create,fix"], changed_files=snapshot( { "test_b.py": """\ from inline_snapshot import snapshot def test_b(): assert 1==snapshot(1) \ """, "test_a.py": """\ from inline_snapshot import snapshot def test_a(): assert 1==snapshot(1) \ """, } ), report=snapshot( """\ ------------------------------- Create snapshots ------------------------------- +--------------------------------- test_b.py ----------------------------------+ | @@ -2,5 +2,5 @@ | | | | from inline_snapshot import snapshot | | | | def test_b(): | | - assert 1==snapshot() | | + assert 1==snapshot(1) | +------------------------------------------------------------------------------+ These changes will be applied, because you used --inline-snapshot=create -------------------------------- Fix snapshots --------------------------------- +--------------------------------- test_a.py ----------------------------------+ | @@ -2,5 +2,5 @@ | | | | from inline_snapshot import snapshot | | | | def test_a(): | | - assert 1==snapshot(2) | | + assert 1==snapshot(1) | +------------------------------------------------------------------------------+ These changes will be applied, because you used --inline-snapshot=fix\ """ ), ) tests/test_pytest_plugin.py:626: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:319: in run_pytest assert normalize(report_str) == report, repr(report_str) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = "''" filename = PosixPath('/tmp/autopkgtest.ImMzGl/autopkgtest_tmp/tests/test_pytest_plugin.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- file: test_a.py from inline_snapshot import snapshot def test_a(): assert 1==snapshot(2) file: test_b.py from inline_snapshot import snapshot def test_b(): assert 1==snapshot() run> /usr/bin/python3.12 -m pytest --inline-snapshot=create,fix stdout: ============================= test session starts ============================== platform linux -- Python 3.12.8, pytest-8.3.4, pluggy-1.5.0 rootdir: /tmp/tmp1ldtkeve plugins: inline-snapshot-0.19.3, mock-3.14.0, hypothesis-6.124.0, time-machine-2.16.0, subtests-0.13.1, pytest_freezer-0.4.9 collected 2 items test_a.py F [ 50%] test_b.py F [100%] =================================== FAILURES =================================== ____________________________________ test_a ____________________________________ def test_a(): > assert 1==snapshot(2) test_a.py:5: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '1 ', filename = PosixPath('/tmp/tmp1ldtkeve/test_a.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ____________________________________ test_b ____________________________________ def test_b(): > assert 1==snapshot() test_b.py:5: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '', filename = PosixPath('/tmp/tmp1ldtkeve/test_b.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError =============================== inline snapshot ================================ =========================== short test summary info ============================ FAILED test_a.py::test_a - TypeError: CliRunner.__init__() got an unexpected ... FAILED test_b.py::test_b - TypeError: CliRunner.__init__() got an unexpected ... ============================== 2 failed in 0.13s =============================== stderr: ___________________ test_storage_dir_config[tests/snapshots] ___________________ project = .Project object at 0x7f6a3dcb0b00> tmp_path = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_storage_dir_config_tests_0') storage_dir = 'tests/snapshots' @pytest.mark.parametrize("storage_dir", ["tests/snapshots", None]) def test_storage_dir_config(project, tmp_path, storage_dir): # Relative path case: `tests/snapshots` (parametrized). # Absolute path case: `tmp_path / "snapshots"` (parametrized as `None`). if not storage_dir: storage_dir = tmp_path / "snapshots" project.pyproject( f""" [tool.inline-snapshot] storage-dir = "{storage_dir}" """ ) project.setup( """ from inline_snapshot import outsource, snapshot def test_outsource(): assert outsource("hello", suffix=".html") == snapshot() """ ) result = project.run("--inline-snapshot=create") > assert result.ret == 0 E assert == 0 E + where = .ret /tmp/autopkgtest.ImMzGl/autopkgtest_tmp/tests/test_pytest_plugin.py:754: AssertionError ----------------------------- Captured stdout call ----------------------------- write code: # äöß 🐍 from inline_snapshot import snapshot from inline_snapshot import outsource from inline_snapshot import outsource, snapshot def test_outsource(): assert outsource("hello", suffix=".html") == snapshot() running: pytest --inline-snapshot=create in: /tmp/pytest-of-unshare/pytest-0/test_storage_dir_config0 ============================= test session starts ============================== platform linux -- Python 3.13.1, pytest-8.3.4, pluggy-1.5.0 rootdir: /tmp/pytest-of-unshare/pytest-0/test_storage_dir_config0 configfile: pyproject.toml plugins: inline-snapshot-0.19.3, mock-3.14.0, hypothesis-6.124.0, time-machine-2.16.0, subtests-0.13.1, pytest_freezer-0.4.9 collected 1 item test_file.py F [100%] =================================== FAILURES =================================== ________________________________ test_outsource ________________________________ def test_outsource(): > assert outsource("hello", suffix=".html") == snapshot() test_file.py:10: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_storage_dir_config0/test_file.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError =============================== inline snapshot ================================ =========================== short test summary info ============================ FAILED test_file.py::test_outsource - TypeError: CliRunner.__init__() got an ... ============================== 1 failed in 0.16s =============================== ________________________ test_storage_dir_config[None] _________________________ project = .Project object at 0x7f6a3dcbf770> tmp_path = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_storage_dir_config_None_0') storage_dir = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_storage_dir_config_None_0/snapshots') @pytest.mark.parametrize("storage_dir", ["tests/snapshots", None]) def test_storage_dir_config(project, tmp_path, storage_dir): # Relative path case: `tests/snapshots` (parametrized). # Absolute path case: `tmp_path / "snapshots"` (parametrized as `None`). if not storage_dir: storage_dir = tmp_path / "snapshots" project.pyproject( f""" [tool.inline-snapshot] storage-dir = "{storage_dir}" """ ) project.setup( """ from inline_snapshot import outsource, snapshot def test_outsource(): assert outsource("hello", suffix=".html") == snapshot() """ ) result = project.run("--inline-snapshot=create") > assert result.ret == 0 E assert == 0 E + where = .ret /tmp/autopkgtest.ImMzGl/autopkgtest_tmp/tests/test_pytest_plugin.py:754: AssertionError ----------------------------- Captured stdout call ----------------------------- write code: # äöß 🐍 from inline_snapshot import snapshot from inline_snapshot import outsource from inline_snapshot import outsource, snapshot def test_outsource(): assert outsource("hello", suffix=".html") == snapshot() running: pytest --inline-snapshot=create in: /tmp/pytest-of-unshare/pytest-0/test_storage_dir_config1 ============================= test session starts ============================== platform linux -- Python 3.13.1, pytest-8.3.4, pluggy-1.5.0 rootdir: /tmp/pytest-of-unshare/pytest-0/test_storage_dir_config1 configfile: pyproject.toml plugins: inline-snapshot-0.19.3, mock-3.14.0, hypothesis-6.124.0, time-machine-2.16.0, subtests-0.13.1, pytest_freezer-0.4.9 collected 1 item test_file.py F [100%] =================================== FAILURES =================================== ________________________________ test_outsource ________________________________ def test_outsource(): > assert outsource("hello", suffix=".html") == snapshot() test_file.py:10: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_storage_dir_config1/test_file.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError =============================== inline snapshot ================================ =========================== short test summary info ============================ FAILED test_file.py::test_outsource - TypeError: CliRunner.__init__() got an ... ============================== 1 failed in 0.16s =============================== __________________ test_find_pyproject_in_parent_directories ___________________ tmp_path = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_find_pyproject_in_parent_0') def test_find_pyproject_in_parent_directories(tmp_path): Example( { "pyproject.toml": """\ [tool.inline-snapshot] hash-length=2 """, "project/pytest.ini": "", "project/test_something.py": """\ from inline_snapshot import outsource,snapshot,external def test_something(): assert outsource("test") == snapshot() """, } > ).run_pytest( ["--rootdir", "./project", "--inline-snapshot=create"], changed_files=snapshot( { "project/test_something.py": """\ from inline_snapshot import outsource,snapshot,external def test_something(): assert outsource("test") == snapshot(external("9f*.txt")) """ } ), ) tests/test_pytest_plugin.py:790: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = args = ['--rootdir', './project', '--inline-snapshot=create'] def run_pytest( self, args: list[str] = [], *, term_columns=80, env: dict[str, str] = {}, changed_files: Snapshot[dict[str, str]] | None = None, report: Snapshot[str] | None = None, stderr: Snapshot[str] | None = None, returncode: Snapshot[int] | None = None, ) -> Example: """Run pytest with the given args and env variables in an seperate process. It can be used to test the interaction between your code and pytest, but it is a bit slower than `run_inline` Parameters: args: pytest arguments like "--inline-snapshot=fix" env: dict of environment variables changed_files: snapshot of files which are changed by this run. report: snapshot of the report at the end of the pytest run. stderr: pytest stderr output returncode: snapshot of the pytest returncode. Returns: A new Example instance which contains the changed files. """ with TemporaryDirectory() as dir: tmp_path = Path(dir) self._write_files(tmp_path) cmd = [sys.executable, "-m", "pytest", *args] command_env = dict(os.environ) command_env["TERM"] = "unknown" command_env["COLUMNS"] = str( term_columns + 1 if platform.system() == "Windows" else term_columns ) command_env.pop("CI", None) command_env.update(env) result = sp.run(cmd, cwd=tmp_path, capture_output=True, env=command_env) print("run>", *cmd) print("stdout:") print(result.stdout.decode()) print("stderr:") print(result.stderr.decode()) if returncode is not None: assert result.returncode == returncode if stderr is not None: assert result.stderr.decode() == stderr if report is not None: report_list = [] record = False for line in result.stdout.decode().splitlines(): line = line.strip() if line.startswith("===="): record = False if record and line: report_list.append(line) if line.startswith("====") and "inline snapshot" in line: record = True report_str = "\n".join(report_list) assert normalize(report_str) == report, repr(report_str) if changed_files is not None: current_files = {} for name, content in sorted(self._read_files(tmp_path).items()): if name not in self.files or self.files[name] != content: current_files[name] = content > assert changed_files == current_files E assert {'project/tes...9f*.txt"))\n'} == {} E E Left contains 1 more item: E {'project/test_something.py': 'from inline_snapshot import ' E 'outsource,snapshot,external\n' E '\n' E 'def test_something():\n' E ' assert outsource("test") == ' E 'snapshot(external("9f*.txt"))\n'} E Use -v to get more diff /usr/lib/python3/dist-packages/inline_snapshot/testing/_example.py:327: AssertionError ----------------------------- Captured stdout call ----------------------------- file: pyproject.toml [tool.inline-snapshot] hash-length=2 file: project/pytest.ini file: project/test_something.py from inline_snapshot import outsource,snapshot,external def test_something(): assert outsource("test") == snapshot() run> /usr/bin/python3.12 -m pytest --rootdir ./project --inline-snapshot=create stdout: ============================= test session starts ============================== platform linux -- Python 3.12.8, pytest-8.3.4, pluggy-1.5.0 rootdir: /tmp/tmpzhe0bl4m/project configfile: ../pyproject.toml plugins: inline-snapshot-0.19.3, mock-3.14.0, hypothesis-6.124.0, time-machine-2.16.0, subtests-0.13.1, pytest_freezer-0.4.9 collected 1 item project/test_something.py F [100%] =================================== FAILURES =================================== ________________________________ test_something ________________________________ def test_something(): > assert outsource("test") == snapshot() project/test_something.py:4: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '', filename = PosixPath('/tmp/tmpzhe0bl4m/project/test_something.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError =============================== inline snapshot ================================ =========================== short test summary info ============================ FAILED project/test_something.py::test_something - TypeError: CliRunner.__ini... ============================== 1 failed in 0.12s =============================== stderr: _________________________________ test_rewrite _________________________________ tmp_path = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_rewrite0') def test_rewrite(tmp_path): file = tmp_path / "file.txt" file.write_text( """ 12345 12345 12345 """, "utf-8", ) with ChangeRecorder().activate() as recorder: s = recorder.change_set() s.replace(((2, 2), (2, 3)), "a", filename=file) s.delete(((3, 2), (3, 3)), filename=file) s.insert((4, 2), "c", filename=file) assert recorder.num_fixes() == 1 > recorder.fix_all() tests/test_rewrite_code.py:43: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:240: in fix_all file.rewrite() /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:135: in rewrite new_code = self.new_code() /usr/lib/python3/dist-packages/inline_snapshot/_rewrite_code.py:163: in new_code format_whole_file = enforce_formatting() or code == format_code( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '\n12345\n12345\n12345\n' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_rewrite0/file.txt') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ______________________________ test_string_update ______________________________ check_update = .w at 0x7f6a3dca8360> def test_string_update(check_update): # black --preview wraps strings to keep the line length. # string concatenation should produce updates. assert ( check_update( 'assert "ab" == snapshot("a" "b")', reported_flags="", flags="update" ) == 'assert "ab" == snapshot("a" "b")' ) assert ( check_update( 'assert "ab" == snapshot("a"\n "b")', reported_flags="", flags="update" ) == 'assert "ab" == snapshot("a"\n "b")' ) > assert check_update( 'assert "ab\\nc" == snapshot("a"\n "b\\nc")', flags="update" ) == snapshot( '''\ assert "ab\\nc" == snapshot("""\\ ab c\\ """)\ ''' ) tests/test_string.py:26: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:49: in w s = source(source_code) tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:114: in run exec(compile(filename.read_text("utf-8"), filename, "exec"), {}) /tmp/pytest-of-unshare/pytest-0/test_string_update0/test_5.py:9: in assert "ab\nc" == snapshot("a" /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:224: in __eq__ return self == other /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:275: in __eq__ self._changes.append(next(it)) /usr/lib/python3/dist-packages/inline_snapshot/_adapter/value_adapter.py:60: in assign new_code = self.context.file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '"""\\\nab\nc\\\n"""' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_string_update0/test_5.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert "ab" == snapshot("a" "b") reported_flags: set() run: pytest --inline-snapshot= output: |assert "ab" == snapshot("a" "b") input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert "ab" == snapshot("a" "b") reported_flags: set() run: pytest --inline-snapshot=update output: |assert "ab" == snapshot("a" "b") input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert "ab" == snapshot("a" | "b") reported_flags: set() run: pytest --inline-snapshot= output: |assert "ab" == snapshot("a" | "b") input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert "ab" == snapshot("a" | "b") reported_flags: set() run: pytest --inline-snapshot=update output: |assert "ab" == snapshot("a" | "b") input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |assert "ab\nc" == snapshot("a" | "b\nc") _____________________________ test_string_newline ______________________________ check_update = .w at 0x7f6a3dcaab60> def test_string_newline(check_update): > assert check_update('s = snapshot("a\\nb")', flags="update") == snapshot( '''\ s = snapshot("""\\ a b\\ """)\ ''' ) tests/test_string.py:46: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:49: in w s = source(source_code) tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:125: in run changes += snapshot._changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes yield from self._value._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:218: in _get_changes yield from handle(self._ast_node, self._old_value) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:206: in handle new_code = self._file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '"""\\\na\nb\\\n"""' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_string_newline0/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |s = snapshot("a\nb") ___________________________ test_string_quote_choice ___________________________ check_update = .w at 0x7f6a3dcabba0> def test_string_quote_choice(check_update): > assert check_update( "s = snapshot(\" \\'\\'\\' \\'\\'\\' \\\"\\\"\\\"\\nother_line\")", flags="update", ) == snapshot( '''\ s = snapshot("""\\ \'\'\' \'\'\' \\"\\"\\" other_line\\ """)\ ''' ) tests/test_string.py:115: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/conftest.py:49: in w s = source(source_code) tests/conftest.py:158: in w return Source(source=source).run() tests/conftest.py:125: in run changes += snapshot._changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:671: in _changes yield from self._value._get_changes() /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:218: in _get_changes yield from handle(self._ast_node, self._old_value) /usr/lib/python3/dist-packages/inline_snapshot/_inline_snapshot.py:206: in handle new_code = self._file._token_to_code(new_token) /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:34: in _token_to_code return self._format(tokenize.untokenize(tokens)).strip() /usr/lib/python3/dist-packages/inline_snapshot/_source_file.py:28: in _format return format_code(text, Path(self._source.filename)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = '"""\\\n \'\'\' \'\'\' \\"\\"\\"\nother_line\\\n"""' filename = PosixPath('/tmp/pytest-of-unshare/pytest-0/test_string_quote_choice0/test_1.py') def format_code(text, filename): if _config.config.format_command is not None: format_command = _config.config.format_command.format(filename=filename) result = sp.run( format_command, shell=True, input=text.encode("utf-8"), capture_output=True ) if result.returncode != 0: raise_problem( f"""\ [b]The format_command '{escape(format_command)}' caused the following error:[/b] """ + result.stdout.decode("utf-8") + result.stderr.decode("utf-8") ) return text return result.stdout.decode("utf-8") try: from black import main from click.testing import CliRunner except ImportError: raise_problem( f"""\ [b]inline-snapshot is not able to format your code.[/b] This issue can be solved by: * installing {escape('inline-snapshot[black]')} which gives you the same formatting like in older versions * adding a `format-command` to your pyproject.toml (see [link=https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command]https://15r10nk.github.io/inline-snapshot/latest/configuration/#format-command[/link] for more information). """ ) return text with warnings.catch_warnings(): warnings.simplefilter("ignore") > runner = CliRunner(mix_stderr=False) E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' /usr/lib/python3/dist-packages/inline_snapshot/_format.py:48: TypeError ----------------------------- Captured stdout call ----------------------------- input: |""" |PYTEST_DONT_REWRITE |""" |# äöß 🐍 |from inline_snapshot import snapshot |from inline_snapshot import external |from inline_snapshot import outsource | |s = snapshot(" \'\'\' \'\'\' \"\"\"\nother_line") =============================== warnings summary =============================== tests/adapter/test_sequence.py:64 /tmp/autopkgtest.ImMzGl/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 @pytest.mark.no_rewriting tests/test_inline_snapshot.py:17 /tmp/autopkgtest.ImMzGl/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 @pytest.mark.no_rewriting tests/test_inline_snapshot.py:24 /tmp/autopkgtest.ImMzGl/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 @pytest.mark.no_rewriting tests/test_pypy.py:8 /tmp/autopkgtest.ImMzGl/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 @pytest.mark.no_rewriting tests/test_pytest_plugin.py:275 /tmp/autopkgtest.ImMzGl/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 @pytest.mark.no_rewriting tests/test_pytest_plugin.py:501 /tmp/autopkgtest.ImMzGl/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 @pytest.mark.no_rewriting -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html =============================== inline snapshot ================================ Error: one snapshot has incorrect values (--inline-snapshot=fix) You can also use --inline-snapshot=review to approve the changes interactively =========================== short test summary info ============================ FAILED tests/adapter/test_dataclass.py::test_unmanaged - TypeError: CliRunner... FAILED tests/adapter/test_dataclass.py::test_reeval - assert None == ('TypeEr... FAILED tests/adapter/test_dataclass.py::test_dataclass_default_value - TypeEr... FAILED tests/adapter/test_dataclass.py::test_attrs_default_value - AssertionE... FAILED tests/adapter/test_dataclass.py::test_attrs_field_repr - AssertionErro... FAILED tests/adapter/test_dataclass.py::test_disabled[executing] - TypeError:... FAILED tests/adapter/test_dataclass.py::test_disabled[without-executing] - At... FAILED tests/adapter/test_dataclass.py::test_add_argument - TypeError: CliRun... FAILED tests/adapter/test_dataclass.py::test_remove_positional_argument - ass... FAILED tests/adapter/test_dataclass.py::test_namedtuple - assert {'test_somet... FAILED tests/adapter/test_dataclass.py::test_defaultdict - assert {'test_some... FAILED tests/adapter/test_dataclass.py::test_dataclass_field_repr - assert No... FAILED tests/adapter/test_dataclass.py::test_dataclass_var - assert None == (... FAILED tests/adapter/test_dict.py::test_dict_var - assert None == ('TypeError... FAILED tests/adapter/test_general.py::test_adapter_mismatch - assert None == ... FAILED tests/adapter/test_sequence.py::test_list_adapter_create_inner_snapshot FAILED tests/adapter/test_sequence.py::test_list_adapter_fix_inner_snapshot FAILED tests/adapter/test_sequence.py::test_list_var - assert None == ('TypeE... FAILED tests/test_change.py::test_change_function_args - TypeError: CliRunner... FAILED tests/test_code_repr.py::test_enum - TypeError: CliRunner.__init__() g... FAILED tests/test_code_repr.py::test_snapshot_generates_hasrepr - TypeError: ... FAILED tests/test_code_repr.py::test_enum_in_dataclass - TypeError: CliRunner... FAILED tests/test_code_repr.py::test_flag - TypeError: CliRunner.__init__() g... FAILED tests/test_code_repr.py::test_type - TypeError: CliRunner.__init__() g... FAILED tests/test_code_repr.py::test_qualname - assert None == ('TypeError:\n... FAILED tests/test_code_repr.py::test_invalid_repr - TypeError: CliRunner.__in... FAILED tests/test_config.py::test_config_pyproject - AssertionError: assert {... FAILED tests/test_config.py::test_config_env - AssertionError: assert {'test_... FAILED tests/test_config.py::test_shortcuts - AssertionError: assert {'test_a... FAILED tests/test_config.py::test_default_shortcuts - AssertionError: assert ... FAILED tests/test_dirty_equals.py::test_compare_dirty_equals_twice - assert N... FAILED tests/test_dirty_equals.py::test_dirty_equals_with_changing_args - ass... FAILED tests/test_example.py::test_example - AssertionError: assert [] == ['f... FAILED tests/test_external.py::test_basic - TypeError: CliRunner.__init__() g... FAILED tests/test_external.py::test_persist - TypeError: CliRunner.__init__()... FAILED tests/test_external.py::test_pytest_compare_external - TypeError: CliR... FAILED tests/test_external.py::test_pytest_compare_external_bytes - TypeError... FAILED tests/test_external.py::test_pytest_existing_external_import - TypeErr... FAILED tests/test_external.py::test_pytest_trim_external - TypeError: CliRunn... FAILED tests/test_external.py::test_pytest_new_external - TypeError: CliRunne... FAILED tests/test_external.py::test_pytest_config_hash_length - TypeError: Cl... FAILED tests/test_external.py::test_no_imports - AssertionError: assert {'err... FAILED tests/test_external.py::test_ensure_imports - TypeError: CliRunner.__i... FAILED tests/test_external.py::test_ensure_imports_with_comment - TypeError: ... FAILED tests/test_external.py::test_new_externals - TypeError: CliRunner.__in... FAILED tests/test_formating.py::test_black_formatting_error - assert None == ... FAILED tests/test_formating.py::test_fstring_139 - AssertionError: assert 1 == 0 [assert 4 == snapshot()] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] [assert 4 == snapshot({})[0]] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] [assert 4 == snapshot(5)] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] [assert 4 == snapshot({0: 5})[0]] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] [assert 4 == snapshot(2+2)] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] [assert 4 == snapshot({0: 2+2})[0]] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] [assert 4 <= snapshot()] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] [assert 4 <= snapshot({})[0]] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] [assert 4 <= snapshot(5)] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] [assert 4 <= snapshot({0: 5})[0]] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] [assert 5 <= snapshot(4)] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] [assert 5 <= snapshot({0: 4})[0]] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] [assert 5 <= snapshot(3+2)] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] [assert 5 <= snapshot({0: 3+2})[0]] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] [assert 5 >= snapshot()] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] [assert 5 >= snapshot({})[0]] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] [assert 5 >= snapshot(4)] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] [assert 5 >= snapshot({0: 4})[0]] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] [assert 4 >= snapshot(5)] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] [assert 4 >= snapshot({0: 5})[0]] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] [assert 5 >= snapshot(3+2)] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] [assert 5 >= snapshot({0: 3+2})[0]] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] [assert 5 in snapshot()] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] [assert 5 in snapshot({})[0]] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] [assert 5 in snapshot([4, 5])] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] [assert 5 in snapshot({0: [4, 5]})[0]] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] [assert 5 in snapshot([])] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] [assert 5 in snapshot({0: []})[0]] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] [assert 5 in snapshot([3+2])] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] [assert 5 in snapshot({0: [3+2]})[0]] SUBFAIL tests/test_inline_snapshot.py::test_generic[executing] FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(==) fix(==)] FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(==) update(==)] FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(==) create(<=)] FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(==) trim(<=)] FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(==) fix(<=)] FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(==) update(<=)] FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(==) create(>=)] FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(==) trim(>=)] FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(==) fix(>=)] FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(==) update(>=)] FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(==) create(in)] FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(==) trim(in)] FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(==) fix(in)] FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(==) update(in)] FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(==) update(==)] FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(==) create(<=)] FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(==) trim(<=)] FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(==) fix(<=)] FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(==) update(<=)] FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(==) create(>=)] FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(==) trim(>=)] FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(==) fix(>=)] FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(==) update(>=)] FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(==) create(in)] FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(==) trim(in)] FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(==) fix(in)] FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(==) update(in)] FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(==) create(<=)] FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(==) trim(<=)] FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(==) fix(<=)] FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(==) update(<=)] FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(==) create(>=)] FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(==) trim(>=)] FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(==) fix(>=)] FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(==) update(>=)] FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(==) create(in)] FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(==) trim(in)] FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(==) fix(in)] FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(==) update(in)] FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(<=) trim(<=)] FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(<=) fix(<=)] FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(<=) update(<=)] FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(<=) create(>=)] FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(<=) trim(>=)] FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(<=) fix(>=)] FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(<=) update(>=)] FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(<=) create(in)] FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(<=) trim(in)] FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(<=) fix(in)] FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(<=) update(in)] FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-trim(<=) fix(<=)] FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-trim(<=) update(<=)] FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-trim(<=) create(>=)] FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-trim(<=) trim(>=)] FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-trim(<=) fix(>=)] FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-trim(<=) update(>=)] FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-trim(<=) create(in)] FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-trim(<=) trim(in)] FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-trim(<=) fix(in)] FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-trim(<=) update(in)] FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(<=) update(<=)] FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(<=) create(>=)] FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(<=) trim(>=)] FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(<=) fix(>=)] FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(<=) update(>=)] FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(<=) create(in)] FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(<=) trim(in)] FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(<=) fix(in)] FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(<=) update(in)] FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(<=) create(>=)] FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(<=) trim(>=)] FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(<=) fix(>=)] FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(<=) update(>=)] FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(<=) create(in)] FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(<=) trim(in)] FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(<=) fix(in)] FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(<=) update(in)] FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(>=) trim(>=)] FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(>=) fix(>=)] FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(>=) update(>=)] FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(>=) create(in)] FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(>=) trim(in)] FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(>=) fix(in)] FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(>=) update(in)] FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-trim(>=) fix(>=)] FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-trim(>=) update(>=)] FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-trim(>=) create(in)] FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-trim(>=) trim(in)] FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-trim(>=) fix(in)] FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-trim(>=) update(in)] FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(>=) update(>=)] FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(>=) create(in)] FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(>=) trim(in)] FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(>=) fix(in)] FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(>=) update(in)] FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(>=) create(in)] FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(>=) trim(in)] FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(>=) fix(in)] FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-update(>=) update(in)] FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(in) trim(in)] FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(in) fix(in)] FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-create(in) update(in)] FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-trim(in) fix(in)] FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-trim(in) update(in)] FAILED tests/test_inline_snapshot.py::test_generic_multi[executing-fix(in) update(in)] FAILED tests/test_inline_snapshot.py::test_mutable_values - TypeError: CliRun... FAILED tests/test_inline_snapshot.py::test_comparison - TypeError: CliRunner.... FAILED tests/test_inline_snapshot.py::test_ge - TypeError: CliRunner.__init__... FAILED tests/test_inline_snapshot.py::test_le - TypeError: CliRunner.__init__... FAILED tests/test_inline_snapshot.py::test_contains - TypeError: CliRunner.__... FAILED tests/test_inline_snapshot.py::test_getitem - TypeError: CliRunner.__i... FAILED tests/test_inline_snapshot.py::test_assert - TypeError: CliRunner.__in... FAILED tests/test_inline_snapshot.py::test_format_file - TypeError: CliRunner... FAILED tests/test_inline_snapshot.py::test_format_value - TypeError: CliRunne... FAILED tests/test_inline_snapshot.py::test_type_error - TypeError: CliRunner.... FAILED tests/test_inline_snapshot.py::test_different_snapshot_name - TypeErro... FAILED tests/test_inline_snapshot.py::test_quoting_change_is_no_update - Type... FAILED tests/test_inline_snapshot.py::test_trailing_comma - TypeError: CliRun... FAILED tests/test_inline_snapshot.py::test_is - assert None == ('TypeError:\n... FAILED tests/test_is.py::test_missing_is - TypeError: CliRunner.__init__() go... FAILED tests/test_is_normalized.py::test_repr - assert None == ('TypeError:\n... FAILED tests/test_preserve_values.py::test_fix_list_fix - TypeError: CliRunne... FAILED tests/test_preserve_values.py::test_fix_list_insert - TypeError: CliRu... FAILED tests/test_preserve_values.py::test_fix_list_delete - TypeError: CliRu... FAILED tests/test_preserve_values.py::test_fix_tuple_delete - TypeError: CliR... FAILED tests/test_preserve_values.py::test_fix_dict_change - TypeError: CliRu... FAILED tests/test_preserve_values.py::test_fix_dict_remove - TypeError: CliRu... FAILED tests/test_preserve_values.py::test_fix_dict_insert - TypeError: CliRu... FAILED tests/test_preserve_values.py::test_fix_dict_with_non_literal_keys - T... FAILED tests/test_preserve_values.py::test_no_update_for_dirty_equals - TypeE... FAILED tests/test_preserve_values.py::test_preserve_case_from_original_mr - T... [[5, 5, 5] -> [] ] SUBFAIL tests/test_preserve_values.py::test_generic [[5, 5] -> [8] ] SUBFAIL tests/test_preserve_values.py::test_generic - T... [[5, 5, 2+2] -> [4] ] SUBFAIL tests/test_preserve_values.py::test_generic [[5, 5, 3] -> [3] ] SUBFAIL tests/test_preserve_values.py::test_generic [[5, 5] -> [8] ] SUBFAIL tests/test_preserve_values.py::test_generic - T... [[5] -> [8, 8] ] SUBFAIL tests/test_preserve_values.py::test_generic - T... [[5, 2+2] -> [8, 4] ] SUBFAIL tests/test_preserve_values.py::test_generic [[5, 3] -> [8, 3] ] SUBFAIL tests/test_preserve_values.py::test_generic [[5, 2+2, 5] -> [4] ] SUBFAIL tests/test_preserve_values.py::test_generic [[5, 2+2] -> [4, 8] ] SUBFAIL tests/test_preserve_values.py::test_generic [[5, 2+2, 2+2] -> [4, 4] ] SUBFAIL tests/test_preserve_values.py::test_generic [[5, 2+2, 3] -> [4, 3] ] SUBFAIL tests/test_preserve_values.py::test_generic [[5, 3, 5] -> [3] ] SUBFAIL tests/test_preserve_values.py::test_generic [[5, 3] -> [3, 8] ] SUBFAIL tests/test_preserve_values.py::test_generic [[5, 3, 2+2] -> [3, 4] ] SUBFAIL tests/test_preserve_values.py::test_generic [[5, 3, 3] -> [3, 3] ] SUBFAIL tests/test_preserve_values.py::test_generic [[5, 5] -> [8] ] SUBFAIL tests/test_preserve_values.py::test_generic - T... [[5] -> [8, 8] ] SUBFAIL tests/test_preserve_values.py::test_generic - T... [[5, 2+2] -> [8, 4] ] SUBFAIL tests/test_preserve_values.py::test_generic [[5, 3] -> [8, 3] ] SUBFAIL tests/test_preserve_values.py::test_generic [[5] -> [8, 8] ] SUBFAIL tests/test_preserve_values.py::test_generic - T... [[] -> [8, 8, 8] ] SUBFAIL tests/test_preserve_values.py::test_generic [[2+2] -> [8, 8, 4] ] SUBFAIL tests/test_preserve_values.py::test_generic [[3] -> [8, 8, 3] ] SUBFAIL tests/test_preserve_values.py::test_generic [[2+2, 5] -> [8, 4] ] SUBFAIL tests/test_preserve_values.py::test_generic [[2+2] -> [8, 4, 8] ] SUBFAIL tests/test_preserve_values.py::test_generic [[2+2, 2+2] -> [8, 4, 4] ] SUBFAIL tests/test_preserve_values.py::test_generic [[2+2, 3] -> [8, 4, 3] ] SUBFAIL tests/test_preserve_values.py::test_generic [[3, 5] -> [8, 3] ] SUBFAIL tests/test_preserve_values.py::test_generic [[3] -> [8, 3, 8] ] SUBFAIL tests/test_preserve_values.py::test_generic [[3, 2+2] -> [8, 3, 4] ] SUBFAIL tests/test_preserve_values.py::test_generic [[3, 3] -> [8, 3, 3] ] SUBFAIL tests/test_preserve_values.py::test_generic [[2+2, 5, 5] -> [4] ] SUBFAIL tests/test_preserve_values.py::test_generic [[2+2, 5] -> [4, 8] ] SUBFAIL tests/test_preserve_values.py::test_generic [[2+2, 5, 2+2] -> [4, 4] ] SUBFAIL tests/test_preserve_values.py::test_generic [[2+2, 5, 3] -> [4, 3] ] SUBFAIL tests/test_preserve_values.py::test_generic [[2+2, 5] -> [4, 8] ] SUBFAIL tests/test_preserve_values.py::test_generic [[2+2] -> [4, 8, 8] ] SUBFAIL tests/test_preserve_values.py::test_generic [[2+2, 2+2] -> [4, 8, 4] ] SUBFAIL tests/test_preserve_values.py::test_generic [[2+2, 3] -> [4, 8, 3] ] SUBFAIL tests/test_preserve_values.py::test_generic [[2+2, 2+2, 5] -> [4, 4] ] SUBFAIL tests/test_preserve_values.py::test_generic [[2+2, 2+2] -> [4, 4, 8] ] SUBFAIL tests/test_preserve_values.py::test_generic [[2+2, 2+2, 2+2] -> [4, 4, 4] ] SUBFAIL tests/test_preserve_values.py::test_generic [[2+2, 2+2, 3] -> [4, 4, 3] ] SUBFAIL tests/test_preserve_values.py::test_generic [[2+2, 3, 5] -> [4, 3] ] SUBFAIL tests/test_preserve_values.py::test_generic [[2+2, 3] -> [4, 3, 8] ] SUBFAIL tests/test_preserve_values.py::test_generic [[2+2, 3, 2+2] -> [4, 3, 4] ] SUBFAIL tests/test_preserve_values.py::test_generic [[2+2, 3, 3] -> [4, 3, 3] ] SUBFAIL tests/test_preserve_values.py::test_generic [[3, 5, 5] -> [3] ] SUBFAIL tests/test_preserve_values.py::test_generic [[3, 5] -> [3, 8] ] SUBFAIL tests/test_preserve_values.py::test_generic [[3, 5, 2+2] -> [3, 4] ] SUBFAIL tests/test_preserve_values.py::test_generic [[3, 5, 3] -> [3, 3] ] SUBFAIL tests/test_preserve_values.py::test_generic [[3, 5] -> [3, 8] ] SUBFAIL tests/test_preserve_values.py::test_generic [[3] -> [3, 8, 8] ] SUBFAIL tests/test_preserve_values.py::test_generic [[3, 2+2] -> [3, 8, 4] ] SUBFAIL tests/test_preserve_values.py::test_generic [[3, 3] -> [3, 8, 3] ] SUBFAIL tests/test_preserve_values.py::test_generic [[3, 2+2, 5] -> [3, 4] ] SUBFAIL tests/test_preserve_values.py::test_generic [[3, 2+2] -> [3, 4, 8] ] SUBFAIL tests/test_preserve_values.py::test_generic [[3, 2+2, 2+2] -> [3, 4, 4] ] SUBFAIL tests/test_preserve_values.py::test_generic [[3, 2+2, 3] -> [3, 4, 3] ] SUBFAIL tests/test_preserve_values.py::test_generic [[3, 3, 5] -> [3, 3] ] SUBFAIL tests/test_preserve_values.py::test_generic [[3, 3] -> [3, 3, 8] ] SUBFAIL tests/test_preserve_values.py::test_generic [[3, 3, 2+2] -> [3, 3, 4] ] SUBFAIL tests/test_preserve_values.py::test_generic [(5, 5, 5) -> () ] SUBFAIL tests/test_preserve_values.py::test_generic [(5, 5) -> (8,) ] SUBFAIL tests/test_preserve_values.py::test_generic - ... [(5, 5, 2+2) -> (4,) ] SUBFAIL tests/test_preserve_values.py::test_generic [(5, 5, 3) -> (3,) ] SUBFAIL tests/test_preserve_values.py::test_generic [(5, 5) -> (8,) ] SUBFAIL tests/test_preserve_values.py::test_generic - ... [(5,) -> (8, 8) ] SUBFAIL tests/test_preserve_values.py::test_generic - ... [(5, 2+2) -> (8, 4) ] SUBFAIL tests/test_preserve_values.py::test_generic [(5, 3) -> (8, 3) ] SUBFAIL tests/test_preserve_values.py::test_generic [(5, 2+2, 5) -> (4,) ] SUBFAIL tests/test_preserve_values.py::test_generic [(5, 2+2) -> (4, 8) ] SUBFAIL tests/test_preserve_values.py::test_generic [(5, 2+2, 2+2) -> (4, 4) ] SUBFAIL tests/test_preserve_values.py::test_generic [(5, 2+2, 3) -> (4, 3) ] SUBFAIL tests/test_preserve_values.py::test_generic [(5, 3, 5) -> (3,) ] SUBFAIL tests/test_preserve_values.py::test_generic [(5, 3) -> (3, 8) ] SUBFAIL tests/test_preserve_values.py::test_generic [(5, 3, 2+2) -> (3, 4) ] SUBFAIL tests/test_preserve_values.py::test_generic [(5, 3, 3) -> (3, 3) ] SUBFAIL tests/test_preserve_values.py::test_generic [(5, 5) -> (8,) ] SUBFAIL tests/test_preserve_values.py::test_generic - ... [(5,) -> (8, 8) ] SUBFAIL tests/test_preserve_values.py::test_generic - ... [(5, 2+2) -> (8, 4) ] SUBFAIL tests/test_preserve_values.py::test_generic [(5, 3) -> (8, 3) ] SUBFAIL tests/test_preserve_values.py::test_generic [(5,) -> (8, 8) ] SUBFAIL tests/test_preserve_values.py::test_generic - ... [() -> (8, 8, 8) ] SUBFAIL tests/test_preserve_values.py::test_generic [(2+2,) -> (8, 8, 4) ] SUBFAIL tests/test_preserve_values.py::test_generic [(3,) -> (8, 8, 3) ] SUBFAIL tests/test_preserve_values.py::test_generic [(2+2, 5) -> (8, 4) ] SUBFAIL tests/test_preserve_values.py::test_generic [(2+2,) -> (8, 4, 8) ] SUBFAIL tests/test_preserve_values.py::test_generic [(2+2, 2+2) -> (8, 4, 4) ] SUBFAIL tests/test_preserve_values.py::test_generic [(2+2, 3) -> (8, 4, 3) ] SUBFAIL tests/test_preserve_values.py::test_generic [(3, 5) -> (8, 3) ] SUBFAIL tests/test_preserve_values.py::test_generic [(3,) -> (8, 3, 8) ] SUBFAIL tests/test_preserve_values.py::test_generic [(3, 2+2) -> (8, 3, 4) ] SUBFAIL tests/test_preserve_values.py::test_generic [(3, 3) -> (8, 3, 3) ] SUBFAIL tests/test_preserve_values.py::test_generic [(2+2, 5, 5) -> (4,) ] SUBFAIL tests/test_preserve_values.py::test_generic [(2+2, 5) -> (4, 8) ] SUBFAIL tests/test_preserve_values.py::test_generic [(2+2, 5, 2+2) -> (4, 4) ] SUBFAIL tests/test_preserve_values.py::test_generic [(2+2, 5, 3) -> (4, 3) ] SUBFAIL tests/test_preserve_values.py::test_generic [(2+2, 5) -> (4, 8) ] SUBFAIL tests/test_preserve_values.py::test_generic [(2+2,) -> (4, 8, 8) ] SUBFAIL tests/test_preserve_values.py::test_generic [(2+2, 2+2) -> (4, 8, 4) ] SUBFAIL tests/test_preserve_values.py::test_generic [(2+2, 3) -> (4, 8, 3) ] SUBFAIL tests/test_preserve_values.py::test_generic [(2+2, 2+2, 5) -> (4, 4) ] SUBFAIL tests/test_preserve_values.py::test_generic [(2+2, 2+2) -> (4, 4, 8) ] SUBFAIL tests/test_preserve_values.py::test_generic [(2+2, 2+2, 2+2) -> (4, 4, 4) ] SUBFAIL tests/test_preserve_values.py::test_generic [(2+2, 2+2, 3) -> (4, 4, 3) ] SUBFAIL tests/test_preserve_values.py::test_generic [(2+2, 3, 5) -> (4, 3) ] SUBFAIL tests/test_preserve_values.py::test_generic [(2+2, 3) -> (4, 3, 8) ] SUBFAIL tests/test_preserve_values.py::test_generic [(2+2, 3, 2+2) -> (4, 3, 4) ] SUBFAIL tests/test_preserve_values.py::test_generic [(2+2, 3, 3) -> (4, 3, 3) ] SUBFAIL tests/test_preserve_values.py::test_generic [(3, 5, 5) -> (3,) ] SUBFAIL tests/test_preserve_values.py::test_generic [(3, 5) -> (3, 8) ] SUBFAIL tests/test_preserve_values.py::test_generic [(3, 5, 2+2) -> (3, 4) ] SUBFAIL tests/test_preserve_values.py::test_generic [(3, 5, 3) -> (3, 3) ] SUBFAIL tests/test_preserve_values.py::test_generic [(3, 5) -> (3, 8) ] SUBFAIL tests/test_preserve_values.py::test_generic [(3,) -> (3, 8, 8) ] SUBFAIL tests/test_preserve_values.py::test_generic [(3, 2+2) -> (3, 8, 4) ] SUBFAIL tests/test_preserve_values.py::test_generic [(3, 3) -> (3, 8, 3) ] SUBFAIL tests/test_preserve_values.py::test_generic [(3, 2+2, 5) -> (3, 4) ] SUBFAIL tests/test_preserve_values.py::test_generic [(3, 2+2) -> (3, 4, 8) ] SUBFAIL tests/test_preserve_values.py::test_generic [(3, 2+2, 2+2) -> (3, 4, 4) ] SUBFAIL tests/test_preserve_values.py::test_generic [(3, 2+2, 3) -> (3, 4, 3) ] SUBFAIL tests/test_preserve_values.py::test_generic [(3, 3, 5) -> (3, 3) ] SUBFAIL tests/test_preserve_values.py::test_generic [(3, 3) -> (3, 3, 8) ] SUBFAIL tests/test_preserve_values.py::test_generic [(3, 3, 2+2) -> (3, 3, 4) ] SUBFAIL tests/test_preserve_values.py::test_generic [{0: 5, 1: 5, 2: 5} -> {} ] SUBFAIL tests/test_preserve_values.py::test_generic [{0: 5, 1: 5} -> {2: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic [{0: 5, 1: 5, 2: 2+2} -> {2: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic [{0: 5, 1: 5, 2: 3} -> {2: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic [{0: 5, 2: 5} -> {1: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic [{0: 5} -> {1: 8, 2: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic [{0: 5, 2: 2+2} -> {1: 8, 2: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic [{0: 5, 2: 3} -> {1: 8, 2: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic [{0: 5, 1: 2+2, 2: 5} -> {1: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic [{0: 5, 1: 2+2} -> {1: 4, 2: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic [{0: 5, 1: 2+2, 2: 2+2} -> {1: 4, 2: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic [{0: 5, 1: 2+2, 2: 3} -> {1: 4, 2: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic [{0: 5, 1: 3, 2: 5} -> {1: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic [{0: 5, 1: 3} -> {1: 3, 2: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic [{0: 5, 1: 3, 2: 2+2} -> {1: 3, 2: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic [{0: 5, 1: 3, 2: 3} -> {1: 3, 2: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic [{1: 5, 2: 5} -> {0: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic [{1: 5} -> {0: 8, 2: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic [{1: 5, 2: 2+2} -> {0: 8, 2: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic [{1: 5, 2: 3} -> {0: 8, 2: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic [{2: 5} -> {0: 8, 1: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic [{} -> {0: 8, 1: 8, 2: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic [{2: 2+2} -> {0: 8, 1: 8, 2: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic [{2: 3} -> {0: 8, 1: 8, 2: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic [{1: 2+2, 2: 5} -> {0: 8, 1: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic [{1: 2+2} -> {0: 8, 1: 4, 2: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic [{1: 2+2, 2: 2+2} -> {0: 8, 1: 4, 2: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic [{1: 2+2, 2: 3} -> {0: 8, 1: 4, 2: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic [{1: 3, 2: 5} -> {0: 8, 1: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic [{1: 3} -> {0: 8, 1: 3, 2: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic [{1: 3, 2: 2+2} -> {0: 8, 1: 3, 2: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic [{1: 3, 2: 3} -> {0: 8, 1: 3, 2: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic [{0: 2+2, 1: 5, 2: 5} -> {0: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic [{0: 2+2, 1: 5} -> {0: 4, 2: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic [{0: 2+2, 1: 5, 2: 2+2} -> {0: 4, 2: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic [{0: 2+2, 1: 5, 2: 3} -> {0: 4, 2: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic [{0: 2+2, 2: 5} -> {0: 4, 1: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic [{0: 2+2} -> {0: 4, 1: 8, 2: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic [{0: 2+2, 2: 2+2} -> {0: 4, 1: 8, 2: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic [{0: 2+2, 2: 3} -> {0: 4, 1: 8, 2: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic [{0: 2+2, 1: 2+2, 2: 5} -> {0: 4, 1: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic [{0: 2+2, 1: 2+2} -> {0: 4, 1: 4, 2: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic [{0: 2+2, 1: 2+2, 2: 2+2} -> {0: 4, 1: 4, 2: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic [{0: 2+2, 1: 2+2, 2: 3} -> {0: 4, 1: 4, 2: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic [{0: 2+2, 1: 3, 2: 5} -> {0: 4, 1: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic [{0: 2+2, 1: 3} -> {0: 4, 1: 3, 2: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic [{0: 2+2, 1: 3, 2: 2+2} -> {0: 4, 1: 3, 2: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic [{0: 2+2, 1: 3, 2: 3} -> {0: 4, 1: 3, 2: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic [{0: 3, 1: 5, 2: 5} -> {0: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic [{0: 3, 1: 5} -> {0: 3, 2: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic [{0: 3, 1: 5, 2: 2+2} -> {0: 3, 2: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic [{0: 3, 1: 5, 2: 3} -> {0: 3, 2: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic [{0: 3, 2: 5} -> {0: 3, 1: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic [{0: 3} -> {0: 3, 1: 8, 2: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic [{0: 3, 2: 2+2} -> {0: 3, 1: 8, 2: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic [{0: 3, 2: 3} -> {0: 3, 1: 8, 2: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic [{0: 3, 1: 2+2, 2: 5} -> {0: 3, 1: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic [{0: 3, 1: 2+2} -> {0: 3, 1: 4, 2: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic [{0: 3, 1: 2+2, 2: 2+2} -> {0: 3, 1: 4, 2: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic [{0: 3, 1: 2+2, 2: 3} -> {0: 3, 1: 4, 2: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic [{0: 3, 1: 3, 2: 5} -> {0: 3, 1: 3} ] SUBFAIL tests/test_preserve_values.py::test_generic [{0: 3, 1: 3} -> {0: 3, 1: 3, 2: 8} ] SUBFAIL tests/test_preserve_values.py::test_generic [{0: 3, 1: 3, 2: 2+2} -> {0: 3, 1: 3, 2: 4} ] SUBFAIL tests/test_preserve_values.py::test_generic FAILED tests/test_pydantic.py::test_pydantic_create_snapshot - AssertionError... FAILED tests/test_pydantic.py::test_pydantic_field_repr - AssertionError: ass... FAILED tests/test_pydantic.py::test_pydantic_default_value - AssertionError: ... FAILED tests/test_pydantic.py::test_pydantic_factory_method - AssertionError:... FAILED tests/test_pypy.py::test_pypy - TypeError: CliRunner.__init__() got an... FAILED tests/test_pytest_plugin.py::test_create - AssertionError: assert {'er... FAILED tests/test_pytest_plugin.py::test_fix - AssertionError: assert {'error... FAILED tests/test_pytest_plugin.py::test_update - AssertionError: assert {'er... FAILED tests/test_pytest_plugin.py::test_trim - TypeError: CliRunner.__init__... FAILED tests/test_pytest_plugin.py::test_multiple - AssertionError: assert {'... FAILED tests/test_pytest_plugin.py::test_multiple_report - TypeError: CliRunn... FAILED tests/test_pytest_plugin.py::test_black_config - TypeError: CliRunner.... FAILED tests/test_pytest_plugin.py::test_disabled - TypeError: CliRunner.__in... FAILED tests/test_pytest_plugin.py::test_compare - TypeError: CliRunner.__ini... FAILED tests/test_pytest_plugin.py::test_assertion_error_loop - TypeError: Cl... FAILED tests/test_pytest_plugin.py::test_assertion_error - TypeError: CliRunn... FAILED tests/test_pytest_plugin.py::test_pytest_inlinesnapshot_auto - TypeErr... FAILED tests/test_pytest_plugin.py::test_persist_unknown_external - TypeError... FAILED tests/test_pytest_plugin.py::test_diff_multiple_files - TypeError: Cli... FAILED tests/test_pytest_plugin.py::test_storage_dir_config[tests/snapshots] 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 autopkgtest [16:04:22]: test autodep8-python3: [----------------------- Testing with python3.12: Testing with python3.13: autopkgtest [16:04:23]: test autodep8-python3: -----------------------] autopkgtest [16:04:23]: test autodep8-python3: - - - - - - - - - - results - - - - - - - - - - autodep8-python3 PASS (superficial) autopkgtest [16:04:23]: @@@@@@@@@@@@@@@@@@@@ summary upstream-tests FAIL non-zero exit status 1 autodep8-python3 PASS (superficial) aborted: False returncode: 4 Files in working directory: artifact-dir artifact-dir/autodep8-python3-packages artifact-dir/autodep8-python3-stdout artifact-dir/binaries artifact-dir/binaries/python-click-doc.deb artifact-dir/binaries/python-inline-snapshot-doc.deb artifact-dir/binaries/python3-click.deb artifact-dir/binaries/python3-inline-snapshot.deb artifact-dir/log artifact-dir/summary artifact-dir/testbed-packages artifact-dir/testinfo.json artifact-dir/testpkg-version artifact-dir/upstream-tests-packages artifact-dir/upstream-tests-stdout --------------------