0s autopkgtest [16:46:15]: starting date and time: 2024-07-26 16:46:15+0000 0s autopkgtest [16:46:15]: git checkout: fd3bed09 nova: allow more retries for quota issues 0s autopkgtest [16:46:15]: host juju-7f2275-prod-proposed-migration-environment-9; command line: /home/ubuntu/autopkgtest/runner/autopkgtest --output-dir /tmp/autopkgtest-work.o1ewgftj/out --timeout-copy=6000 --setup-commands 'ln -s /dev/null /etc/systemd/system/bluetooth.service; printf "http_proxy=http://squid.internal:3128\nhttps_proxy=http://squid.internal:3128\nno_proxy=127.0.0.1,127.0.1.1,login.ubuntu.com,localhost,localdomain,novalocal,internal,archive.ubuntu.com,ports.ubuntu.com,security.ubuntu.com,ddebs.ubuntu.com,changelogs.ubuntu.com,keyserver.ubuntu.com,launchpadlibrarian.net,launchpadcontent.net,launchpad.net,10.24.0.0/24,keystone.ps5.canonical.com,objectstorage.prodstack5.canonical.com\n" >> /etc/environment' --apt-pocket=proposed=src:httpx --apt-upgrade python-authlib --timeout-short=300 --timeout-copy=20000 --timeout-build=20000 --env=ADT_TEST_TRIGGERS=httpx/0.27.0-1 -- lxd -r lxd-armhf-10.145.243.242 lxd-armhf-10.145.243.242:autopkgtest/ubuntu/oracular/armhf 82s autopkgtest [16:47:37]: testbed dpkg architecture: armhf 83s autopkgtest [16:47:38]: testbed apt version: 2.9.6 83s autopkgtest [16:47:38]: @@@@@@@@@@@@@@@@@@@@ test bed setup 92s Get:1 http://ftpmaster.internal/ubuntu oracular-proposed InRelease [126 kB] 93s Get:2 http://ftpmaster.internal/ubuntu oracular-proposed/universe Sources [436 kB] 93s Get:3 http://ftpmaster.internal/ubuntu oracular-proposed/main Sources [50.6 kB] 93s Get:4 http://ftpmaster.internal/ubuntu oracular-proposed/restricted Sources [8548 B] 93s Get:5 http://ftpmaster.internal/ubuntu oracular-proposed/multiverse Sources [4288 B] 93s Get:6 http://ftpmaster.internal/ubuntu oracular-proposed/main armhf Packages [62.4 kB] 93s Get:7 http://ftpmaster.internal/ubuntu oracular-proposed/main armhf c-n-f Metadata [1428 B] 93s Get:8 http://ftpmaster.internal/ubuntu oracular-proposed/restricted armhf Packages [1368 B] 93s Get:9 http://ftpmaster.internal/ubuntu oracular-proposed/restricted armhf c-n-f Metadata [120 B] 93s Get:10 http://ftpmaster.internal/ubuntu oracular-proposed/universe armhf Packages [385 kB] 93s Get:11 http://ftpmaster.internal/ubuntu oracular-proposed/universe armhf c-n-f Metadata [6916 B] 93s Get:12 http://ftpmaster.internal/ubuntu oracular-proposed/multiverse armhf Packages [2072 B] 93s Get:13 http://ftpmaster.internal/ubuntu oracular-proposed/multiverse armhf c-n-f Metadata [120 B] 96s Fetched 1085 kB in 2s (595 kB/s) 97s Reading package lists... 115s tee: /proc/self/fd/2: Permission denied 143s Hit:1 http://ftpmaster.internal/ubuntu oracular-proposed InRelease 143s Hit:2 http://ftpmaster.internal/ubuntu oracular InRelease 143s Hit:3 http://ftpmaster.internal/ubuntu oracular-updates InRelease 143s Hit:4 http://ftpmaster.internal/ubuntu oracular-security InRelease 146s Reading package lists... 147s Reading package lists... 147s Building dependency tree... 147s Reading state information... 148s Calculating upgrade... 148s The following package was automatically installed and is no longer required: 148s python3-six 148s Use 'apt autoremove' to remove it. 149s The following packages will be upgraded: 149s bind9-dnsutils bind9-host bind9-libs cloud-init cpio dash dmsetup 149s gcc-14-base gdisk kpartx krb5-locales libbpf1 libdevmapper1.02.1 libgcc-s1 149s libgssapi-krb5-2 libk5crypto3 libkrb5-3 libkrb5support0 liblz4-1 libnspr4 149s libp11-kit0 libstdc++6 libudisks2-0 libxml2 logrotate mawk multipath-tools 149s netcat-openbsd networkd-dispatcher pci.ids python3-launchpadlib rsyslog 149s strace systemd-hwe-hwdb ubuntu-pro-client ubuntu-pro-client-l10n udisks2 149s 37 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 149s Need to get 7547 kB of archives. 149s After this operation, 21.5 kB disk space will be freed. 149s Get:1 http://ftpmaster.internal/ubuntu oracular/main armhf dash armhf 0.5.12-9ubuntu1 [81.3 kB] 149s Get:2 http://ftpmaster.internal/ubuntu oracular/main armhf gcc-14-base armhf 14.1.0-5ubuntu1 [49.8 kB] 150s Get:3 http://ftpmaster.internal/ubuntu oracular/main armhf libstdc++6 armhf 14.1.0-5ubuntu1 [711 kB] 150s Get:4 http://ftpmaster.internal/ubuntu oracular/main armhf libgcc-s1 armhf 14.1.0-5ubuntu1 [40.8 kB] 150s Get:5 http://ftpmaster.internal/ubuntu oracular/main armhf liblz4-1 armhf 1.9.4-3 [52.7 kB] 150s Get:6 http://ftpmaster.internal/ubuntu oracular/main armhf libp11-kit0 armhf 0.25.5-2ubuntu1 [259 kB] 150s Get:7 http://ftpmaster.internal/ubuntu oracular/main armhf mawk armhf 1.3.4.20240622-2 [115 kB] 150s Get:8 http://ftpmaster.internal/ubuntu oracular/main armhf libdevmapper1.02.1 armhf 2:1.02.196-1ubuntu1 [135 kB] 150s Get:9 http://ftpmaster.internal/ubuntu oracular/main armhf dmsetup armhf 2:1.02.196-1ubuntu1 [81.3 kB] 150s Get:10 http://ftpmaster.internal/ubuntu oracular/main armhf krb5-locales all 1.21.3-3 [14.3 kB] 150s Get:11 http://ftpmaster.internal/ubuntu oracular/main armhf libbpf1 armhf 1:1.4.5-1 [151 kB] 150s Get:12 http://ftpmaster.internal/ubuntu oracular/main armhf libgssapi-krb5-2 armhf 1.21.3-3 [120 kB] 150s Get:13 http://ftpmaster.internal/ubuntu oracular/main armhf libkrb5-3 armhf 1.21.3-3 [313 kB] 150s Get:14 http://ftpmaster.internal/ubuntu oracular/main armhf libkrb5support0 armhf 1.21.3-3 [31.2 kB] 150s Get:15 http://ftpmaster.internal/ubuntu oracular/main armhf libk5crypto3 armhf 1.21.3-3 [78.6 kB] 150s Get:16 http://ftpmaster.internal/ubuntu oracular/main armhf libxml2 armhf 2.12.7+dfsg-3 [560 kB] 150s Get:17 http://ftpmaster.internal/ubuntu oracular/main armhf logrotate armhf 3.22.0-1 [51.5 kB] 150s Get:18 http://ftpmaster.internal/ubuntu oracular/main armhf netcat-openbsd armhf 1.226-1.1 [42.2 kB] 150s Get:19 http://ftpmaster.internal/ubuntu oracular/main armhf networkd-dispatcher all 2.2.4-1.1 [15.6 kB] 150s Get:20 http://ftpmaster.internal/ubuntu oracular/main armhf rsyslog armhf 8.2406.0-1ubuntu1 [461 kB] 150s Get:21 http://ftpmaster.internal/ubuntu oracular/main armhf systemd-hwe-hwdb all 256.2.1 [3210 B] 150s Get:22 http://ftpmaster.internal/ubuntu oracular/main armhf ubuntu-pro-client-l10n armhf 33.2 [19.2 kB] 150s Get:23 http://ftpmaster.internal/ubuntu oracular/main armhf ubuntu-pro-client armhf 33.2 [232 kB] 150s Get:24 http://ftpmaster.internal/ubuntu oracular/main armhf bind9-dnsutils armhf 1:9.18.28-0ubuntu1 [149 kB] 150s Get:25 http://ftpmaster.internal/ubuntu oracular/main armhf bind9-host armhf 1:9.18.28-0ubuntu1 [47.5 kB] 150s Get:26 http://ftpmaster.internal/ubuntu oracular/main armhf bind9-libs armhf 1:9.18.28-0ubuntu1 [1156 kB] 150s Get:27 http://ftpmaster.internal/ubuntu oracular/main armhf cpio armhf 2.15+dfsg-1ubuntu3 [82.6 kB] 150s Get:28 http://ftpmaster.internal/ubuntu oracular/main armhf pci.ids all 0.0~2024.06.23-1 [278 kB] 150s Get:29 http://ftpmaster.internal/ubuntu oracular/main armhf strace armhf 6.8-2 [427 kB] 150s Get:30 http://ftpmaster.internal/ubuntu oracular/main armhf libnspr4 armhf 2:4.35-1.1ubuntu1 [93.3 kB] 150s Get:31 http://ftpmaster.internal/ubuntu oracular/main armhf udisks2 armhf 2.10.1-9ubuntu1 [277 kB] 150s Get:32 http://ftpmaster.internal/ubuntu oracular/main armhf libudisks2-0 armhf 2.10.1-9ubuntu1 [142 kB] 150s Get:33 http://ftpmaster.internal/ubuntu oracular/main armhf python3-launchpadlib all 2.0.0-1 [126 kB] 150s Get:34 http://ftpmaster.internal/ubuntu oracular/main armhf cloud-init all 24.3~1g6e4153b3-0ubuntu1 [592 kB] 150s Get:35 http://ftpmaster.internal/ubuntu oracular/main armhf gdisk armhf 1.0.10-2 [229 kB] 150s Get:36 http://ftpmaster.internal/ubuntu oracular/main armhf kpartx armhf 0.9.9-1ubuntu2 [34.6 kB] 150s Get:37 http://ftpmaster.internal/ubuntu oracular/main armhf multipath-tools armhf 0.9.9-1ubuntu2 [292 kB] 153s Preconfiguring packages ... 154s Fetched 7547 kB in 1s (5893 kB/s) 154s (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 ... 58436 files and directories currently installed.) 154s Preparing to unpack .../dash_0.5.12-9ubuntu1_armhf.deb ... 154s Unpacking dash (0.5.12-9ubuntu1) over (0.5.12-6ubuntu5) ... 154s Setting up dash (0.5.12-9ubuntu1) ... 155s (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 ... 58436 files and directories currently installed.) 155s Preparing to unpack .../gcc-14-base_14.1.0-5ubuntu1_armhf.deb ... 155s Unpacking gcc-14-base:armhf (14.1.0-5ubuntu1) over (14.1.0-4ubuntu2) ... 156s Setting up gcc-14-base:armhf (14.1.0-5ubuntu1) ... 156s (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 ... 58436 files and directories currently installed.) 156s Preparing to unpack .../libstdc++6_14.1.0-5ubuntu1_armhf.deb ... 156s Unpacking libstdc++6:armhf (14.1.0-5ubuntu1) over (14.1.0-4ubuntu2) ... 156s Setting up libstdc++6:armhf (14.1.0-5ubuntu1) ... 156s (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 ... 58436 files and directories currently installed.) 156s Preparing to unpack .../libgcc-s1_14.1.0-5ubuntu1_armhf.deb ... 156s Unpacking libgcc-s1:armhf (14.1.0-5ubuntu1) over (14.1.0-4ubuntu2) ... 157s Setting up libgcc-s1:armhf (14.1.0-5ubuntu1) ... 157s (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 ... 58436 files and directories currently installed.) 157s Preparing to unpack .../liblz4-1_1.9.4-3_armhf.deb ... 157s Unpacking liblz4-1:armhf (1.9.4-3) over (1.9.4-2) ... 157s Setting up liblz4-1:armhf (1.9.4-3) ... 158s (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 ... 58436 files and directories currently installed.) 158s Preparing to unpack .../libp11-kit0_0.25.5-2ubuntu1_armhf.deb ... 158s Unpacking libp11-kit0:armhf (0.25.5-2ubuntu1) over (0.25.3-4ubuntu2) ... 158s Setting up libp11-kit0:armhf (0.25.5-2ubuntu1) ... 159s (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 ... 58436 files and directories currently installed.) 159s Preparing to unpack .../00-mawk_1.3.4.20240622-2_armhf.deb ... 159s Unpacking mawk (1.3.4.20240622-2) over (1.3.4.20240622-1) ... 160s Preparing to unpack .../01-libdevmapper1.02.1_2%3a1.02.196-1ubuntu1_armhf.deb ... 160s Unpacking libdevmapper1.02.1:armhf (2:1.02.196-1ubuntu1) over (2:1.02.185-3ubuntu4) ... 160s Preparing to unpack .../02-dmsetup_2%3a1.02.196-1ubuntu1_armhf.deb ... 160s Unpacking dmsetup (2:1.02.196-1ubuntu1) over (2:1.02.185-3ubuntu4) ... 161s Preparing to unpack .../03-krb5-locales_1.21.3-3_all.deb ... 161s Unpacking krb5-locales (1.21.3-3) over (1.20.1-6ubuntu2) ... 162s Preparing to unpack .../04-libbpf1_1%3a1.4.5-1_armhf.deb ... 162s Unpacking libbpf1:armhf (1:1.4.5-1) over (1:1.4.3-1) ... 162s Preparing to unpack .../05-libgssapi-krb5-2_1.21.3-3_armhf.deb ... 162s Unpacking libgssapi-krb5-2:armhf (1.21.3-3) over (1.20.1-6ubuntu2) ... 162s Preparing to unpack .../06-libkrb5-3_1.21.3-3_armhf.deb ... 162s Unpacking libkrb5-3:armhf (1.21.3-3) over (1.20.1-6ubuntu2) ... 162s Preparing to unpack .../07-libkrb5support0_1.21.3-3_armhf.deb ... 162s Unpacking libkrb5support0:armhf (1.21.3-3) over (1.20.1-6ubuntu2) ... 163s Preparing to unpack .../08-libk5crypto3_1.21.3-3_armhf.deb ... 163s Unpacking libk5crypto3:armhf (1.21.3-3) over (1.20.1-6ubuntu2) ... 163s Preparing to unpack .../09-libxml2_2.12.7+dfsg-3_armhf.deb ... 163s Unpacking libxml2:armhf (2.12.7+dfsg-3) over (2.9.14+dfsg-1.3ubuntu3) ... 163s Preparing to unpack .../10-logrotate_3.22.0-1_armhf.deb ... 163s Unpacking logrotate (3.22.0-1) over (3.21.0-2build1) ... 163s Preparing to unpack .../11-netcat-openbsd_1.226-1.1_armhf.deb ... 163s Unpacking netcat-openbsd (1.226-1.1) over (1.226-1ubuntu2) ... 164s Preparing to unpack .../12-networkd-dispatcher_2.2.4-1.1_all.deb ... 164s Unpacking networkd-dispatcher (2.2.4-1.1) over (2.2.4-1) ... 164s Preparing to unpack .../13-rsyslog_8.2406.0-1ubuntu1_armhf.deb ... 164s Unpacking rsyslog (8.2406.0-1ubuntu1) over (8.2312.0-3ubuntu9) ... 164s Preparing to unpack .../14-systemd-hwe-hwdb_256.2.1_all.deb ... 164s Unpacking systemd-hwe-hwdb (256.2.1) over (255.1.3) ... 164s Preparing to unpack .../15-ubuntu-pro-client-l10n_33.2_armhf.deb ... 164s Unpacking ubuntu-pro-client-l10n (33.2) over (33.1) ... 164s Preparing to unpack .../16-ubuntu-pro-client_33.2_armhf.deb ... 166s Unpacking ubuntu-pro-client (33.2) over (33.1) ... 167s Preparing to unpack .../17-bind9-dnsutils_1%3a9.18.28-0ubuntu1_armhf.deb ... 167s Unpacking bind9-dnsutils (1:9.18.28-0ubuntu1) over (1:9.18.24-0ubuntu5) ... 167s Preparing to unpack .../18-bind9-host_1%3a9.18.28-0ubuntu1_armhf.deb ... 167s Unpacking bind9-host (1:9.18.28-0ubuntu1) over (1:9.18.24-0ubuntu5) ... 167s Preparing to unpack .../19-bind9-libs_1%3a9.18.28-0ubuntu1_armhf.deb ... 167s Unpacking bind9-libs:armhf (1:9.18.28-0ubuntu1) over (1:9.18.24-0ubuntu5) ... 168s Preparing to unpack .../20-cpio_2.15+dfsg-1ubuntu3_armhf.deb ... 168s Unpacking cpio (2.15+dfsg-1ubuntu3) over (2.15+dfsg-1ubuntu2) ... 168s Preparing to unpack .../21-pci.ids_0.0~2024.06.23-1_all.deb ... 168s Unpacking pci.ids (0.0~2024.06.23-1) over (0.0~2024.05.31-1) ... 168s Preparing to unpack .../22-strace_6.8-2_armhf.deb ... 168s Unpacking strace (6.8-2) over (6.8-0ubuntu2) ... 169s Preparing to unpack .../23-libnspr4_2%3a4.35-1.1ubuntu1_armhf.deb ... 169s Unpacking libnspr4:armhf (2:4.35-1.1ubuntu1) over (2:4.35-1.1build1) ... 169s Preparing to unpack .../24-udisks2_2.10.1-9ubuntu1_armhf.deb ... 169s Unpacking udisks2 (2.10.1-9ubuntu1) over (2.10.1-9) ... 169s Preparing to unpack .../25-libudisks2-0_2.10.1-9ubuntu1_armhf.deb ... 169s Unpacking libudisks2-0:armhf (2.10.1-9ubuntu1) over (2.10.1-9) ... 169s Preparing to unpack .../26-python3-launchpadlib_2.0.0-1_all.deb ... 169s Unpacking python3-launchpadlib (2.0.0-1) over (1.11.0-6) ... 169s Preparing to unpack .../27-cloud-init_24.3~1g6e4153b3-0ubuntu1_all.deb ... 170s Unpacking cloud-init (24.3~1g6e4153b3-0ubuntu1) over (24.2-0ubuntu1) ... 170s Preparing to unpack .../28-gdisk_1.0.10-2_armhf.deb ... 170s Unpacking gdisk (1.0.10-2) over (1.0.10-1build1) ... 170s Preparing to unpack .../29-kpartx_0.9.9-1ubuntu2_armhf.deb ... 170s Unpacking kpartx (0.9.9-1ubuntu2) over (0.9.4-5ubuntu8) ... 170s Preparing to unpack .../30-multipath-tools_0.9.9-1ubuntu2_armhf.deb ... 170s Unpacking multipath-tools (0.9.9-1ubuntu2) over (0.9.4-5ubuntu8) ... 170s dpkg: warning: unable to delete old directory '/lib/multipath': Directory not empty 170s Setting up logrotate (3.22.0-1) ... 172s logrotate.service is a disabled or a static unit not running, not starting it. 172s Setting up cpio (2.15+dfsg-1ubuntu3) ... 172s Setting up networkd-dispatcher (2.2.4-1.1) ... 173s Setting up pci.ids (0.0~2024.06.23-1) ... 173s Setting up cloud-init (24.3~1g6e4153b3-0ubuntu1) ... 174s Setting up python3-launchpadlib (2.0.0-1) ... 175s Setting up rsyslog (8.2406.0-1ubuntu1) ... 175s info: The user `syslog' is already a member of `adm'. 176s apparmor_parser: Unable to replace "rsyslogd". apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 176s 177s Setting up netcat-openbsd (1.226-1.1) ... 177s Setting up krb5-locales (1.21.3-3) ... 177s Setting up libkrb5support0:armhf (1.21.3-3) ... 177s Setting up gdisk (1.0.10-2) ... 177s Setting up libnspr4:armhf (2:4.35-1.1ubuntu1) ... 177s Setting up strace (6.8-2) ... 177s Setting up libk5crypto3:armhf (1.21.3-3) ... 177s Setting up systemd-hwe-hwdb (256.2.1) ... 178s Setting up libdevmapper1.02.1:armhf (2:1.02.196-1ubuntu1) ... 178s Setting up dmsetup (2:1.02.196-1ubuntu1) ... 178s Setting up kpartx (0.9.9-1ubuntu2) ... 178s Setting up mawk (1.3.4.20240622-2) ... 178s Setting up libkrb5-3:armhf (1.21.3-3) ... 178s Setting up libxml2:armhf (2.12.7+dfsg-3) ... 178s Setting up ubuntu-pro-client (33.2) ... 178s Installing new version of config file /etc/apparmor.d/ubuntu_pro_apt_news ... 178s apparmor_parser: Unable to replace "ubuntu_pro_apt_news". apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 178s 178s apparmor_parser: Unable to replace "apt_methods". apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 178s 178s apparmor_parser: Unable to replace "ubuntu_pro_esm_cache". apparmor_parser: Access denied. You need policy admin privileges to manage profiles. 178s 180s Setting up libbpf1:armhf (1:1.4.5-1) ... 180s Setting up libudisks2-0:armhf (2.10.1-9ubuntu1) ... 180s Setting up ubuntu-pro-client-l10n (33.2) ... 180s Setting up udisks2 (2.10.1-9ubuntu1) ... 181s vda: Failed to write 'change' to '/sys/devices/pci0000:00/0000:00:01.3/0000:04:00.0/virtio2/block/vda/uevent': Permission denied 181s vda1: Failed to write 'change' to '/sys/devices/pci0000:00/0000:00:01.3/0000:04:00.0/virtio2/block/vda/vda1/uevent': Permission denied 181s vda15: Failed to write 'change' to '/sys/devices/pci0000:00/0000:00:01.3/0000:04:00.0/virtio2/block/vda/vda15/uevent': Permission denied 181s vda2: Failed to write 'change' to '/sys/devices/pci0000:00/0000:00:01.3/0000:04:00.0/virtio2/block/vda/vda2/uevent': Permission denied 181s loop0: Failed to write 'change' to '/sys/devices/virtual/block/loop0/uevent': Permission denied 181s loop1: Failed to write 'change' to '/sys/devices/virtual/block/loop1/uevent': Permission denied 181s loop2: Failed to write 'change' to '/sys/devices/virtual/block/loop2/uevent': Permission denied 181s loop3: Failed to write 'change' to '/sys/devices/virtual/block/loop3/uevent': Permission denied 181s loop4: Failed to write 'change' to '/sys/devices/virtual/block/loop4/uevent': Permission denied 181s loop5: Failed to write 'change' to '/sys/devices/virtual/block/loop5/uevent': Permission denied 181s loop6: Failed to write 'change' to '/sys/devices/virtual/block/loop6/uevent': Permission denied 181s loop7: Failed to write 'change' to '/sys/devices/virtual/block/loop7/uevent': Permission denied 184s Setting up multipath-tools (0.9.9-1ubuntu2) ... 185s Setting up libgssapi-krb5-2:armhf (1.21.3-3) ... 185s Setting up bind9-libs:armhf (1:9.18.28-0ubuntu1) ... 185s Setting up bind9-host (1:9.18.28-0ubuntu1) ... 185s Setting up bind9-dnsutils (1:9.18.28-0ubuntu1) ... 185s Processing triggers for libc-bin (2.39-0ubuntu9) ... 186s Processing triggers for man-db (2.12.1-2) ... 187s Processing triggers for dbus (1.14.10-4ubuntu4) ... 187s Processing triggers for udev (256-1ubuntu1) ... 188s Processing triggers for debianutils (5.20) ... 188s Processing triggers for initramfs-tools (0.142ubuntu30) ... 188s Reading package lists... 189s Building dependency tree... 189s Reading state information... 189s The following packages will be REMOVED: 189s python3-six* 190s 0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded. 190s After this operation, 59.4 kB disk space will be freed. 190s (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 ... 58436 files and directories currently installed.) 190s Removing python3-six (1.16.0-6) ... 194s autopkgtest [16:49:29]: rebooting testbed after setup commands that affected boot 310s autopkgtest [16:51:25]: testbed running kernel: Linux 6.5.0-44-generic #44~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue Jun 18 16:55:18 UTC 2 353s autopkgtest [16:52:08]: @@@@@@@@@@@@@@@@@@@@ apt-source python-authlib 379s Get:1 http://ftpmaster.internal/ubuntu oracular/universe python-authlib 1.3.1-1 (dsc) [2494 B] 379s Get:2 http://ftpmaster.internal/ubuntu oracular/universe python-authlib 1.3.1-1 (tar) [320 kB] 379s Get:3 http://ftpmaster.internal/ubuntu oracular/universe python-authlib 1.3.1-1 (diff) [5564 B] 380s gpgv: Signature made Thu Jun 6 10:39:37 2024 UTC 380s gpgv: using EDDSA key EE9AD6F90520FA11F69F4824477B0DB0263A54D8 380s gpgv: issuer "stefanor@debian.org" 380s gpgv: Can't check signature: No public key 380s dpkg-source: warning: cannot verify inline signature for ./python-authlib_1.3.1-1.dsc: no acceptable signature found 381s autopkgtest [16:52:36]: testing package python-authlib version 1.3.1-1 389s autopkgtest [16:52:44]: build not needed 396s autopkgtest [16:52:51]: test unittests3: preparing testbed 429s Reading package lists... 430s Building dependency tree... 430s Reading state information... 430s Starting pkgProblemResolver with broken count: 0 430s Starting 2 pkgProblemResolver with broken count: 0 430s Done 431s The following additional packages will be installed: 431s libjs-jquery python3-all python3-anyio python3-asgiref 431s python3-async-generator python3-authlib python3-cachelib python3-click 431s python3-colorama python3-django python3-flask python3-flask-sqlalchemy 431s python3-greenlet python3-h11 python3-httpcore python3-httpx 431s python3-iniconfig python3-itsdangerous python3-packaging python3-pluggy 431s python3-pycryptodome python3-pytest python3-pytest-asyncio 431s python3-pytest-django python3-sniffio python3-sqlalchemy python3-sqlparse 431s python3-starlette python3-werkzeug 431s Suggested packages: 431s python-cachelib-doc bpython3 geoip-database-contrib gettext ipython3 431s libgdal20 libsqlite3-mod-spatialite python-django-doc python3-bcrypt 431s python3-flup python3-memcache python3-mysqldb python3-pil python3-psycopg2 431s python3-selenium python3-sqlite python3-dotenv python-flask-doc 431s python-greenlet-dev python-greenlet-doc python-sqlalchemy-doc python3-fdb 431s python3-pymssql python3-asyncpg python3-aiosqlite python-sqlparse-doc 431s python3-databases python-werkzeug-doc python3-lxml python3-watchdog 431s Recommended packages: 431s javascript-common python3-tz python3-simplejson python3-sqlalchemy-ext 431s python3-uvicorn | python3-daphne python3-aiofiles python3-multipart 431s python3-pyinotify 434s The following NEW packages will be installed: 434s autopkgtest-satdep libjs-jquery python3-all python3-anyio python3-asgiref 434s python3-async-generator python3-authlib python3-cachelib python3-click 434s python3-colorama python3-django python3-flask python3-flask-sqlalchemy 434s python3-greenlet python3-h11 python3-httpcore python3-httpx 434s python3-iniconfig python3-itsdangerous python3-packaging python3-pluggy 434s python3-pycryptodome python3-pytest python3-pytest-asyncio 434s python3-pytest-django python3-sniffio python3-sqlalchemy python3-sqlparse 434s python3-starlette python3-werkzeug 437s 0 upgraded, 30 newly installed, 0 to remove and 0 not upgraded. 437s Need to get 6792 kB/6793 kB of archives. 437s After this operation, 43.9 MB of additional disk space will be used. 437s Get:1 /tmp/autopkgtest.AiemBq/1-autopkgtest-satdep.deb autopkgtest-satdep armhf 0 [812 B] 442s Get:2 http://ftpmaster.internal/ubuntu oracular/main armhf libjs-jquery all 3.6.1+dfsg+~3.5.14-1 [328 kB] 442s Get:3 http://ftpmaster.internal/ubuntu oracular/main armhf python3-all armhf 3.12.3-0ubuntu1 [886 B] 442s Get:4 http://ftpmaster.internal/ubuntu oracular/universe armhf python3-sniffio all 1.3.1-1 [7262 B] 442s Get:5 http://ftpmaster.internal/ubuntu oracular/universe armhf python3-anyio all 4.3.0-1 [56.6 kB] 442s Get:6 http://ftpmaster.internal/ubuntu oracular/main armhf python3-asgiref all 3.8.1-1 [24.8 kB] 442s Get:7 http://ftpmaster.internal/ubuntu oracular/universe armhf python3-async-generator all 1.10-4 [17.5 kB] 442s Get:8 http://ftpmaster.internal/ubuntu oracular/universe armhf python3-pycryptodome armhf 3.20.0+dfsg-1 [1088 kB] 442s Get:9 http://ftpmaster.internal/ubuntu oracular/universe armhf python3-authlib all 1.3.1-1 [112 kB] 442s Get:10 http://ftpmaster.internal/ubuntu oracular/universe armhf python3-cachelib all 0.13.0-2 [20.7 kB] 442s Get:11 http://ftpmaster.internal/ubuntu oracular/main armhf python3-colorama all 0.4.6-4 [32.1 kB] 442s Get:12 http://ftpmaster.internal/ubuntu oracular/main armhf python3-click all 8.1.7-1 [79.1 kB] 442s Get:13 http://ftpmaster.internal/ubuntu oracular/main armhf python3-sqlparse all 0.5.1-1 [32.6 kB] 442s Get:14 http://ftpmaster.internal/ubuntu oracular/main armhf python3-django all 3:4.2.14-1 [2917 kB] 442s Get:15 http://ftpmaster.internal/ubuntu oracular/main armhf python3-itsdangerous all 2.2.0-1 [15.2 kB] 442s Get:16 http://ftpmaster.internal/ubuntu oracular/main armhf python3-werkzeug all 3.0.3-1 [170 kB] 442s Get:17 http://ftpmaster.internal/ubuntu oracular/main armhf python3-flask all 3.0.3-1ubuntu1 [83.2 kB] 442s Get:18 http://ftpmaster.internal/ubuntu oracular/main armhf python3-greenlet armhf 3.0.3-0ubuntu5 [153 kB] 442s Get:19 http://ftpmaster.internal/ubuntu oracular/main armhf python3-sqlalchemy all 1.4.50+ds1-1build1 [1020 kB] 443s Get:20 http://ftpmaster.internal/ubuntu oracular/universe armhf python3-flask-sqlalchemy all 3.0.3-1 [30.9 kB] 443s Get:21 http://ftpmaster.internal/ubuntu oracular/universe armhf python3-h11 all 0.14.0-1 [51.1 kB] 443s Get:22 http://ftpmaster.internal/ubuntu oracular/universe armhf python3-httpcore all 1.0.4-1 [38.8 kB] 443s Get:23 http://ftpmaster.internal/ubuntu oracular-proposed/universe armhf python3-httpx all 0.27.0-1 [60.9 kB] 443s Get:24 http://ftpmaster.internal/ubuntu oracular/universe armhf python3-iniconfig all 1.1.1-2 [6024 B] 443s Get:25 http://ftpmaster.internal/ubuntu oracular/main armhf python3-packaging all 24.1-1 [41.4 kB] 443s Get:26 http://ftpmaster.internal/ubuntu oracular/universe armhf python3-pluggy all 1.5.0-1 [21.0 kB] 443s Get:27 http://ftpmaster.internal/ubuntu oracular/universe armhf python3-pytest all 7.4.4-1 [305 kB] 443s Get:28 http://ftpmaster.internal/ubuntu oracular/universe armhf python3-pytest-asyncio all 0.20.3-1.3 [10.7 kB] 443s Get:29 http://ftpmaster.internal/ubuntu oracular/universe armhf python3-pytest-django all 4.5.2-3 [18.5 kB] 443s Get:30 http://ftpmaster.internal/ubuntu oracular/universe armhf python3-starlette all 0.31.1-1 [49.4 kB] 472s Fetched 6792 kB in 7s (960 kB/s) 473s Selecting previously unselected package libjs-jquery. 474s (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 ... 58426 files and directories currently installed.) 474s Preparing to unpack .../00-libjs-jquery_3.6.1+dfsg+~3.5.14-1_all.deb ... 474s Unpacking libjs-jquery (3.6.1+dfsg+~3.5.14-1) ... 474s Selecting previously unselected package python3-all. 476s Preparing to unpack .../01-python3-all_3.12.3-0ubuntu1_armhf.deb ... 476s Unpacking python3-all (3.12.3-0ubuntu1) ... 476s Selecting previously unselected package python3-sniffio. 478s Preparing to unpack .../02-python3-sniffio_1.3.1-1_all.deb ... 478s Unpacking python3-sniffio (1.3.1-1) ... 478s Selecting previously unselected package python3-anyio. 481s Preparing to unpack .../03-python3-anyio_4.3.0-1_all.deb ... 481s Unpacking python3-anyio (4.3.0-1) ... 481s Selecting previously unselected package python3-asgiref. 481s Preparing to unpack .../04-python3-asgiref_3.8.1-1_all.deb ... 481s Unpacking python3-asgiref (3.8.1-1) ... 481s Selecting previously unselected package python3-async-generator. 483s Preparing to unpack .../05-python3-async-generator_1.10-4_all.deb ... 483s Unpacking python3-async-generator (1.10-4) ... 483s Selecting previously unselected package python3-pycryptodome. 484s Preparing to unpack .../06-python3-pycryptodome_3.20.0+dfsg-1_armhf.deb ... 484s Unpacking python3-pycryptodome (3.20.0+dfsg-1) ... 485s Selecting previously unselected package python3-authlib. 486s Preparing to unpack .../07-python3-authlib_1.3.1-1_all.deb ... 486s Unpacking python3-authlib (1.3.1-1) ... 486s Selecting previously unselected package python3-cachelib. 486s Preparing to unpack .../08-python3-cachelib_0.13.0-2_all.deb ... 486s Unpacking python3-cachelib (0.13.0-2) ... 486s Selecting previously unselected package python3-colorama. 487s Preparing to unpack .../09-python3-colorama_0.4.6-4_all.deb ... 487s Unpacking python3-colorama (0.4.6-4) ... 487s Selecting previously unselected package python3-click. 488s Preparing to unpack .../10-python3-click_8.1.7-1_all.deb ... 488s Unpacking python3-click (8.1.7-1) ... 488s Selecting previously unselected package python3-sqlparse. 489s Preparing to unpack .../11-python3-sqlparse_0.5.1-1_all.deb ... 489s Unpacking python3-sqlparse (0.5.1-1) ... 489s Selecting previously unselected package python3-django. 490s Preparing to unpack .../12-python3-django_3%3a4.2.14-1_all.deb ... 490s Unpacking python3-django (3:4.2.14-1) ... 493s Selecting previously unselected package python3-itsdangerous. 495s Preparing to unpack .../13-python3-itsdangerous_2.2.0-1_all.deb ... 495s Unpacking python3-itsdangerous (2.2.0-1) ... 495s Selecting previously unselected package python3-werkzeug. 497s Preparing to unpack .../14-python3-werkzeug_3.0.3-1_all.deb ... 497s Unpacking python3-werkzeug (3.0.3-1) ... 497s Selecting previously unselected package python3-flask. 498s Preparing to unpack .../15-python3-flask_3.0.3-1ubuntu1_all.deb ... 498s Unpacking python3-flask (3.0.3-1ubuntu1) ... 498s Selecting previously unselected package python3-greenlet. 499s Preparing to unpack .../16-python3-greenlet_3.0.3-0ubuntu5_armhf.deb ... 499s Unpacking python3-greenlet (3.0.3-0ubuntu5) ... 499s Selecting previously unselected package python3-sqlalchemy. 501s Preparing to unpack .../17-python3-sqlalchemy_1.4.50+ds1-1build1_all.deb ... 501s Unpacking python3-sqlalchemy (1.4.50+ds1-1build1) ... 502s Selecting previously unselected package python3-flask-sqlalchemy. 505s Preparing to unpack .../18-python3-flask-sqlalchemy_3.0.3-1_all.deb ... 505s Unpacking python3-flask-sqlalchemy (3.0.3-1) ... 505s Selecting previously unselected package python3-h11. 507s Preparing to unpack .../19-python3-h11_0.14.0-1_all.deb ... 507s Unpacking python3-h11 (0.14.0-1) ... 508s Selecting previously unselected package python3-httpcore. 509s Preparing to unpack .../20-python3-httpcore_1.0.4-1_all.deb ... 509s Unpacking python3-httpcore (1.0.4-1) ... 511s Selecting previously unselected package python3-httpx. 514s Preparing to unpack .../21-python3-httpx_0.27.0-1_all.deb ... 514s Unpacking python3-httpx (0.27.0-1) ... 515s Selecting previously unselected package python3-iniconfig. 520s Preparing to unpack .../22-python3-iniconfig_1.1.1-2_all.deb ... 520s Unpacking python3-iniconfig (1.1.1-2) ... 523s Selecting previously unselected package python3-packaging. 529s Preparing to unpack .../23-python3-packaging_24.1-1_all.deb ... 529s Unpacking python3-packaging (24.1-1) ... 530s Selecting previously unselected package python3-pluggy. 535s Preparing to unpack .../24-python3-pluggy_1.5.0-1_all.deb ... 538s Unpacking python3-pluggy (1.5.0-1) ... 540s Selecting previously unselected package python3-pytest. 548s Preparing to unpack .../25-python3-pytest_7.4.4-1_all.deb ... 549s Unpacking python3-pytest (7.4.4-1) ... 551s Selecting previously unselected package python3-pytest-asyncio. 556s Preparing to unpack .../26-python3-pytest-asyncio_0.20.3-1.3_all.deb ... 556s Unpacking python3-pytest-asyncio (0.20.3-1.3) ... 558s Selecting previously unselected package python3-pytest-django. 563s Preparing to unpack .../27-python3-pytest-django_4.5.2-3_all.deb ... 563s Unpacking python3-pytest-django (4.5.2-3) ... 564s Selecting previously unselected package python3-starlette. 568s Preparing to unpack .../28-python3-starlette_0.31.1-1_all.deb ... 568s Unpacking python3-starlette (0.31.1-1) ... 570s Selecting previously unselected package autopkgtest-satdep. 573s Preparing to unpack .../29-1-autopkgtest-satdep.deb ... 573s Unpacking autopkgtest-satdep (0) ... 578s Setting up python3-iniconfig (1.1.1-2) ... 588s Setting up python3-sniffio (1.3.1-1) ... 590s Setting up python3-async-generator (1.10-4) ... 592s Setting up python3-anyio (4.3.0-1) ... 593s Setting up python3-colorama (0.4.6-4) ... 594s Setting up python3-pycryptodome (3.20.0+dfsg-1) ... 597s Setting up python3-itsdangerous (2.2.0-1) ... 597s Setting up python3-all (3.12.3-0ubuntu1) ... 597s Setting up python3-starlette (0.31.1-1) ... 598s Setting up python3-click (8.1.7-1) ... 600s Setting up python3-packaging (24.1-1) ... 601s Setting up python3-sqlparse (0.5.1-1) ... 602s Setting up python3-greenlet (3.0.3-0ubuntu5) ... 603s Setting up python3-h11 (0.14.0-1) ... 604s Setting up python3-pluggy (1.5.0-1) ... 605s Setting up python3-cachelib (0.13.0-2) ... 605s Setting up libjs-jquery (3.6.1+dfsg+~3.5.14-1) ... 606s Setting up python3-asgiref (3.8.1-1) ... 607s Setting up python3-authlib (1.3.1-1) ... 608s Setting up python3-httpcore (1.0.4-1) ... 609s Setting up python3-django (3:4.2.14-1) ... 611s Setting up python3-pytest (7.4.4-1) ... 616s Setting up python3-pytest-django (4.5.2-3) ... 617s Setting up python3-sqlalchemy (1.4.50+ds1-1build1) ... 621s Setting up python3-httpx (0.27.0-1) ... 622s Setting up python3-werkzeug (3.0.3-1) ... 623s Setting up python3-pytest-asyncio (0.20.3-1.3) ... 624s Setting up python3-flask (3.0.3-1ubuntu1) ... 625s Setting up python3-flask-sqlalchemy (3.0.3-1) ... 626s Setting up autopkgtest-satdep (0) ... 626s Processing triggers for man-db (2.12.1-2) ... 652s (Reading database ... 66260 files and directories currently installed.) 652s Removing autopkgtest-satdep (0) ... 657s autopkgtest [16:57:12]: test unittests3: [----------------------- 661s === python3.12 === 663s ============================= test session starts ============================== 663s platform linux -- Python 3.12.4, pytest-7.4.4, pluggy-1.5.0 663s rootdir: /tmp/autopkgtest.AiemBq/autopkgtest_tmp 663s configfile: setup.cfg 663s plugins: anyio-4.3.0, asyncio-0.20.3, django-4.5.2 663s asyncio: mode=Mode.STRICT 663s collected 101 items 663s 663s tests/core/test_oauth2/test_rfc6749_misc.py ...... [ 5%] 664s tests/core/test_oauth2/test_rfc7523.py ........................ [ 29%] 664s tests/core/test_oauth2/test_rfc7591.py ...... [ 35%] 664s tests/core/test_oauth2/test_rfc7662.py ...... [ 41%] 665s tests/core/test_oauth2/test_rfc8414.py .......................... [ 67%] 665s tests/core/test_oidc/test_core.py .......... [ 77%] 665s tests/core/test_oidc/test_discovery.py ....................... [100%] 665s 665s ============================= 101 passed in 2.90s ============================== 690s ============================= test session starts ============================== 690s platform linux -- Python 3.12.4, pytest-7.4.4, pluggy-1.5.0 690s django: settings: tests.clients.test_django.settings (from env) 690s rootdir: /tmp/autopkgtest.AiemBq/autopkgtest_tmp 690s configfile: setup.cfg 690s plugins: anyio-4.3.0, asyncio-0.20.3, django-4.5.2 690s asyncio: mode=Mode.STRICT 690s collected 167 items 690s 691s tests/clients/test_django/test_oauth_client.py ............. [ 7%] 691s tests/clients/test_flask/test_oauth_client.py .................... [ 19%] 692s tests/clients/test_flask/test_user_mixin.py ..... [ 22%] 692s tests/clients/test_httpx/test_assertion_client.py .. [ 23%] 696s tests/clients/test_httpx/test_async_assertion_client.py F. [ 25%] 702s tests/clients/test_httpx/test_async_oauth1_client.py FFFFFFF [ 29%] 712s tests/clients/test_httpx/test_async_oauth2_client.py FFFFFFss...FFFFFFF. [ 40%] 714s FFFFF. [ 44%] 714s tests/clients/test_httpx/test_oauth1_client.py ....... [ 48%] 714s tests/clients/test_httpx/test_oauth2_client.py ...................... [ 61%] 714s tests/clients/test_requests/test_assertion_session.py .. [ 62%] 715s tests/clients/test_requests/test_oauth1_session.py ................ [ 72%] 715s tests/clients/test_requests/test_oauth2_session.py ..................... [ 85%] 715s ......... [ 90%] 717s tests/clients/test_starlette/test_oauth_client.py ...FF.FFFF.F [ 97%] 718s tests/clients/test_starlette/test_user_mixin.py F..F [100%] 718s 718s =================================== FAILURES =================================== 718s ______________________________ test_refresh_token ______________________________ 718s 718s @contextlib.contextmanager 718s def map_httpcore_exceptions() -> typing.Iterator[None]: 718s try: 718s > yield 718s 718s /usr/lib/python3/dist-packages/httpx/_transports/default.py:69: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/httpx/_transports/default.py:373: in handle_async_request 718s resp = await self._pool.handle_async_request(req) 718s /usr/lib/python3/dist-packages/httpcore/_async/connection_pool.py:216: in handle_async_request 718s raise exc from None 718s /usr/lib/python3/dist-packages/httpcore/_async/connection_pool.py:196: in handle_async_request 718s response = await connection.handle_async_request( 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s self = 718s request = 718s 718s async def handle_async_request(self, request: Request) -> Response: 718s timeouts = request.extensions.get("timeout", {}) 718s timeout = timeouts.get("connect", None) 718s 718s async with self._connect_lock: 718s if not self._connected: 718s target = b"%b:%d" % (self._remote_origin.host, self._remote_origin.port) 718s 718s connect_url = URL( 718s scheme=self._proxy_origin.scheme, 718s host=self._proxy_origin.host, 718s port=self._proxy_origin.port, 718s target=target, 718s ) 718s connect_headers = merge_headers( 718s [(b"Host", target), (b"Accept", b"*/*")], self._proxy_headers 718s ) 718s connect_request = Request( 718s method=b"CONNECT", 718s url=connect_url, 718s headers=connect_headers, 718s extensions=request.extensions, 718s ) 718s connect_response = await self._connection.handle_async_request( 718s connect_request 718s ) 718s 718s if connect_response.status < 200 or connect_response.status > 299: 718s reason_bytes = connect_response.extensions.get("reason_phrase", b"") 718s reason_str = reason_bytes.decode("ascii", errors="ignore") 718s msg = "%d %s" % (connect_response.status, reason_str) 718s await self._connection.aclose() 718s > raise ProxyError(msg) 718s E httpcore.ProxyError: 503 Service Unavailable 718s 718s /usr/lib/python3/dist-packages/httpcore/_async/http_proxy.py:298: ProxyError 718s 718s The above exception was the direct cause of the following exception: 718s 718s @pytest.mark.asyncio 718s async def test_refresh_token(): 718s async def verifier(request): 718s content = await request.body() 718s if str(request.url) == 'https://i.b/token': 718s assert b'assertion=' in content 718s 718s async with AsyncAssertionClient( 718s 'https://i.b/token', 718s grant_type=AsyncAssertionClient.JWT_BEARER_GRANT_TYPE, 718s issuer='foo', 718s subject='foo', 718s audience='foo', 718s alg='HS256', 718s key='secret', 718s app=AsyncMockDispatch(default_token, assert_func=verifier) 718s ) as client: 718s > await client.get('https://i.b') 718s 718s tests/clients/test_httpx/test_async_assertion_client.py:33: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/httpx/_client.py:1801: in get 718s return await self.request( 718s /usr/lib/python3/dist-packages/authlib/integrations/httpx_client/assertion_client.py:38: in request 718s await self.refresh_token() 718s /usr/lib/python3/dist-packages/authlib/integrations/httpx_client/assertion_client.py:45: in _refresh_token 718s resp = await self.request( 718s /usr/lib/python3/dist-packages/authlib/integrations/httpx_client/assertion_client.py:41: in request 718s return await super().request( 718s /usr/lib/python3/dist-packages/httpx/_client.py:1574: in request 718s return await self.send(request, auth=auth, follow_redirects=follow_redirects) 718s /usr/lib/python3/dist-packages/httpx/_client.py:1661: in send 718s response = await self._send_handling_auth( 718s /usr/lib/python3/dist-packages/httpx/_client.py:1689: in _send_handling_auth 718s response = await self._send_handling_redirects( 718s /usr/lib/python3/dist-packages/httpx/_client.py:1726: in _send_handling_redirects 718s response = await self._send_single_request(request) 718s /usr/lib/python3/dist-packages/httpx/_client.py:1763: in _send_single_request 718s response = await transport.handle_async_request(request) 718s /usr/lib/python3/dist-packages/httpx/_transports/default.py:372: in handle_async_request 718s with map_httpcore_exceptions(): 718s /usr/lib/python3.12/contextlib.py:158: in __exit__ 718s self.gen.throw(value) 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s @contextlib.contextmanager 718s def map_httpcore_exceptions() -> typing.Iterator[None]: 718s try: 718s yield 718s except Exception as exc: 718s mapped_exc = None 718s 718s for from_exc, to_exc in HTTPCORE_EXC_MAP.items(): 718s if not isinstance(exc, from_exc): 718s continue 718s # We want to map to the most specific exception we can find. 718s # Eg if `exc` is an `httpcore.ReadTimeout`, we want to map to 718s # `httpx.ReadTimeout`, not just `httpx.TimeoutException`. 718s if mapped_exc is None or issubclass(to_exc, mapped_exc): 718s mapped_exc = to_exc 718s 718s if mapped_exc is None: # pragma: no cover 718s raise 718s 718s message = str(exc) 718s > raise mapped_exc(message) from exc 718s E httpx.ProxyError: 503 Service Unavailable 718s 718s /usr/lib/python3/dist-packages/httpx/_transports/default.py:86: ProxyError 718s _____________________ test_fetch_request_token_via_header ______________________ 718s 718s @pytest.mark.asyncio 718s async def test_fetch_request_token_via_header(): 718s request_token = {'oauth_token': '1', 'oauth_token_secret': '2'} 718s 718s async def assert_func(request): 718s auth_header = request.headers.get('authorization') 718s assert 'oauth_consumer_key="id"' in auth_header 718s assert 'oauth_signature=' in auth_header 718s 718s app = AsyncMockDispatch(request_token, assert_func=assert_func) 718s async with AsyncOAuth1Client('id', 'secret', app=app) as client: 718s > response = await client.fetch_request_token(oauth_url) 718s 718s tests/clients/test_httpx/test_async_oauth1_client.py:24: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/authlib/integrations/httpx_client/oauth1_client.py:70: in _fetch_token 718s token = self.parse_response_token(resp.status_code, to_unicode(text)) 718s /usr/lib/python3/dist-packages/authlib/oauth1/client.py:152: in parse_response_token 718s self.handle_error('fetch_token_denied', message) 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s error_type = 'fetch_token_denied' 718s error_description = 'Token request failed with code 404, response was \'\n\n\t\t\n\t\n\n\'.' 718s 718s @staticmethod 718s def handle_error(error_type, error_description): 718s > raise OAuthError(error_type, error_description) 718s E authlib.integrations.base_client.errors.OAuthError: fetch_token_denied: Token request failed with code 404, response was ' 718s E 718s E 718s E 718s E 404 - Not Found 718s E 718s E 718s E

404 - Not Found

718s E 718s E 718s E 718s E '. 718s 718s /usr/lib/python3/dist-packages/authlib/integrations/httpx_client/oauth1_client.py:76: OAuthError 718s ______________________ test_fetch_request_token_via_body _______________________ 718s 718s @pytest.mark.asyncio 718s async def test_fetch_request_token_via_body(): 718s request_token = {'oauth_token': '1', 'oauth_token_secret': '2'} 718s 718s async def assert_func(request): 718s auth_header = request.headers.get('authorization') 718s assert auth_header is None 718s 718s content = await request.body() 718s assert b'oauth_consumer_key=id' in content 718s assert b'&oauth_signature=' in content 718s 718s mock_response = AsyncMockDispatch(request_token, assert_func=assert_func) 718s 718s async with AsyncOAuth1Client( 718s 'id', 'secret', signature_type=SIGNATURE_TYPE_BODY, 718s app=mock_response, 718s ) as client: 718s > response = await client.fetch_request_token(oauth_url) 718s 718s tests/clients/test_httpx/test_async_oauth1_client.py:47: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/authlib/integrations/httpx_client/oauth1_client.py:70: in _fetch_token 718s token = self.parse_response_token(resp.status_code, to_unicode(text)) 718s /usr/lib/python3/dist-packages/authlib/oauth1/client.py:152: in parse_response_token 718s self.handle_error('fetch_token_denied', message) 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s error_type = 'fetch_token_denied' 718s error_description = 'Token request failed with code 404, response was \'\n\n\t\t\n\t\n\n\'.' 718s 718s @staticmethod 718s def handle_error(error_type, error_description): 718s > raise OAuthError(error_type, error_description) 718s E authlib.integrations.base_client.errors.OAuthError: fetch_token_denied: Token request failed with code 404, response was ' 718s E 718s E 718s E 718s E 404 - Not Found 718s E 718s E 718s E

404 - Not Found

718s E 718s E 718s E 718s E '. 718s 718s /usr/lib/python3/dist-packages/authlib/integrations/httpx_client/oauth1_client.py:76: OAuthError 718s ______________________ test_fetch_request_token_via_query ______________________ 718s 718s @pytest.mark.asyncio 718s async def test_fetch_request_token_via_query(): 718s request_token = {'oauth_token': '1', 'oauth_token_secret': '2'} 718s 718s async def assert_func(request): 718s auth_header = request.headers.get('authorization') 718s assert auth_header is None 718s 718s url = str(request.url) 718s assert 'oauth_consumer_key=id' in url 718s assert '&oauth_signature=' in url 718s 718s mock_response = AsyncMockDispatch(request_token, assert_func=assert_func) 718s 718s async with AsyncOAuth1Client( 718s 'id', 'secret', signature_type=SIGNATURE_TYPE_QUERY, 718s app=mock_response, 718s ) as client: 718s > response = await client.fetch_request_token(oauth_url) 718s 718s tests/clients/test_httpx/test_async_oauth1_client.py:70: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/authlib/integrations/httpx_client/oauth1_client.py:70: in _fetch_token 718s token = self.parse_response_token(resp.status_code, to_unicode(text)) 718s /usr/lib/python3/dist-packages/authlib/oauth1/client.py:152: in parse_response_token 718s self.handle_error('fetch_token_denied', message) 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s error_type = 'fetch_token_denied' 718s error_description = 'Token request failed with code 404, response was \'\n\n\t\t\n\t\n\n\'.' 718s 718s @staticmethod 718s def handle_error(error_type, error_description): 718s > raise OAuthError(error_type, error_description) 718s E authlib.integrations.base_client.errors.OAuthError: fetch_token_denied: Token request failed with code 404, response was ' 718s E 718s E 718s E 718s E 404 - Not Found 718s E 718s E 718s E

404 - Not Found

718s E 718s E 718s E 718s E '. 718s 718s /usr/lib/python3/dist-packages/authlib/integrations/httpx_client/oauth1_client.py:76: OAuthError 718s ___________________________ test_fetch_access_token ____________________________ 718s 718s @pytest.mark.asyncio 718s async def test_fetch_access_token(): 718s request_token = {'oauth_token': '1', 'oauth_token_secret': '2'} 718s 718s async def assert_func(request): 718s auth_header = request.headers.get('authorization') 718s assert 'oauth_verifier="d"' in auth_header 718s assert 'oauth_token="foo"' in auth_header 718s assert 'oauth_consumer_key="id"' in auth_header 718s assert 'oauth_signature=' in auth_header 718s 718s mock_response = AsyncMockDispatch(request_token, assert_func=assert_func) 718s async with AsyncOAuth1Client( 718s 'id', 'secret', token='foo', token_secret='bar', 718s app=mock_response, 718s ) as client: 718s with pytest.raises(OAuthError): 718s await client.fetch_access_token(oauth_url) 718s 718s > response = await client.fetch_access_token(oauth_url, verifier='d') 718s 718s tests/clients/test_httpx/test_async_oauth1_client.py:94: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/authlib/integrations/httpx_client/oauth1_client.py:63: in fetch_access_token 718s token = await self._fetch_token(url, **kwargs) 718s /usr/lib/python3/dist-packages/authlib/integrations/httpx_client/oauth1_client.py:70: in _fetch_token 718s token = self.parse_response_token(resp.status_code, to_unicode(text)) 718s /usr/lib/python3/dist-packages/authlib/oauth1/client.py:152: in parse_response_token 718s self.handle_error('fetch_token_denied', message) 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s error_type = 'fetch_token_denied' 718s error_description = 'Token request failed with code 404, response was \'\n\n\t\t\n\t\n\n\'.' 718s 718s @staticmethod 718s def handle_error(error_type, error_description): 718s > raise OAuthError(error_type, error_description) 718s E authlib.integrations.base_client.errors.OAuthError: fetch_token_denied: Token request failed with code 404, response was ' 718s E 718s E 718s E 718s E 404 - Not Found 718s E 718s E 718s E

404 - Not Found

718s E 718s E 718s E 718s E '. 718s 718s /usr/lib/python3/dist-packages/authlib/integrations/httpx_client/oauth1_client.py:76: OAuthError 718s _____________________________ test_get_via_header ______________________________ 718s 718s @pytest.mark.asyncio 718s async def test_get_via_header(): 718s mock_response = AsyncMockDispatch(b'hello') 718s async with AsyncOAuth1Client( 718s 'id', 'secret', token='foo', token_secret='bar', 718s app=mock_response, 718s ) as client: 718s response = await client.get('https://example.com/') 718s 718s > assert response.content == b'hello' 718s E AssertionError: assert b'\n\n' == b'hello' 718s E At index 0 diff: b'<' != b'h' 718s E Use -v to get more diff 718s 718s tests/clients/test_httpx/test_async_oauth1_client.py:108: AssertionError 718s ______________________________ test_get_via_body _______________________________ 718s 718s @pytest.mark.asyncio 718s async def test_get_via_body(): 718s async def assert_func(request): 718s content = await request.body() 718s assert b'oauth_token=foo' in content 718s assert b'oauth_consumer_key=id' in content 718s assert b'oauth_signature=' in content 718s 718s mock_response = AsyncMockDispatch(b'hello', assert_func=assert_func) 718s async with AsyncOAuth1Client( 718s 'id', 'secret', token='foo', token_secret='bar', 718s signature_type=SIGNATURE_TYPE_BODY, 718s app=mock_response, 718s ) as client: 718s response = await client.post('https://example.com/') 718s 718s > assert response.content == b'hello' 718s E AssertionError: assert b'\n\n' == b'hello' 718s E At index 0 diff: b'<' != b'h' 718s E Use -v to get more diff 718s 718s tests/clients/test_httpx/test_async_oauth1_client.py:132: AssertionError 718s ______________________________ test_get_via_query ______________________________ 718s 718s @pytest.mark.asyncio 718s async def test_get_via_query(): 718s mock_response = AsyncMockDispatch(b'hello') 718s async with AsyncOAuth1Client( 718s 'id', 'secret', token='foo', token_secret='bar', 718s signature_type=SIGNATURE_TYPE_QUERY, 718s app=mock_response, 718s ) as client: 718s response = await client.get('https://example.com/') 718s 718s > assert response.content == b'hello' 718s E AssertionError: assert b'\n\n' == b'hello' 718s E At index 0 diff: b'<' != b'h' 718s E Use -v to get more diff 718s 718s tests/clients/test_httpx/test_async_oauth1_client.py:149: AssertionError 718s __________ test_add_token_get_request[assert_token_in_header-header] ___________ 718s 718s @contextlib.contextmanager 718s def map_httpcore_exceptions() -> typing.Iterator[None]: 718s try: 718s > yield 718s 718s /usr/lib/python3/dist-packages/httpx/_transports/default.py:69: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/httpx/_transports/default.py:373: in handle_async_request 718s resp = await self._pool.handle_async_request(req) 718s /usr/lib/python3/dist-packages/httpcore/_async/connection_pool.py:216: in handle_async_request 718s raise exc from None 718s /usr/lib/python3/dist-packages/httpcore/_async/connection_pool.py:196: in handle_async_request 718s response = await connection.handle_async_request( 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s self = 718s request = 718s 718s async def handle_async_request(self, request: Request) -> Response: 718s timeouts = request.extensions.get("timeout", {}) 718s timeout = timeouts.get("connect", None) 718s 718s async with self._connect_lock: 718s if not self._connected: 718s target = b"%b:%d" % (self._remote_origin.host, self._remote_origin.port) 718s 718s connect_url = URL( 718s scheme=self._proxy_origin.scheme, 718s host=self._proxy_origin.host, 718s port=self._proxy_origin.port, 718s target=target, 718s ) 718s connect_headers = merge_headers( 718s [(b"Host", target), (b"Accept", b"*/*")], self._proxy_headers 718s ) 718s connect_request = Request( 718s method=b"CONNECT", 718s url=connect_url, 718s headers=connect_headers, 718s extensions=request.extensions, 718s ) 718s connect_response = await self._connection.handle_async_request( 718s connect_request 718s ) 718s 718s if connect_response.status < 200 or connect_response.status > 299: 718s reason_bytes = connect_response.extensions.get("reason_phrase", b"") 718s reason_str = reason_bytes.decode("ascii", errors="ignore") 718s msg = "%d %s" % (connect_response.status, reason_str) 718s await self._connection.aclose() 718s > raise ProxyError(msg) 718s E httpcore.ProxyError: 503 Service Unavailable 718s 718s /usr/lib/python3/dist-packages/httpcore/_async/http_proxy.py:298: ProxyError 718s 718s The above exception was the direct cause of the following exception: 718s 718s assert_func = 718s token_placement = 'header' 718s 718s @pytest.mark.asyncio 718s @pytest.mark.parametrize( 718s "assert_func, token_placement", 718s [ 718s (assert_token_in_header, "header"), 718s (assert_token_in_body, "body"), 718s (assert_token_in_uri, "uri") 718s ] 718s ) 718s async def test_add_token_get_request(assert_func, token_placement): 718s mock_response = AsyncMockDispatch({'a': 'a'}, assert_func=assert_func) 718s async with AsyncOAuth2Client( 718s 'foo', 718s token=default_token, 718s token_placement=token_placement, 718s app=mock_response 718s ) as client: 718s > resp = await client.get('https://i.b') 718s 718s tests/clients/test_httpx/test_async_oauth2_client.py:62: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/httpx/_client.py:1801: in get 718s return await self.request( 718s /usr/lib/python3/dist-packages/authlib/integrations/httpx_client/oauth2_client.py:90: in request 718s return await super().request( 718s /usr/lib/python3/dist-packages/httpx/_client.py:1574: in request 718s return await self.send(request, auth=auth, follow_redirects=follow_redirects) 718s /usr/lib/python3/dist-packages/httpx/_client.py:1661: in send 718s response = await self._send_handling_auth( 718s /usr/lib/python3/dist-packages/httpx/_client.py:1689: in _send_handling_auth 718s response = await self._send_handling_redirects( 718s /usr/lib/python3/dist-packages/httpx/_client.py:1726: in _send_handling_redirects 718s response = await self._send_single_request(request) 718s /usr/lib/python3/dist-packages/httpx/_client.py:1763: in _send_single_request 718s response = await transport.handle_async_request(request) 718s /usr/lib/python3/dist-packages/httpx/_transports/default.py:372: in handle_async_request 718s with map_httpcore_exceptions(): 718s /usr/lib/python3.12/contextlib.py:158: in __exit__ 718s self.gen.throw(value) 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s @contextlib.contextmanager 718s def map_httpcore_exceptions() -> typing.Iterator[None]: 718s try: 718s yield 718s except Exception as exc: 718s mapped_exc = None 718s 718s for from_exc, to_exc in HTTPCORE_EXC_MAP.items(): 718s if not isinstance(exc, from_exc): 718s continue 718s # We want to map to the most specific exception we can find. 718s # Eg if `exc` is an `httpcore.ReadTimeout`, we want to map to 718s # `httpx.ReadTimeout`, not just `httpx.TimeoutException`. 718s if mapped_exc is None or issubclass(to_exc, mapped_exc): 718s mapped_exc = to_exc 718s 718s if mapped_exc is None: # pragma: no cover 718s raise 718s 718s message = str(exc) 718s > raise mapped_exc(message) from exc 718s E httpx.ProxyError: 503 Service Unavailable 718s 718s /usr/lib/python3/dist-packages/httpx/_transports/default.py:86: ProxyError 718s ____________ test_add_token_get_request[assert_token_in_body-body] _____________ 718s 718s @contextlib.contextmanager 718s def map_httpcore_exceptions() -> typing.Iterator[None]: 718s try: 718s > yield 718s 718s /usr/lib/python3/dist-packages/httpx/_transports/default.py:69: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/httpx/_transports/default.py:373: in handle_async_request 718s resp = await self._pool.handle_async_request(req) 718s /usr/lib/python3/dist-packages/httpcore/_async/connection_pool.py:216: in handle_async_request 718s raise exc from None 718s /usr/lib/python3/dist-packages/httpcore/_async/connection_pool.py:196: in handle_async_request 718s response = await connection.handle_async_request( 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s self = 718s request = 718s 718s async def handle_async_request(self, request: Request) -> Response: 718s timeouts = request.extensions.get("timeout", {}) 718s timeout = timeouts.get("connect", None) 718s 718s async with self._connect_lock: 718s if not self._connected: 718s target = b"%b:%d" % (self._remote_origin.host, self._remote_origin.port) 718s 718s connect_url = URL( 718s scheme=self._proxy_origin.scheme, 718s host=self._proxy_origin.host, 718s port=self._proxy_origin.port, 718s target=target, 718s ) 718s connect_headers = merge_headers( 718s [(b"Host", target), (b"Accept", b"*/*")], self._proxy_headers 718s ) 718s connect_request = Request( 718s method=b"CONNECT", 718s url=connect_url, 718s headers=connect_headers, 718s extensions=request.extensions, 718s ) 718s connect_response = await self._connection.handle_async_request( 718s connect_request 718s ) 718s 718s if connect_response.status < 200 or connect_response.status > 299: 718s reason_bytes = connect_response.extensions.get("reason_phrase", b"") 718s reason_str = reason_bytes.decode("ascii", errors="ignore") 718s msg = "%d %s" % (connect_response.status, reason_str) 718s await self._connection.aclose() 718s > raise ProxyError(msg) 718s E httpcore.ProxyError: 503 Service Unavailable 718s 718s /usr/lib/python3/dist-packages/httpcore/_async/http_proxy.py:298: ProxyError 718s 718s The above exception was the direct cause of the following exception: 718s 718s assert_func = 718s token_placement = 'body' 718s 718s @pytest.mark.asyncio 718s @pytest.mark.parametrize( 718s "assert_func, token_placement", 718s [ 718s (assert_token_in_header, "header"), 718s (assert_token_in_body, "body"), 718s (assert_token_in_uri, "uri") 718s ] 718s ) 718s async def test_add_token_get_request(assert_func, token_placement): 718s mock_response = AsyncMockDispatch({'a': 'a'}, assert_func=assert_func) 718s async with AsyncOAuth2Client( 718s 'foo', 718s token=default_token, 718s token_placement=token_placement, 718s app=mock_response 718s ) as client: 718s > resp = await client.get('https://i.b') 718s 718s tests/clients/test_httpx/test_async_oauth2_client.py:62: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/httpx/_client.py:1801: in get 718s return await self.request( 718s /usr/lib/python3/dist-packages/authlib/integrations/httpx_client/oauth2_client.py:90: in request 718s return await super().request( 718s /usr/lib/python3/dist-packages/httpx/_client.py:1574: in request 718s return await self.send(request, auth=auth, follow_redirects=follow_redirects) 718s /usr/lib/python3/dist-packages/httpx/_client.py:1661: in send 718s response = await self._send_handling_auth( 718s /usr/lib/python3/dist-packages/httpx/_client.py:1689: in _send_handling_auth 718s response = await self._send_handling_redirects( 718s /usr/lib/python3/dist-packages/httpx/_client.py:1726: in _send_handling_redirects 718s response = await self._send_single_request(request) 718s /usr/lib/python3/dist-packages/httpx/_client.py:1763: in _send_single_request 718s response = await transport.handle_async_request(request) 718s /usr/lib/python3/dist-packages/httpx/_transports/default.py:372: in handle_async_request 718s with map_httpcore_exceptions(): 718s /usr/lib/python3.12/contextlib.py:158: in __exit__ 718s self.gen.throw(value) 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s @contextlib.contextmanager 718s def map_httpcore_exceptions() -> typing.Iterator[None]: 718s try: 718s yield 718s except Exception as exc: 718s mapped_exc = None 718s 718s for from_exc, to_exc in HTTPCORE_EXC_MAP.items(): 718s if not isinstance(exc, from_exc): 718s continue 718s # We want to map to the most specific exception we can find. 718s # Eg if `exc` is an `httpcore.ReadTimeout`, we want to map to 718s # `httpx.ReadTimeout`, not just `httpx.TimeoutException`. 718s if mapped_exc is None or issubclass(to_exc, mapped_exc): 718s mapped_exc = to_exc 718s 718s if mapped_exc is None: # pragma: no cover 718s raise 718s 718s message = str(exc) 718s > raise mapped_exc(message) from exc 718s E httpx.ProxyError: 503 Service Unavailable 718s 718s /usr/lib/python3/dist-packages/httpx/_transports/default.py:86: ProxyError 718s _____________ test_add_token_get_request[assert_token_in_uri-uri] ______________ 718s 718s @contextlib.contextmanager 718s def map_httpcore_exceptions() -> typing.Iterator[None]: 718s try: 718s > yield 718s 718s /usr/lib/python3/dist-packages/httpx/_transports/default.py:69: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/httpx/_transports/default.py:373: in handle_async_request 718s resp = await self._pool.handle_async_request(req) 718s /usr/lib/python3/dist-packages/httpcore/_async/connection_pool.py:216: in handle_async_request 718s raise exc from None 718s /usr/lib/python3/dist-packages/httpcore/_async/connection_pool.py:196: in handle_async_request 718s response = await connection.handle_async_request( 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s self = 718s request = 718s 718s async def handle_async_request(self, request: Request) -> Response: 718s timeouts = request.extensions.get("timeout", {}) 718s timeout = timeouts.get("connect", None) 718s 718s async with self._connect_lock: 718s if not self._connected: 718s target = b"%b:%d" % (self._remote_origin.host, self._remote_origin.port) 718s 718s connect_url = URL( 718s scheme=self._proxy_origin.scheme, 718s host=self._proxy_origin.host, 718s port=self._proxy_origin.port, 718s target=target, 718s ) 718s connect_headers = merge_headers( 718s [(b"Host", target), (b"Accept", b"*/*")], self._proxy_headers 718s ) 718s connect_request = Request( 718s method=b"CONNECT", 718s url=connect_url, 718s headers=connect_headers, 718s extensions=request.extensions, 718s ) 718s connect_response = await self._connection.handle_async_request( 718s connect_request 718s ) 718s 718s if connect_response.status < 200 or connect_response.status > 299: 718s reason_bytes = connect_response.extensions.get("reason_phrase", b"") 718s reason_str = reason_bytes.decode("ascii", errors="ignore") 718s msg = "%d %s" % (connect_response.status, reason_str) 718s await self._connection.aclose() 718s > raise ProxyError(msg) 718s E httpcore.ProxyError: 503 Service Unavailable 718s 718s /usr/lib/python3/dist-packages/httpcore/_async/http_proxy.py:298: ProxyError 718s 718s The above exception was the direct cause of the following exception: 718s 718s assert_func = 718s token_placement = 'uri' 718s 718s @pytest.mark.asyncio 718s @pytest.mark.parametrize( 718s "assert_func, token_placement", 718s [ 718s (assert_token_in_header, "header"), 718s (assert_token_in_body, "body"), 718s (assert_token_in_uri, "uri") 718s ] 718s ) 718s async def test_add_token_get_request(assert_func, token_placement): 718s mock_response = AsyncMockDispatch({'a': 'a'}, assert_func=assert_func) 718s async with AsyncOAuth2Client( 718s 'foo', 718s token=default_token, 718s token_placement=token_placement, 718s app=mock_response 718s ) as client: 718s > resp = await client.get('https://i.b') 718s 718s tests/clients/test_httpx/test_async_oauth2_client.py:62: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/httpx/_client.py:1801: in get 718s return await self.request( 718s /usr/lib/python3/dist-packages/authlib/integrations/httpx_client/oauth2_client.py:90: in request 718s return await super().request( 718s /usr/lib/python3/dist-packages/httpx/_client.py:1574: in request 718s return await self.send(request, auth=auth, follow_redirects=follow_redirects) 718s /usr/lib/python3/dist-packages/httpx/_client.py:1661: in send 718s response = await self._send_handling_auth( 718s /usr/lib/python3/dist-packages/httpx/_client.py:1689: in _send_handling_auth 718s response = await self._send_handling_redirects( 718s /usr/lib/python3/dist-packages/httpx/_client.py:1726: in _send_handling_redirects 718s response = await self._send_single_request(request) 718s /usr/lib/python3/dist-packages/httpx/_client.py:1763: in _send_single_request 718s response = await transport.handle_async_request(request) 718s /usr/lib/python3/dist-packages/httpx/_transports/default.py:372: in handle_async_request 718s with map_httpcore_exceptions(): 718s /usr/lib/python3.12/contextlib.py:158: in __exit__ 718s self.gen.throw(value) 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s @contextlib.contextmanager 718s def map_httpcore_exceptions() -> typing.Iterator[None]: 718s try: 718s yield 718s except Exception as exc: 718s mapped_exc = None 718s 718s for from_exc, to_exc in HTTPCORE_EXC_MAP.items(): 718s if not isinstance(exc, from_exc): 718s continue 718s # We want to map to the most specific exception we can find. 718s # Eg if `exc` is an `httpcore.ReadTimeout`, we want to map to 718s # `httpx.ReadTimeout`, not just `httpx.TimeoutException`. 718s if mapped_exc is None or issubclass(to_exc, mapped_exc): 718s mapped_exc = to_exc 718s 718s if mapped_exc is None: # pragma: no cover 718s raise 718s 718s message = str(exc) 718s > raise mapped_exc(message) from exc 718s E httpx.ProxyError: 503 Service Unavailable 718s 718s /usr/lib/python3/dist-packages/httpx/_transports/default.py:86: ProxyError 718s ______ test_add_token_to_streaming_request[assert_token_in_header-header] ______ 718s 718s @contextlib.contextmanager 718s def map_httpcore_exceptions() -> typing.Iterator[None]: 718s try: 718s > yield 718s 718s /usr/lib/python3/dist-packages/httpx/_transports/default.py:69: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/httpx/_transports/default.py:373: in handle_async_request 718s resp = await self._pool.handle_async_request(req) 718s /usr/lib/python3/dist-packages/httpcore/_async/connection_pool.py:216: in handle_async_request 718s raise exc from None 718s /usr/lib/python3/dist-packages/httpcore/_async/connection_pool.py:196: in handle_async_request 718s response = await connection.handle_async_request( 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s self = 718s request = 718s 718s async def handle_async_request(self, request: Request) -> Response: 718s timeouts = request.extensions.get("timeout", {}) 718s timeout = timeouts.get("connect", None) 718s 718s async with self._connect_lock: 718s if not self._connected: 718s target = b"%b:%d" % (self._remote_origin.host, self._remote_origin.port) 718s 718s connect_url = URL( 718s scheme=self._proxy_origin.scheme, 718s host=self._proxy_origin.host, 718s port=self._proxy_origin.port, 718s target=target, 718s ) 718s connect_headers = merge_headers( 718s [(b"Host", target), (b"Accept", b"*/*")], self._proxy_headers 718s ) 718s connect_request = Request( 718s method=b"CONNECT", 718s url=connect_url, 718s headers=connect_headers, 718s extensions=request.extensions, 718s ) 718s connect_response = await self._connection.handle_async_request( 718s connect_request 718s ) 718s 718s if connect_response.status < 200 or connect_response.status > 299: 718s reason_bytes = connect_response.extensions.get("reason_phrase", b"") 718s reason_str = reason_bytes.decode("ascii", errors="ignore") 718s msg = "%d %s" % (connect_response.status, reason_str) 718s await self._connection.aclose() 718s > raise ProxyError(msg) 718s E httpcore.ProxyError: 503 Service Unavailable 718s 718s /usr/lib/python3/dist-packages/httpcore/_async/http_proxy.py:298: ProxyError 718s 718s The above exception was the direct cause of the following exception: 718s 718s assert_func = 718s token_placement = 'header' 718s 718s @pytest.mark.asyncio 718s @pytest.mark.parametrize( 718s "assert_func, token_placement", 718s [ 718s (assert_token_in_header, "header"), 718s (assert_token_in_body, "body"), 718s (assert_token_in_uri, "uri") 718s ] 718s ) 718s async def test_add_token_to_streaming_request(assert_func, token_placement): 718s mock_response = AsyncMockDispatch({'a': 'a'}, assert_func=assert_func) 718s async with AsyncOAuth2Client( 718s 'foo', 718s token=default_token, 718s token_placement=token_placement, 718s app=mock_response 718s ) as client: 718s > async with client.stream("GET", 'https://i.b') as stream: 718s 718s tests/clients/test_httpx/test_async_oauth2_client.py:85: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3.12/contextlib.py:210: in __aenter__ 718s return await anext(self.gen) 718s /usr/lib/python3/dist-packages/authlib/integrations/httpx_client/oauth2_client.py:103: in stream 718s async with super().stream( 718s /usr/lib/python3.12/contextlib.py:210: in __aenter__ 718s return await anext(self.gen) 718s /usr/lib/python3/dist-packages/httpx/_client.py:1617: in stream 718s response = await self.send( 718s /usr/lib/python3/dist-packages/httpx/_client.py:1661: in send 718s response = await self._send_handling_auth( 718s /usr/lib/python3/dist-packages/httpx/_client.py:1689: in _send_handling_auth 718s response = await self._send_handling_redirects( 718s /usr/lib/python3/dist-packages/httpx/_client.py:1726: in _send_handling_redirects 718s response = await self._send_single_request(request) 718s /usr/lib/python3/dist-packages/httpx/_client.py:1763: in _send_single_request 718s response = await transport.handle_async_request(request) 718s /usr/lib/python3/dist-packages/httpx/_transports/default.py:372: in handle_async_request 718s with map_httpcore_exceptions(): 718s /usr/lib/python3.12/contextlib.py:158: in __exit__ 718s self.gen.throw(value) 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s @contextlib.contextmanager 718s def map_httpcore_exceptions() -> typing.Iterator[None]: 718s try: 718s yield 718s except Exception as exc: 718s mapped_exc = None 718s 718s for from_exc, to_exc in HTTPCORE_EXC_MAP.items(): 718s if not isinstance(exc, from_exc): 718s continue 718s # We want to map to the most specific exception we can find. 718s # Eg if `exc` is an `httpcore.ReadTimeout`, we want to map to 718s # `httpx.ReadTimeout`, not just `httpx.TimeoutException`. 718s if mapped_exc is None or issubclass(to_exc, mapped_exc): 718s mapped_exc = to_exc 718s 718s if mapped_exc is None: # pragma: no cover 718s raise 718s 718s message = str(exc) 718s > raise mapped_exc(message) from exc 718s E httpx.ProxyError: 503 Service Unavailable 718s 718s /usr/lib/python3/dist-packages/httpx/_transports/default.py:86: ProxyError 718s ________ test_add_token_to_streaming_request[assert_token_in_body-body] ________ 718s 718s @contextlib.contextmanager 718s def map_httpcore_exceptions() -> typing.Iterator[None]: 718s try: 718s > yield 718s 718s /usr/lib/python3/dist-packages/httpx/_transports/default.py:69: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/httpx/_transports/default.py:373: in handle_async_request 718s resp = await self._pool.handle_async_request(req) 718s /usr/lib/python3/dist-packages/httpcore/_async/connection_pool.py:216: in handle_async_request 718s raise exc from None 718s /usr/lib/python3/dist-packages/httpcore/_async/connection_pool.py:196: in handle_async_request 718s response = await connection.handle_async_request( 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s self = 718s request = 718s 718s async def handle_async_request(self, request: Request) -> Response: 718s timeouts = request.extensions.get("timeout", {}) 718s timeout = timeouts.get("connect", None) 718s 718s async with self._connect_lock: 718s if not self._connected: 718s target = b"%b:%d" % (self._remote_origin.host, self._remote_origin.port) 718s 718s connect_url = URL( 718s scheme=self._proxy_origin.scheme, 718s host=self._proxy_origin.host, 718s port=self._proxy_origin.port, 718s target=target, 718s ) 718s connect_headers = merge_headers( 718s [(b"Host", target), (b"Accept", b"*/*")], self._proxy_headers 718s ) 718s connect_request = Request( 718s method=b"CONNECT", 718s url=connect_url, 718s headers=connect_headers, 718s extensions=request.extensions, 718s ) 718s connect_response = await self._connection.handle_async_request( 718s connect_request 718s ) 718s 718s if connect_response.status < 200 or connect_response.status > 299: 718s reason_bytes = connect_response.extensions.get("reason_phrase", b"") 718s reason_str = reason_bytes.decode("ascii", errors="ignore") 718s msg = "%d %s" % (connect_response.status, reason_str) 718s await self._connection.aclose() 718s > raise ProxyError(msg) 718s E httpcore.ProxyError: 503 Service Unavailable 718s 718s /usr/lib/python3/dist-packages/httpcore/_async/http_proxy.py:298: ProxyError 718s 718s The above exception was the direct cause of the following exception: 718s 718s assert_func = 718s token_placement = 'body' 718s 718s @pytest.mark.asyncio 718s @pytest.mark.parametrize( 718s "assert_func, token_placement", 718s [ 718s (assert_token_in_header, "header"), 718s (assert_token_in_body, "body"), 718s (assert_token_in_uri, "uri") 718s ] 718s ) 718s async def test_add_token_to_streaming_request(assert_func, token_placement): 718s mock_response = AsyncMockDispatch({'a': 'a'}, assert_func=assert_func) 718s async with AsyncOAuth2Client( 718s 'foo', 718s token=default_token, 718s token_placement=token_placement, 718s app=mock_response 718s ) as client: 718s > async with client.stream("GET", 'https://i.b') as stream: 718s 718s tests/clients/test_httpx/test_async_oauth2_client.py:85: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3.12/contextlib.py:210: in __aenter__ 718s return await anext(self.gen) 718s /usr/lib/python3/dist-packages/authlib/integrations/httpx_client/oauth2_client.py:103: in stream 718s async with super().stream( 718s /usr/lib/python3.12/contextlib.py:210: in __aenter__ 718s return await anext(self.gen) 718s /usr/lib/python3/dist-packages/httpx/_client.py:1617: in stream 718s response = await self.send( 718s /usr/lib/python3/dist-packages/httpx/_client.py:1661: in send 718s response = await self._send_handling_auth( 718s /usr/lib/python3/dist-packages/httpx/_client.py:1689: in _send_handling_auth 718s response = await self._send_handling_redirects( 718s /usr/lib/python3/dist-packages/httpx/_client.py:1726: in _send_handling_redirects 718s response = await self._send_single_request(request) 718s /usr/lib/python3/dist-packages/httpx/_client.py:1763: in _send_single_request 718s response = await transport.handle_async_request(request) 718s /usr/lib/python3/dist-packages/httpx/_transports/default.py:372: in handle_async_request 718s with map_httpcore_exceptions(): 718s /usr/lib/python3.12/contextlib.py:158: in __exit__ 718s self.gen.throw(value) 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s @contextlib.contextmanager 718s def map_httpcore_exceptions() -> typing.Iterator[None]: 718s try: 718s yield 718s except Exception as exc: 718s mapped_exc = None 718s 718s for from_exc, to_exc in HTTPCORE_EXC_MAP.items(): 718s if not isinstance(exc, from_exc): 718s continue 718s # We want to map to the most specific exception we can find. 718s # Eg if `exc` is an `httpcore.ReadTimeout`, we want to map to 718s # `httpx.ReadTimeout`, not just `httpx.TimeoutException`. 718s if mapped_exc is None or issubclass(to_exc, mapped_exc): 718s mapped_exc = to_exc 718s 718s if mapped_exc is None: # pragma: no cover 718s raise 718s 718s message = str(exc) 718s > raise mapped_exc(message) from exc 718s E httpx.ProxyError: 503 Service Unavailable 718s 718s /usr/lib/python3/dist-packages/httpx/_transports/default.py:86: ProxyError 718s _________ test_add_token_to_streaming_request[assert_token_in_uri-uri] _________ 718s 718s @contextlib.contextmanager 718s def map_httpcore_exceptions() -> typing.Iterator[None]: 718s try: 718s > yield 718s 718s /usr/lib/python3/dist-packages/httpx/_transports/default.py:69: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/httpx/_transports/default.py:373: in handle_async_request 718s resp = await self._pool.handle_async_request(req) 718s /usr/lib/python3/dist-packages/httpcore/_async/connection_pool.py:216: in handle_async_request 718s raise exc from None 718s /usr/lib/python3/dist-packages/httpcore/_async/connection_pool.py:196: in handle_async_request 718s response = await connection.handle_async_request( 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s self = 718s request = 718s 718s async def handle_async_request(self, request: Request) -> Response: 718s timeouts = request.extensions.get("timeout", {}) 718s timeout = timeouts.get("connect", None) 718s 718s async with self._connect_lock: 718s if not self._connected: 718s target = b"%b:%d" % (self._remote_origin.host, self._remote_origin.port) 718s 718s connect_url = URL( 718s scheme=self._proxy_origin.scheme, 718s host=self._proxy_origin.host, 718s port=self._proxy_origin.port, 718s target=target, 718s ) 718s connect_headers = merge_headers( 718s [(b"Host", target), (b"Accept", b"*/*")], self._proxy_headers 718s ) 718s connect_request = Request( 718s method=b"CONNECT", 718s url=connect_url, 718s headers=connect_headers, 718s extensions=request.extensions, 718s ) 718s connect_response = await self._connection.handle_async_request( 718s connect_request 718s ) 718s 718s if connect_response.status < 200 or connect_response.status > 299: 718s reason_bytes = connect_response.extensions.get("reason_phrase", b"") 718s reason_str = reason_bytes.decode("ascii", errors="ignore") 718s msg = "%d %s" % (connect_response.status, reason_str) 718s await self._connection.aclose() 718s > raise ProxyError(msg) 718s E httpcore.ProxyError: 503 Service Unavailable 718s 718s /usr/lib/python3/dist-packages/httpcore/_async/http_proxy.py:298: ProxyError 718s 718s The above exception was the direct cause of the following exception: 718s 718s assert_func = 718s token_placement = 'uri' 718s 718s @pytest.mark.asyncio 718s @pytest.mark.parametrize( 718s "assert_func, token_placement", 718s [ 718s (assert_token_in_header, "header"), 718s (assert_token_in_body, "body"), 718s (assert_token_in_uri, "uri") 718s ] 718s ) 718s async def test_add_token_to_streaming_request(assert_func, token_placement): 718s mock_response = AsyncMockDispatch({'a': 'a'}, assert_func=assert_func) 718s async with AsyncOAuth2Client( 718s 'foo', 718s token=default_token, 718s token_placement=token_placement, 718s app=mock_response 718s ) as client: 718s > async with client.stream("GET", 'https://i.b') as stream: 718s 718s tests/clients/test_httpx/test_async_oauth2_client.py:85: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3.12/contextlib.py:210: in __aenter__ 718s return await anext(self.gen) 718s /usr/lib/python3/dist-packages/authlib/integrations/httpx_client/oauth2_client.py:103: in stream 718s async with super().stream( 718s /usr/lib/python3.12/contextlib.py:210: in __aenter__ 718s return await anext(self.gen) 718s /usr/lib/python3/dist-packages/httpx/_client.py:1617: in stream 718s response = await self.send( 718s /usr/lib/python3/dist-packages/httpx/_client.py:1661: in send 718s response = await self._send_handling_auth( 718s /usr/lib/python3/dist-packages/httpx/_client.py:1689: in _send_handling_auth 718s response = await self._send_handling_redirects( 718s /usr/lib/python3/dist-packages/httpx/_client.py:1726: in _send_handling_redirects 718s response = await self._send_single_request(request) 718s /usr/lib/python3/dist-packages/httpx/_client.py:1763: in _send_single_request 718s response = await transport.handle_async_request(request) 718s /usr/lib/python3/dist-packages/httpx/_transports/default.py:372: in handle_async_request 718s with map_httpcore_exceptions(): 718s /usr/lib/python3.12/contextlib.py:158: in __exit__ 718s self.gen.throw(value) 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s @contextlib.contextmanager 718s def map_httpcore_exceptions() -> typing.Iterator[None]: 718s try: 718s yield 718s except Exception as exc: 718s mapped_exc = None 718s 718s for from_exc, to_exc in HTTPCORE_EXC_MAP.items(): 718s if not isinstance(exc, from_exc): 718s continue 718s # We want to map to the most specific exception we can find. 718s # Eg if `exc` is an `httpcore.ReadTimeout`, we want to map to 718s # `httpx.ReadTimeout`, not just `httpx.TimeoutException`. 718s if mapped_exc is None or issubclass(to_exc, mapped_exc): 718s mapped_exc = to_exc 718s 718s if mapped_exc is None: # pragma: no cover 718s raise 718s 718s message = str(exc) 718s > raise mapped_exc(message) from exc 718s E httpx.ProxyError: 503 Service Unavailable 718s 718s /usr/lib/python3/dist-packages/httpx/_transports/default.py:86: ProxyError 718s ____________________________ test_fetch_token_post _____________________________ 718s 718s @pytest.mark.asyncio 718s async def test_fetch_token_post(): 718s url = 'https://example.com/token' 718s 718s async def assert_func(request): 718s content = await request.body() 718s content = content.decode() 718s assert 'code=v' in content 718s assert 'client_id=' in content 718s assert 'grant_type=authorization_code' in content 718s 718s mock_response = AsyncMockDispatch(default_token, assert_func=assert_func) 718s async with AsyncOAuth2Client('foo', app=mock_response) as client: 718s > token = await client.fetch_token(url, authorization_response='https://i.b/?code=v') 718s 718s tests/clients/test_httpx/test_async_oauth2_client.py:156: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/authlib/integrations/httpx_client/oauth2_client.py:138: in _fetch_token 718s return self.parse_response_token(resp) 718s /usr/lib/python3/dist-packages/authlib/oauth2/client.py:342: in parse_response_token 718s token = resp.json() 718s /usr/lib/python3/dist-packages/httpx/_models.py:764: in json 718s return jsonlib.loads(self.content, **kwargs) 718s /usr/lib/python3.12/json/__init__.py:346: in loads 718s return _default_decoder.decode(s) 718s /usr/lib/python3.12/json/decoder.py:337: in decode 718s obj, end = self.raw_decode(s, idx=_w(s, 0).end()) 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s self = 718s s = '\n\n\t\t\n\t\n\n' 718s idx = 0 718s 718s def raw_decode(self, s, idx=0): 718s """Decode a JSON document from ``s`` (a ``str`` beginning with 718s a JSON document) and return a 2-tuple of the Python 718s representation and the index in ``s`` where the document ended. 718s 718s This can be used to decode a JSON document from a string that may 718s have extraneous data at the end. 718s 718s """ 718s try: 718s obj, end = self.scan_once(s, idx) 718s except StopIteration as err: 718s > raise JSONDecodeError("Expecting value", s, err.value) from None 718s E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0) 718s 718s /usr/lib/python3.12/json/decoder.py:355: JSONDecodeError 718s _____________________________ test_fetch_token_get _____________________________ 718s 718s @pytest.mark.asyncio 718s async def test_fetch_token_get(): 718s url = 'https://example.com/token' 718s 718s async def assert_func(request): 718s url = str(request.url) 718s assert 'code=v' in url 718s assert 'client_id=' in url 718s assert 'grant_type=authorization_code' in url 718s 718s mock_response = AsyncMockDispatch(default_token, assert_func=assert_func) 718s async with AsyncOAuth2Client('foo', app=mock_response) as client: 718s authorization_response = 'https://i.b/?code=v' 718s > token = await client.fetch_token( 718s url, authorization_response=authorization_response, method='GET') 718s 718s tests/clients/test_httpx/test_async_oauth2_client.py:186: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/authlib/integrations/httpx_client/oauth2_client.py:138: in _fetch_token 718s return self.parse_response_token(resp) 718s /usr/lib/python3/dist-packages/authlib/oauth2/client.py:342: in parse_response_token 718s token = resp.json() 718s /usr/lib/python3/dist-packages/httpx/_models.py:764: in json 718s return jsonlib.loads(self.content, **kwargs) 718s /usr/lib/python3.12/json/__init__.py:346: in loads 718s return _default_decoder.decode(s) 718s /usr/lib/python3.12/json/decoder.py:337: in decode 718s obj, end = self.raw_decode(s, idx=_w(s, 0).end()) 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s self = 718s s = '\n\n\n Example Domain\n\n \n \n

More information...

\n\n\n\n' 718s idx = 0 718s 718s def raw_decode(self, s, idx=0): 718s """Decode a JSON document from ``s`` (a ``str`` beginning with 718s a JSON document) and return a 2-tuple of the Python 718s representation and the index in ``s`` where the document ended. 718s 718s This can be used to decode a JSON document from a string that may 718s have extraneous data at the end. 718s 718s """ 718s try: 718s obj, end = self.scan_once(s, idx) 718s except StopIteration as err: 718s > raise JSONDecodeError("Expecting value", s, err.value) from None 718s E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0) 718s 718s /usr/lib/python3.12/json/decoder.py:355: JSONDecodeError 718s __________________ test_token_auth_method_client_secret_post ___________________ 718s 718s @pytest.mark.asyncio 718s async def test_token_auth_method_client_secret_post(): 718s url = 'https://example.com/token' 718s 718s async def assert_func(request): 718s content = await request.body() 718s content = content.decode() 718s assert 'code=v' in content 718s assert 'client_id=' in content 718s assert 'client_secret=bar' in content 718s assert 'grant_type=authorization_code' in content 718s 718s mock_response = AsyncMockDispatch(default_token, assert_func=assert_func) 718s async with AsyncOAuth2Client( 718s 'foo', 'bar', 718s token_endpoint_auth_method='client_secret_post', 718s app=mock_response 718s ) as client: 718s > token = await client.fetch_token(url, code='v') 718s 718s tests/clients/test_httpx/test_async_oauth2_client.py:220: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/authlib/integrations/httpx_client/oauth2_client.py:138: in _fetch_token 718s return self.parse_response_token(resp) 718s /usr/lib/python3/dist-packages/authlib/oauth2/client.py:342: in parse_response_token 718s token = resp.json() 718s /usr/lib/python3/dist-packages/httpx/_models.py:764: in json 718s return jsonlib.loads(self.content, **kwargs) 718s /usr/lib/python3.12/json/__init__.py:346: in loads 718s return _default_decoder.decode(s) 718s /usr/lib/python3.12/json/decoder.py:337: in decode 718s obj, end = self.raw_decode(s, idx=_w(s, 0).end()) 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s self = 718s s = '\n\n\t\t\n\t\n\n' 718s idx = 0 718s 718s def raw_decode(self, s, idx=0): 718s """Decode a JSON document from ``s`` (a ``str`` beginning with 718s a JSON document) and return a 2-tuple of the Python 718s representation and the index in ``s`` where the document ended. 718s 718s This can be used to decode a JSON document from a string that may 718s have extraneous data at the end. 718s 718s """ 718s try: 718s obj, end = self.scan_once(s, idx) 718s except StopIteration as err: 718s > raise JSONDecodeError("Expecting value", s, err.value) from None 718s E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0) 718s 718s /usr/lib/python3.12/json/decoder.py:355: JSONDecodeError 718s _______________________ test_access_token_response_hook ________________________ 718s 718s @pytest.mark.asyncio 718s async def test_access_token_response_hook(): 718s url = 'https://example.com/token' 718s 718s def _access_token_response_hook(resp): 718s assert resp.json() == default_token 718s return resp 718s 718s access_token_response_hook = mock.Mock(side_effect=_access_token_response_hook) 718s app = AsyncMockDispatch(default_token) 718s async with AsyncOAuth2Client('foo', token=default_token, app=app) as sess: 718s sess.register_compliance_hook( 718s 'access_token_response', 718s access_token_response_hook 718s ) 718s > assert await sess.fetch_token(url) == default_token 718s 718s tests/clients/test_httpx/test_async_oauth2_client.py:240: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/authlib/integrations/httpx_client/oauth2_client.py:136: in _fetch_token 718s resp = hook(resp) 718s /usr/lib/python3.12/unittest/mock.py:1134: in __call__ 718s return self._mock_call(*args, **kwargs) 718s /usr/lib/python3.12/unittest/mock.py:1138: in _mock_call 718s return self._execute_mock_call(*args, **kwargs) 718s /usr/lib/python3.12/unittest/mock.py:1199: in _execute_mock_call 718s result = effect(*args, **kwargs) 718s tests/clients/test_httpx/test_async_oauth2_client.py:230: in _access_token_response_hook 718s assert resp.json() == default_token 718s /usr/lib/python3/dist-packages/httpx/_models.py:764: in json 718s return jsonlib.loads(self.content, **kwargs) 718s /usr/lib/python3.12/json/__init__.py:346: in loads 718s return _default_decoder.decode(s) 718s /usr/lib/python3.12/json/decoder.py:337: in decode 718s obj, end = self.raw_decode(s, idx=_w(s, 0).end()) 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s self = 718s s = '\n\n\t\t\n\t\n\n' 718s idx = 0 718s 718s def raw_decode(self, s, idx=0): 718s """Decode a JSON document from ``s`` (a ``str`` beginning with 718s a JSON document) and return a 2-tuple of the Python 718s representation and the index in ``s`` where the document ended. 718s 718s This can be used to decode a JSON document from a string that may 718s have extraneous data at the end. 718s 718s """ 718s try: 718s obj, end = self.scan_once(s, idx) 718s except StopIteration as err: 718s > raise JSONDecodeError("Expecting value", s, err.value) from None 718s E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0) 718s 718s /usr/lib/python3.12/json/decoder.py:355: JSONDecodeError 718s ___________________________ test_password_grant_type ___________________________ 718s 718s @pytest.mark.asyncio 718s async def test_password_grant_type(): 718s url = 'https://example.com/token' 718s 718s async def assert_func(request): 718s content = await request.body() 718s content = content.decode() 718s assert 'username=v' in content 718s assert 'scope=profile' in content 718s assert 'grant_type=password' in content 718s 718s app = AsyncMockDispatch(default_token, assert_func=assert_func) 718s async with AsyncOAuth2Client('foo', scope='profile', app=app) as sess: 718s > token = await sess.fetch_token(url, username='v', password='v') 718s 718s tests/clients/test_httpx/test_async_oauth2_client.py:257: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/authlib/integrations/httpx_client/oauth2_client.py:138: in _fetch_token 718s return self.parse_response_token(resp) 718s /usr/lib/python3/dist-packages/authlib/oauth2/client.py:342: in parse_response_token 718s token = resp.json() 718s /usr/lib/python3/dist-packages/httpx/_models.py:764: in json 718s return jsonlib.loads(self.content, **kwargs) 718s /usr/lib/python3.12/json/__init__.py:346: in loads 718s return _default_decoder.decode(s) 718s /usr/lib/python3.12/json/decoder.py:337: in decode 718s obj, end = self.raw_decode(s, idx=_w(s, 0).end()) 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s self = 718s s = '\n\n\t\t\n\t\n\n' 718s idx = 0 718s 718s def raw_decode(self, s, idx=0): 718s """Decode a JSON document from ``s`` (a ``str`` beginning with 718s a JSON document) and return a 2-tuple of the Python 718s representation and the index in ``s`` where the document ended. 718s 718s This can be used to decode a JSON document from a string that may 718s have extraneous data at the end. 718s 718s """ 718s try: 718s obj, end = self.scan_once(s, idx) 718s except StopIteration as err: 718s > raise JSONDecodeError("Expecting value", s, err.value) from None 718s E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0) 718s 718s /usr/lib/python3.12/json/decoder.py:355: JSONDecodeError 718s _________________________ test_client_credentials_type _________________________ 718s 718s @pytest.mark.asyncio 718s async def test_client_credentials_type(): 718s url = 'https://example.com/token' 718s 718s async def assert_func(request): 718s content = await request.body() 718s content = content.decode() 718s assert 'scope=profile' in content 718s assert 'grant_type=client_credentials' in content 718s 718s app = AsyncMockDispatch(default_token, assert_func=assert_func) 718s async with AsyncOAuth2Client('foo', scope='profile', app=app) as sess: 718s > token = await sess.fetch_token(url) 718s 718s tests/clients/test_httpx/test_async_oauth2_client.py:277: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/authlib/integrations/httpx_client/oauth2_client.py:138: in _fetch_token 718s return self.parse_response_token(resp) 718s /usr/lib/python3/dist-packages/authlib/oauth2/client.py:342: in parse_response_token 718s token = resp.json() 718s /usr/lib/python3/dist-packages/httpx/_models.py:764: in json 718s return jsonlib.loads(self.content, **kwargs) 718s /usr/lib/python3.12/json/__init__.py:346: in loads 718s return _default_decoder.decode(s) 718s /usr/lib/python3.12/json/decoder.py:337: in decode 718s obj, end = self.raw_decode(s, idx=_w(s, 0).end()) 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s self = 718s s = '\n\n\t\t\n\t\n\n' 718s idx = 0 718s 718s def raw_decode(self, s, idx=0): 718s """Decode a JSON document from ``s`` (a ``str`` beginning with 718s a JSON document) and return a 2-tuple of the Python 718s representation and the index in ``s`` where the document ended. 718s 718s This can be used to decode a JSON document from a string that may 718s have extraneous data at the end. 718s 718s """ 718s try: 718s obj, end = self.scan_once(s, idx) 718s except StopIteration as err: 718s > raise JSONDecodeError("Expecting value", s, err.value) from None 718s E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0) 718s 718s /usr/lib/python3.12/json/decoder.py:355: JSONDecodeError 718s ______________ test_cleans_previous_token_before_fetching_new_one ______________ 718s 718s @pytest.mark.asyncio 718s async def test_cleans_previous_token_before_fetching_new_one(): 718s now = int(time.time()) 718s new_token = deepcopy(default_token) 718s past = now - 7200 718s default_token['expires_at'] = past 718s new_token['expires_at'] = now + 3600 718s url = 'https://example.com/token' 718s 718s app = AsyncMockDispatch(new_token) 718s with mock.patch('time.time', lambda: now): 718s async with AsyncOAuth2Client('foo', token=default_token, app=app) as sess: 718s > assert await sess.fetch_token(url) == new_token 718s 718s tests/clients/test_httpx/test_async_oauth2_client.py:296: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/authlib/integrations/httpx_client/oauth2_client.py:138: in _fetch_token 718s return self.parse_response_token(resp) 718s /usr/lib/python3/dist-packages/authlib/oauth2/client.py:342: in parse_response_token 718s token = resp.json() 718s /usr/lib/python3/dist-packages/httpx/_models.py:764: in json 718s return jsonlib.loads(self.content, **kwargs) 718s /usr/lib/python3.12/json/__init__.py:346: in loads 718s return _default_decoder.decode(s) 718s /usr/lib/python3.12/json/decoder.py:337: in decode 718s obj, end = self.raw_decode(s, idx=_w(s, 0).end()) 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s self = 718s s = '\n\n\t\t\n\t\n\n' 718s idx = 0 718s 718s def raw_decode(self, s, idx=0): 718s """Decode a JSON document from ``s`` (a ``str`` beginning with 718s a JSON document) and return a 2-tuple of the Python 718s representation and the index in ``s`` where the document ended. 718s 718s This can be used to decode a JSON document from a string that may 718s have extraneous data at the end. 718s 718s """ 718s try: 718s obj, end = self.scan_once(s, idx) 718s except StopIteration as err: 718s > raise JSONDecodeError("Expecting value", s, err.value) from None 718s E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0) 718s 718s /usr/lib/python3.12/json/decoder.py:355: JSONDecodeError 718s ___________________________ test_auto_refresh_token ____________________________ 718s 718s @contextlib.contextmanager 718s def map_httpcore_exceptions() -> typing.Iterator[None]: 718s try: 718s > yield 718s 718s /usr/lib/python3/dist-packages/httpx/_transports/default.py:69: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/httpx/_transports/default.py:373: in handle_async_request 718s resp = await self._pool.handle_async_request(req) 718s /usr/lib/python3/dist-packages/httpcore/_async/connection_pool.py:216: in handle_async_request 718s raise exc from None 718s /usr/lib/python3/dist-packages/httpcore/_async/connection_pool.py:196: in handle_async_request 718s response = await connection.handle_async_request( 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s self = 718s request = 718s 718s async def handle_async_request(self, request: Request) -> Response: 718s timeouts = request.extensions.get("timeout", {}) 718s timeout = timeouts.get("connect", None) 718s 718s async with self._connect_lock: 718s if not self._connected: 718s target = b"%b:%d" % (self._remote_origin.host, self._remote_origin.port) 718s 718s connect_url = URL( 718s scheme=self._proxy_origin.scheme, 718s host=self._proxy_origin.host, 718s port=self._proxy_origin.port, 718s target=target, 718s ) 718s connect_headers = merge_headers( 718s [(b"Host", target), (b"Accept", b"*/*")], self._proxy_headers 718s ) 718s connect_request = Request( 718s method=b"CONNECT", 718s url=connect_url, 718s headers=connect_headers, 718s extensions=request.extensions, 718s ) 718s connect_response = await self._connection.handle_async_request( 718s connect_request 718s ) 718s 718s if connect_response.status < 200 or connect_response.status > 299: 718s reason_bytes = connect_response.extensions.get("reason_phrase", b"") 718s reason_str = reason_bytes.decode("ascii", errors="ignore") 718s msg = "%d %s" % (connect_response.status, reason_str) 718s await self._connection.aclose() 718s > raise ProxyError(msg) 718s E httpcore.ProxyError: 503 Service Unavailable 718s 718s /usr/lib/python3/dist-packages/httpcore/_async/http_proxy.py:298: ProxyError 718s 718s The above exception was the direct cause of the following exception: 718s 718s @pytest.mark.asyncio 718s async def test_auto_refresh_token(): 718s 718s async def _update_token(token, refresh_token=None, access_token=None): 718s assert refresh_token == 'b' 718s assert token == default_token 718s 718s update_token = mock.Mock(side_effect=_update_token) 718s 718s old_token = dict( 718s access_token='a', refresh_token='b', 718s token_type='bearer', expires_at=100 718s ) 718s 718s app = AsyncMockDispatch(default_token) 718s async with AsyncOAuth2Client( 718s 'foo', token=old_token, token_endpoint='https://i.b/token', 718s update_token=update_token, app=app 718s ) as sess: 718s > await sess.get('https://i.b/user') 718s 718s tests/clients/test_httpx/test_async_oauth2_client.py:324: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/httpx/_client.py:1801: in get 718s return await self.request( 718s /usr/lib/python3/dist-packages/authlib/integrations/httpx_client/oauth2_client.py:86: in request 718s await self.ensure_active_token(self.token) 718s /usr/lib/python3/dist-packages/authlib/integrations/httpx_client/oauth2_client.py:113: in ensure_active_token 718s await self.refresh_token(url, refresh_token=refresh_token) 718s /usr/lib/python3/dist-packages/authlib/integrations/httpx_client/oauth2_client.py:142: in _refresh_token 718s resp = await self.post( 718s /usr/lib/python3/dist-packages/httpx/_client.py:1892: in post 718s return await self.request( 718s /usr/lib/python3/dist-packages/authlib/integrations/httpx_client/oauth2_client.py:90: in request 718s return await super().request( 718s /usr/lib/python3/dist-packages/httpx/_client.py:1574: in request 718s return await self.send(request, auth=auth, follow_redirects=follow_redirects) 718s /usr/lib/python3/dist-packages/httpx/_client.py:1661: in send 718s response = await self._send_handling_auth( 718s /usr/lib/python3/dist-packages/httpx/_client.py:1689: in _send_handling_auth 718s response = await self._send_handling_redirects( 718s /usr/lib/python3/dist-packages/httpx/_client.py:1726: in _send_handling_redirects 718s response = await self._send_single_request(request) 718s /usr/lib/python3/dist-packages/httpx/_client.py:1763: in _send_single_request 718s response = await transport.handle_async_request(request) 718s /usr/lib/python3/dist-packages/httpx/_transports/default.py:372: in handle_async_request 718s with map_httpcore_exceptions(): 718s /usr/lib/python3.12/contextlib.py:158: in __exit__ 718s self.gen.throw(value) 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s @contextlib.contextmanager 718s def map_httpcore_exceptions() -> typing.Iterator[None]: 718s try: 718s yield 718s except Exception as exc: 718s mapped_exc = None 718s 718s for from_exc, to_exc in HTTPCORE_EXC_MAP.items(): 718s if not isinstance(exc, from_exc): 718s continue 718s # We want to map to the most specific exception we can find. 718s # Eg if `exc` is an `httpcore.ReadTimeout`, we want to map to 718s # `httpx.ReadTimeout`, not just `httpx.TimeoutException`. 718s if mapped_exc is None or issubclass(to_exc, mapped_exc): 718s mapped_exc = to_exc 718s 718s if mapped_exc is None: # pragma: no cover 718s raise 718s 718s message = str(exc) 718s > raise mapped_exc(message) from exc 718s E httpx.ProxyError: 503 Service Unavailable 718s 718s /usr/lib/python3/dist-packages/httpx/_transports/default.py:86: ProxyError 718s ___________________________ test_auto_refresh_token2 ___________________________ 718s 718s @contextlib.contextmanager 718s def map_httpcore_exceptions() -> typing.Iterator[None]: 718s try: 718s > yield 718s 718s /usr/lib/python3/dist-packages/httpx/_transports/default.py:69: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/httpx/_transports/default.py:373: in handle_async_request 718s resp = await self._pool.handle_async_request(req) 718s /usr/lib/python3/dist-packages/httpcore/_async/connection_pool.py:216: in handle_async_request 718s raise exc from None 718s /usr/lib/python3/dist-packages/httpcore/_async/connection_pool.py:196: in handle_async_request 718s response = await connection.handle_async_request( 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s self = 718s request = 718s 718s async def handle_async_request(self, request: Request) -> Response: 718s timeouts = request.extensions.get("timeout", {}) 718s timeout = timeouts.get("connect", None) 718s 718s async with self._connect_lock: 718s if not self._connected: 718s target = b"%b:%d" % (self._remote_origin.host, self._remote_origin.port) 718s 718s connect_url = URL( 718s scheme=self._proxy_origin.scheme, 718s host=self._proxy_origin.host, 718s port=self._proxy_origin.port, 718s target=target, 718s ) 718s connect_headers = merge_headers( 718s [(b"Host", target), (b"Accept", b"*/*")], self._proxy_headers 718s ) 718s connect_request = Request( 718s method=b"CONNECT", 718s url=connect_url, 718s headers=connect_headers, 718s extensions=request.extensions, 718s ) 718s connect_response = await self._connection.handle_async_request( 718s connect_request 718s ) 718s 718s if connect_response.status < 200 or connect_response.status > 299: 718s reason_bytes = connect_response.extensions.get("reason_phrase", b"") 718s reason_str = reason_bytes.decode("ascii", errors="ignore") 718s msg = "%d %s" % (connect_response.status, reason_str) 718s await self._connection.aclose() 718s > raise ProxyError(msg) 718s E httpcore.ProxyError: 503 Service Unavailable 718s 718s /usr/lib/python3/dist-packages/httpcore/_async/http_proxy.py:298: ProxyError 718s 718s The above exception was the direct cause of the following exception: 718s 718s @pytest.mark.asyncio 718s async def test_auto_refresh_token2(): 718s 718s async def _update_token(token, refresh_token=None, access_token=None): 718s assert access_token == 'a' 718s assert token == default_token 718s 718s update_token = mock.Mock(side_effect=_update_token) 718s 718s old_token = dict( 718s access_token='a', 718s token_type='bearer', 718s expires_at=100 718s ) 718s 718s app = AsyncMockDispatch(default_token) 718s 718s async with AsyncOAuth2Client( 718s 'foo', token=old_token, 718s token_endpoint='https://i.b/token', 718s grant_type='client_credentials', 718s app=app, 718s ) as client: 718s > await client.get('https://i.b/user') 718s 718s tests/clients/test_httpx/test_async_oauth2_client.py:363: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/httpx/_client.py:1801: in get 718s return await self.request( 718s /usr/lib/python3/dist-packages/authlib/integrations/httpx_client/oauth2_client.py:86: in request 718s await self.ensure_active_token(self.token) 718s /usr/lib/python3/dist-packages/authlib/integrations/httpx_client/oauth2_client.py:116: in ensure_active_token 718s new_token = await self.fetch_token(url, grant_type='client_credentials') 718s /usr/lib/python3/dist-packages/authlib/integrations/httpx_client/oauth2_client.py:125: in _fetch_token 718s resp = await self.post( 718s /usr/lib/python3/dist-packages/httpx/_client.py:1892: in post 718s return await self.request( 718s /usr/lib/python3/dist-packages/authlib/integrations/httpx_client/oauth2_client.py:90: in request 718s return await super().request( 718s /usr/lib/python3/dist-packages/httpx/_client.py:1574: in request 718s return await self.send(request, auth=auth, follow_redirects=follow_redirects) 718s /usr/lib/python3/dist-packages/httpx/_client.py:1661: in send 718s response = await self._send_handling_auth( 718s /usr/lib/python3/dist-packages/httpx/_client.py:1689: in _send_handling_auth 718s response = await self._send_handling_redirects( 718s /usr/lib/python3/dist-packages/httpx/_client.py:1726: in _send_handling_redirects 718s response = await self._send_single_request(request) 718s /usr/lib/python3/dist-packages/httpx/_client.py:1763: in _send_single_request 718s response = await transport.handle_async_request(request) 718s /usr/lib/python3/dist-packages/httpx/_transports/default.py:372: in handle_async_request 718s with map_httpcore_exceptions(): 718s /usr/lib/python3.12/contextlib.py:158: in __exit__ 718s self.gen.throw(value) 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s @contextlib.contextmanager 718s def map_httpcore_exceptions() -> typing.Iterator[None]: 718s try: 718s yield 718s except Exception as exc: 718s mapped_exc = None 718s 718s for from_exc, to_exc in HTTPCORE_EXC_MAP.items(): 718s if not isinstance(exc, from_exc): 718s continue 718s # We want to map to the most specific exception we can find. 718s # Eg if `exc` is an `httpcore.ReadTimeout`, we want to map to 718s # `httpx.ReadTimeout`, not just `httpx.TimeoutException`. 718s if mapped_exc is None or issubclass(to_exc, mapped_exc): 718s mapped_exc = to_exc 718s 718s if mapped_exc is None: # pragma: no cover 718s raise 718s 718s message = str(exc) 718s > raise mapped_exc(message) from exc 718s E httpx.ProxyError: 503 Service Unavailable 718s 718s /usr/lib/python3/dist-packages/httpx/_transports/default.py:86: ProxyError 718s ___________________________ test_auto_refresh_token3 ___________________________ 718s 718s @contextlib.contextmanager 718s def map_httpcore_exceptions() -> typing.Iterator[None]: 718s try: 718s > yield 718s 718s /usr/lib/python3/dist-packages/httpx/_transports/default.py:69: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/httpx/_transports/default.py:373: in handle_async_request 718s resp = await self._pool.handle_async_request(req) 718s /usr/lib/python3/dist-packages/httpcore/_async/connection_pool.py:216: in handle_async_request 718s raise exc from None 718s /usr/lib/python3/dist-packages/httpcore/_async/connection_pool.py:196: in handle_async_request 718s response = await connection.handle_async_request( 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s self = 718s request = 718s 718s async def handle_async_request(self, request: Request) -> Response: 718s timeouts = request.extensions.get("timeout", {}) 718s timeout = timeouts.get("connect", None) 718s 718s async with self._connect_lock: 718s if not self._connected: 718s target = b"%b:%d" % (self._remote_origin.host, self._remote_origin.port) 718s 718s connect_url = URL( 718s scheme=self._proxy_origin.scheme, 718s host=self._proxy_origin.host, 718s port=self._proxy_origin.port, 718s target=target, 718s ) 718s connect_headers = merge_headers( 718s [(b"Host", target), (b"Accept", b"*/*")], self._proxy_headers 718s ) 718s connect_request = Request( 718s method=b"CONNECT", 718s url=connect_url, 718s headers=connect_headers, 718s extensions=request.extensions, 718s ) 718s connect_response = await self._connection.handle_async_request( 718s connect_request 718s ) 718s 718s if connect_response.status < 200 or connect_response.status > 299: 718s reason_bytes = connect_response.extensions.get("reason_phrase", b"") 718s reason_str = reason_bytes.decode("ascii", errors="ignore") 718s msg = "%d %s" % (connect_response.status, reason_str) 718s await self._connection.aclose() 718s > raise ProxyError(msg) 718s E httpcore.ProxyError: 503 Service Unavailable 718s 718s /usr/lib/python3/dist-packages/httpcore/_async/http_proxy.py:298: ProxyError 718s 718s The above exception was the direct cause of the following exception: 718s 718s @pytest.mark.asyncio 718s async def test_auto_refresh_token3(): 718s async def _update_token(token, refresh_token=None, access_token=None): 718s assert access_token == 'a' 718s assert token == default_token 718s 718s update_token = mock.Mock(side_effect=_update_token) 718s 718s old_token = dict( 718s access_token='a', 718s token_type='bearer', 718s expires_at=100 718s ) 718s 718s app = AsyncMockDispatch(default_token) 718s 718s async with AsyncOAuth2Client( 718s 'foo', token=old_token, token_endpoint='https://i.b/token', 718s update_token=update_token, grant_type='client_credentials', 718s app=app, 718s ) as client: 718s > await client.post('https://i.b/user', json={'foo': 'bar'}) 718s 718s tests/clients/test_httpx/test_async_oauth2_client.py:396: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/httpx/_client.py:1892: in post 718s return await self.request( 718s /usr/lib/python3/dist-packages/authlib/integrations/httpx_client/oauth2_client.py:86: in request 718s await self.ensure_active_token(self.token) 718s /usr/lib/python3/dist-packages/authlib/integrations/httpx_client/oauth2_client.py:116: in ensure_active_token 718s new_token = await self.fetch_token(url, grant_type='client_credentials') 718s /usr/lib/python3/dist-packages/authlib/integrations/httpx_client/oauth2_client.py:125: in _fetch_token 718s resp = await self.post( 718s /usr/lib/python3/dist-packages/httpx/_client.py:1892: in post 718s return await self.request( 718s /usr/lib/python3/dist-packages/authlib/integrations/httpx_client/oauth2_client.py:90: in request 718s return await super().request( 718s /usr/lib/python3/dist-packages/httpx/_client.py:1574: in request 718s return await self.send(request, auth=auth, follow_redirects=follow_redirects) 718s /usr/lib/python3/dist-packages/httpx/_client.py:1661: in send 718s response = await self._send_handling_auth( 718s /usr/lib/python3/dist-packages/httpx/_client.py:1689: in _send_handling_auth 718s response = await self._send_handling_redirects( 718s /usr/lib/python3/dist-packages/httpx/_client.py:1726: in _send_handling_redirects 718s response = await self._send_single_request(request) 718s /usr/lib/python3/dist-packages/httpx/_client.py:1763: in _send_single_request 718s response = await transport.handle_async_request(request) 718s /usr/lib/python3/dist-packages/httpx/_transports/default.py:372: in handle_async_request 718s with map_httpcore_exceptions(): 718s /usr/lib/python3.12/contextlib.py:158: in __exit__ 718s self.gen.throw(value) 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s @contextlib.contextmanager 718s def map_httpcore_exceptions() -> typing.Iterator[None]: 718s try: 718s yield 718s except Exception as exc: 718s mapped_exc = None 718s 718s for from_exc, to_exc in HTTPCORE_EXC_MAP.items(): 718s if not isinstance(exc, from_exc): 718s continue 718s # We want to map to the most specific exception we can find. 718s # Eg if `exc` is an `httpcore.ReadTimeout`, we want to map to 718s # `httpx.ReadTimeout`, not just `httpx.TimeoutException`. 718s if mapped_exc is None or issubclass(to_exc, mapped_exc): 718s mapped_exc = to_exc 718s 718s if mapped_exc is None: # pragma: no cover 718s raise 718s 718s message = str(exc) 718s > raise mapped_exc(message) from exc 718s E httpx.ProxyError: 503 Service Unavailable 718s 718s /usr/lib/python3/dist-packages/httpx/_transports/default.py:86: ProxyError 718s ___________________________ test_auto_refresh_token4 ___________________________ 718s 718s @contextlib.contextmanager 718s def map_httpcore_exceptions() -> typing.Iterator[None]: 718s try: 718s > yield 718s 718s /usr/lib/python3/dist-packages/httpx/_transports/default.py:69: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/httpx/_transports/default.py:373: in handle_async_request 718s resp = await self._pool.handle_async_request(req) 718s /usr/lib/python3/dist-packages/httpcore/_async/connection_pool.py:216: in handle_async_request 718s raise exc from None 718s /usr/lib/python3/dist-packages/httpcore/_async/connection_pool.py:196: in handle_async_request 718s response = await connection.handle_async_request( 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s self = 718s request = 718s 718s async def handle_async_request(self, request: Request) -> Response: 718s timeouts = request.extensions.get("timeout", {}) 718s timeout = timeouts.get("connect", None) 718s 718s async with self._connect_lock: 718s if not self._connected: 718s target = b"%b:%d" % (self._remote_origin.host, self._remote_origin.port) 718s 718s connect_url = URL( 718s scheme=self._proxy_origin.scheme, 718s host=self._proxy_origin.host, 718s port=self._proxy_origin.port, 718s target=target, 718s ) 718s connect_headers = merge_headers( 718s [(b"Host", target), (b"Accept", b"*/*")], self._proxy_headers 718s ) 718s connect_request = Request( 718s method=b"CONNECT", 718s url=connect_url, 718s headers=connect_headers, 718s extensions=request.extensions, 718s ) 718s connect_response = await self._connection.handle_async_request( 718s connect_request 718s ) 718s 718s if connect_response.status < 200 or connect_response.status > 299: 718s reason_bytes = connect_response.extensions.get("reason_phrase", b"") 718s reason_str = reason_bytes.decode("ascii", errors="ignore") 718s msg = "%d %s" % (connect_response.status, reason_str) 718s await self._connection.aclose() 718s > raise ProxyError(msg) 718s E httpcore.ProxyError: 503 Service Unavailable 718s 718s /usr/lib/python3/dist-packages/httpcore/_async/http_proxy.py:298: ProxyError 718s 718s The above exception was the direct cause of the following exception: 718s 718s @pytest.mark.asyncio 718s async def test_auto_refresh_token4(): 718s async def _update_token(token, refresh_token=None, access_token=None): 718s # This test only makes sense if the expired token is refreshed 718s token["expires_at"] = int(time.time()) + 3600 718s # artificial sleep to force other coroutines to wake 718s await asyncio.sleep(0.1) 718s 718s update_token = mock.Mock(side_effect=_update_token) 718s 718s old_token = dict( 718s access_token='old', 718s token_type='bearer', 718s expires_at=100 718s ) 718s 718s app = AsyncMockDispatch(default_token) 718s 718s async with AsyncOAuth2Client( 718s 'foo', token=old_token, token_endpoint='https://i.b/token', 718s update_token=update_token, grant_type='client_credentials', 718s app=app, 718s ) as client: 718s coroutines = [client.get('https://i.b/user') for x in range(10)] 718s > await asyncio.gather(*coroutines) 718s 718s tests/clients/test_httpx/test_async_oauth2_client.py:423: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/httpx/_client.py:1801: in get 718s return await self.request( 718s /usr/lib/python3/dist-packages/authlib/integrations/httpx_client/oauth2_client.py:86: in request 718s await self.ensure_active_token(self.token) 718s /usr/lib/python3/dist-packages/authlib/integrations/httpx_client/oauth2_client.py:116: in ensure_active_token 718s new_token = await self.fetch_token(url, grant_type='client_credentials') 718s /usr/lib/python3/dist-packages/authlib/integrations/httpx_client/oauth2_client.py:125: in _fetch_token 718s resp = await self.post( 718s /usr/lib/python3/dist-packages/httpx/_client.py:1892: in post 718s return await self.request( 718s /usr/lib/python3/dist-packages/authlib/integrations/httpx_client/oauth2_client.py:90: in request 718s return await super().request( 718s /usr/lib/python3/dist-packages/httpx/_client.py:1574: in request 718s return await self.send(request, auth=auth, follow_redirects=follow_redirects) 718s /usr/lib/python3/dist-packages/httpx/_client.py:1661: in send 718s response = await self._send_handling_auth( 718s /usr/lib/python3/dist-packages/httpx/_client.py:1689: in _send_handling_auth 718s response = await self._send_handling_redirects( 718s /usr/lib/python3/dist-packages/httpx/_client.py:1726: in _send_handling_redirects 718s response = await self._send_single_request(request) 718s /usr/lib/python3/dist-packages/httpx/_client.py:1763: in _send_single_request 718s response = await transport.handle_async_request(request) 718s /usr/lib/python3/dist-packages/httpx/_transports/default.py:372: in handle_async_request 718s with map_httpcore_exceptions(): 718s /usr/lib/python3.12/contextlib.py:158: in __exit__ 718s self.gen.throw(value) 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s @contextlib.contextmanager 718s def map_httpcore_exceptions() -> typing.Iterator[None]: 718s try: 718s yield 718s except Exception as exc: 718s mapped_exc = None 718s 718s for from_exc, to_exc in HTTPCORE_EXC_MAP.items(): 718s if not isinstance(exc, from_exc): 718s continue 718s # We want to map to the most specific exception we can find. 718s # Eg if `exc` is an `httpcore.ReadTimeout`, we want to map to 718s # `httpx.ReadTimeout`, not just `httpx.TimeoutException`. 718s if mapped_exc is None or issubclass(to_exc, mapped_exc): 718s mapped_exc = to_exc 718s 718s if mapped_exc is None: # pragma: no cover 718s raise 718s 718s message = str(exc) 718s > raise mapped_exc(message) from exc 718s E httpx.ProxyError: 503 Service Unavailable 718s 718s /usr/lib/python3/dist-packages/httpx/_transports/default.py:86: ProxyError 718s ______________________________ test_revoke_token _______________________________ 718s 718s @contextlib.contextmanager 718s def map_httpcore_exceptions() -> typing.Iterator[None]: 718s try: 718s > yield 718s 718s /usr/lib/python3/dist-packages/httpx/_transports/default.py:69: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/httpx/_transports/default.py:373: in handle_async_request 718s resp = await self._pool.handle_async_request(req) 718s /usr/lib/python3/dist-packages/httpcore/_async/connection_pool.py:216: in handle_async_request 718s raise exc from None 718s /usr/lib/python3/dist-packages/httpcore/_async/connection_pool.py:196: in handle_async_request 718s response = await connection.handle_async_request( 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s self = 718s request = 718s 718s async def handle_async_request(self, request: Request) -> Response: 718s timeouts = request.extensions.get("timeout", {}) 718s timeout = timeouts.get("connect", None) 718s 718s async with self._connect_lock: 718s if not self._connected: 718s target = b"%b:%d" % (self._remote_origin.host, self._remote_origin.port) 718s 718s connect_url = URL( 718s scheme=self._proxy_origin.scheme, 718s host=self._proxy_origin.host, 718s port=self._proxy_origin.port, 718s target=target, 718s ) 718s connect_headers = merge_headers( 718s [(b"Host", target), (b"Accept", b"*/*")], self._proxy_headers 718s ) 718s connect_request = Request( 718s method=b"CONNECT", 718s url=connect_url, 718s headers=connect_headers, 718s extensions=request.extensions, 718s ) 718s connect_response = await self._connection.handle_async_request( 718s connect_request 718s ) 718s 718s if connect_response.status < 200 or connect_response.status > 299: 718s reason_bytes = connect_response.extensions.get("reason_phrase", b"") 718s reason_str = reason_bytes.decode("ascii", errors="ignore") 718s msg = "%d %s" % (connect_response.status, reason_str) 718s await self._connection.aclose() 718s > raise ProxyError(msg) 718s E httpcore.ProxyError: 503 Service Unavailable 718s 718s /usr/lib/python3/dist-packages/httpcore/_async/http_proxy.py:298: ProxyError 718s 718s The above exception was the direct cause of the following exception: 718s 718s @pytest.mark.asyncio 718s async def test_revoke_token(): 718s answer = {'status': 'ok'} 718s app = AsyncMockDispatch(answer) 718s 718s async with AsyncOAuth2Client('a', app=app) as sess: 718s > resp = await sess.revoke_token('https://i.b/token', 'hi') 718s 718s tests/clients/test_httpx/test_async_oauth2_client.py:432: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/httpx/_client.py:1892: in post 718s return await self.request( 718s /usr/lib/python3/dist-packages/authlib/integrations/httpx_client/oauth2_client.py:90: in request 718s return await super().request( 718s /usr/lib/python3/dist-packages/httpx/_client.py:1574: in request 718s return await self.send(request, auth=auth, follow_redirects=follow_redirects) 718s /usr/lib/python3/dist-packages/httpx/_client.py:1661: in send 718s response = await self._send_handling_auth( 718s /usr/lib/python3/dist-packages/httpx/_client.py:1689: in _send_handling_auth 718s response = await self._send_handling_redirects( 718s /usr/lib/python3/dist-packages/httpx/_client.py:1726: in _send_handling_redirects 718s response = await self._send_single_request(request) 718s /usr/lib/python3/dist-packages/httpx/_client.py:1763: in _send_single_request 718s response = await transport.handle_async_request(request) 718s /usr/lib/python3/dist-packages/httpx/_transports/default.py:372: in handle_async_request 718s with map_httpcore_exceptions(): 718s /usr/lib/python3.12/contextlib.py:158: in __exit__ 718s self.gen.throw(value) 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s @contextlib.contextmanager 718s def map_httpcore_exceptions() -> typing.Iterator[None]: 718s try: 718s yield 718s except Exception as exc: 718s mapped_exc = None 718s 718s for from_exc, to_exc in HTTPCORE_EXC_MAP.items(): 718s if not isinstance(exc, from_exc): 718s continue 718s # We want to map to the most specific exception we can find. 718s # Eg if `exc` is an `httpcore.ReadTimeout`, we want to map to 718s # `httpx.ReadTimeout`, not just `httpx.TimeoutException`. 718s if mapped_exc is None or issubclass(to_exc, mapped_exc): 718s mapped_exc = to_exc 718s 718s if mapped_exc is None: # pragma: no cover 718s raise 718s 718s message = str(exc) 718s > raise mapped_exc(message) from exc 718s E httpx.ProxyError: 503 Service Unavailable 718s 718s /usr/lib/python3/dist-packages/httpx/_transports/default.py:86: ProxyError 718s ____________________________ test_oauth1_authorize _____________________________ 718s 718s @contextlib.contextmanager 718s def map_httpcore_exceptions() -> typing.Iterator[None]: 718s try: 718s > yield 718s 718s /usr/lib/python3/dist-packages/httpx/_transports/default.py:69: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/httpx/_transports/default.py:373: in handle_async_request 718s resp = await self._pool.handle_async_request(req) 718s /usr/lib/python3/dist-packages/httpcore/_async/connection_pool.py:216: in handle_async_request 718s raise exc from None 718s /usr/lib/python3/dist-packages/httpcore/_async/connection_pool.py:196: in handle_async_request 718s response = await connection.handle_async_request( 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s self = 718s request = 718s 718s async def handle_async_request(self, request: Request) -> Response: 718s timeouts = request.extensions.get("timeout", {}) 718s timeout = timeouts.get("connect", None) 718s 718s async with self._connect_lock: 718s if not self._connected: 718s target = b"%b:%d" % (self._remote_origin.host, self._remote_origin.port) 718s 718s connect_url = URL( 718s scheme=self._proxy_origin.scheme, 718s host=self._proxy_origin.host, 718s port=self._proxy_origin.port, 718s target=target, 718s ) 718s connect_headers = merge_headers( 718s [(b"Host", target), (b"Accept", b"*/*")], self._proxy_headers 718s ) 718s connect_request = Request( 718s method=b"CONNECT", 718s url=connect_url, 718s headers=connect_headers, 718s extensions=request.extensions, 718s ) 718s connect_response = await self._connection.handle_async_request( 718s connect_request 718s ) 718s 718s if connect_response.status < 200 or connect_response.status > 299: 718s reason_bytes = connect_response.extensions.get("reason_phrase", b"") 718s reason_str = reason_bytes.decode("ascii", errors="ignore") 718s msg = "%d %s" % (connect_response.status, reason_str) 718s await self._connection.aclose() 718s > raise ProxyError(msg) 718s E httpcore.ProxyError: 503 Service Unavailable 718s 718s /usr/lib/python3/dist-packages/httpcore/_async/http_proxy.py:298: ProxyError 718s 718s The above exception was the direct cause of the following exception: 718s 718s @pytest.mark.asyncio 718s async def test_oauth1_authorize(): 718s oauth = OAuth() 718s app = AsyncPathMapDispatch({ 718s '/request-token': {'body': 'oauth_token=foo&oauth_verifier=baz'}, 718s '/token': {'body': 'oauth_token=a&oauth_token_secret=b'}, 718s }) 718s client = oauth.register( 718s 'dev', 718s client_id='dev', 718s client_secret='dev', 718s request_token_url='https://i.b/request-token', 718s api_base_url='https://i.b/api', 718s access_token_url='https://i.b/token', 718s authorize_url='https://i.b/authorize', 718s client_kwargs={ 718s 'app': app, 718s } 718s ) 718s 718s req_scope = {'type': 'http', 'session': {}} 718s req = Request(req_scope) 718s > resp = await client.authorize_redirect(req, 'https://b.com/bar') 718s 718s tests/clients/test_starlette/test_oauth_client.py:62: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/authlib/integrations/starlette_client/apps.py:34: in authorize_redirect 718s rv = await self.create_authorization_url(redirect_uri, **kwargs) 718s /usr/lib/python3/dist-packages/authlib/integrations/base_client/async_app.py:38: in create_authorization_url 718s request_token = await client.fetch_request_token(self.request_token_url, **params) 718s /usr/lib/python3/dist-packages/authlib/integrations/httpx_client/oauth1_client.py:68: in _fetch_token 718s resp = await self.post(url, **kwargs) 718s /usr/lib/python3/dist-packages/httpx/_client.py:1892: in post 718s return await self.request( 718s /usr/lib/python3/dist-packages/httpx/_client.py:1574: in request 718s return await self.send(request, auth=auth, follow_redirects=follow_redirects) 718s /usr/lib/python3/dist-packages/httpx/_client.py:1661: in send 718s response = await self._send_handling_auth( 718s /usr/lib/python3/dist-packages/httpx/_client.py:1689: in _send_handling_auth 718s response = await self._send_handling_redirects( 718s /usr/lib/python3/dist-packages/httpx/_client.py:1726: in _send_handling_redirects 718s response = await self._send_single_request(request) 718s /usr/lib/python3/dist-packages/httpx/_client.py:1763: in _send_single_request 718s response = await transport.handle_async_request(request) 718s /usr/lib/python3/dist-packages/httpx/_transports/default.py:372: in handle_async_request 718s with map_httpcore_exceptions(): 718s /usr/lib/python3.12/contextlib.py:158: in __exit__ 718s self.gen.throw(value) 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s @contextlib.contextmanager 718s def map_httpcore_exceptions() -> typing.Iterator[None]: 718s try: 718s yield 718s except Exception as exc: 718s mapped_exc = None 718s 718s for from_exc, to_exc in HTTPCORE_EXC_MAP.items(): 718s if not isinstance(exc, from_exc): 718s continue 718s # We want to map to the most specific exception we can find. 718s # Eg if `exc` is an `httpcore.ReadTimeout`, we want to map to 718s # `httpx.ReadTimeout`, not just `httpx.TimeoutException`. 718s if mapped_exc is None or issubclass(to_exc, mapped_exc): 718s mapped_exc = to_exc 718s 718s if mapped_exc is None: # pragma: no cover 718s raise 718s 718s message = str(exc) 718s > raise mapped_exc(message) from exc 718s E httpx.ProxyError: 503 Service Unavailable 718s 718s /usr/lib/python3/dist-packages/httpx/_transports/default.py:86: ProxyError 718s ____________________________ test_oauth2_authorize _____________________________ 718s 718s @contextlib.contextmanager 718s def map_httpcore_exceptions() -> typing.Iterator[None]: 718s try: 718s > yield 718s 718s /usr/lib/python3/dist-packages/httpx/_transports/default.py:69: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/httpx/_transports/default.py:373: in handle_async_request 718s resp = await self._pool.handle_async_request(req) 718s /usr/lib/python3/dist-packages/httpcore/_async/connection_pool.py:216: in handle_async_request 718s raise exc from None 718s /usr/lib/python3/dist-packages/httpcore/_async/connection_pool.py:196: in handle_async_request 718s response = await connection.handle_async_request( 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s self = 718s request = 718s 718s async def handle_async_request(self, request: Request) -> Response: 718s timeouts = request.extensions.get("timeout", {}) 718s timeout = timeouts.get("connect", None) 718s 718s async with self._connect_lock: 718s if not self._connected: 718s target = b"%b:%d" % (self._remote_origin.host, self._remote_origin.port) 718s 718s connect_url = URL( 718s scheme=self._proxy_origin.scheme, 718s host=self._proxy_origin.host, 718s port=self._proxy_origin.port, 718s target=target, 718s ) 718s connect_headers = merge_headers( 718s [(b"Host", target), (b"Accept", b"*/*")], self._proxy_headers 718s ) 718s connect_request = Request( 718s method=b"CONNECT", 718s url=connect_url, 718s headers=connect_headers, 718s extensions=request.extensions, 718s ) 718s connect_response = await self._connection.handle_async_request( 718s connect_request 718s ) 718s 718s if connect_response.status < 200 or connect_response.status > 299: 718s reason_bytes = connect_response.extensions.get("reason_phrase", b"") 718s reason_str = reason_bytes.decode("ascii", errors="ignore") 718s msg = "%d %s" % (connect_response.status, reason_str) 718s await self._connection.aclose() 718s > raise ProxyError(msg) 718s E httpcore.ProxyError: 503 Service Unavailable 718s 718s /usr/lib/python3/dist-packages/httpcore/_async/http_proxy.py:298: ProxyError 718s 718s The above exception was the direct cause of the following exception: 718s 718s @pytest.mark.asyncio 718s async def test_oauth2_authorize(): 718s oauth = OAuth() 718s app = AsyncPathMapDispatch({ 718s '/token': {'body': get_bearer_token()} 718s }) 718s client = oauth.register( 718s 'dev', 718s client_id='dev', 718s client_secret='dev', 718s api_base_url='https://i.b/api', 718s access_token_url='https://i.b/token', 718s authorize_url='https://i.b/authorize', 718s client_kwargs={ 718s 'app': app, 718s } 718s ) 718s 718s req_scope = {'type': 'http', 'session': {}} 718s req = Request(req_scope) 718s resp = await client.authorize_redirect(req, 'https://b.com/bar') 718s assert resp.status_code == 302 718s url = resp.headers.get('Location') 718s assert 'state=' in url 718s state = dict(url_decode(urlparse.urlparse(url).query))['state'] 718s 718s assert f'_state_dev_{state}' in req.session 718s 718s req_scope.update( 718s { 718s 'path': '/', 718s 'query_string': f'code=a&state={state}', 718s 'session': req.session, 718s } 718s ) 718s req = Request(req_scope) 718s > token = await client.authorize_access_token(req) 718s 718s tests/clients/test_starlette/test_oauth_client.py:108: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/authlib/integrations/starlette_client/apps.py:81: in authorize_access_token 718s token = await self.fetch_access_token(**params, **kwargs) 718s /usr/lib/python3/dist-packages/authlib/integrations/base_client/async_app.py:125: in fetch_access_token 718s token = await client.fetch_token(token_endpoint, **params) 718s /usr/lib/python3/dist-packages/authlib/integrations/httpx_client/oauth2_client.py:125: in _fetch_token 718s resp = await self.post( 718s /usr/lib/python3/dist-packages/httpx/_client.py:1892: in post 718s return await self.request( 718s /usr/lib/python3/dist-packages/authlib/integrations/httpx_client/oauth2_client.py:90: in request 718s return await super().request( 718s /usr/lib/python3/dist-packages/httpx/_client.py:1574: in request 718s return await self.send(request, auth=auth, follow_redirects=follow_redirects) 718s /usr/lib/python3/dist-packages/httpx/_client.py:1661: in send 718s response = await self._send_handling_auth( 718s /usr/lib/python3/dist-packages/httpx/_client.py:1689: in _send_handling_auth 718s response = await self._send_handling_redirects( 718s /usr/lib/python3/dist-packages/httpx/_client.py:1726: in _send_handling_redirects 718s response = await self._send_single_request(request) 718s /usr/lib/python3/dist-packages/httpx/_client.py:1763: in _send_single_request 718s response = await transport.handle_async_request(request) 718s /usr/lib/python3/dist-packages/httpx/_transports/default.py:372: in handle_async_request 718s with map_httpcore_exceptions(): 718s /usr/lib/python3.12/contextlib.py:158: in __exit__ 718s self.gen.throw(value) 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s @contextlib.contextmanager 718s def map_httpcore_exceptions() -> typing.Iterator[None]: 718s try: 718s yield 718s except Exception as exc: 718s mapped_exc = None 718s 718s for from_exc, to_exc in HTTPCORE_EXC_MAP.items(): 718s if not isinstance(exc, from_exc): 718s continue 718s # We want to map to the most specific exception we can find. 718s # Eg if `exc` is an `httpcore.ReadTimeout`, we want to map to 718s # `httpx.ReadTimeout`, not just `httpx.TimeoutException`. 718s if mapped_exc is None or issubclass(to_exc, mapped_exc): 718s mapped_exc = to_exc 718s 718s if mapped_exc is None: # pragma: no cover 718s raise 718s 718s message = str(exc) 718s > raise mapped_exc(message) from exc 718s E httpx.ProxyError: 503 Service Unavailable 718s 718s /usr/lib/python3/dist-packages/httpx/_transports/default.py:86: ProxyError 718s _____________________ test_oauth2_authorize_code_challenge _____________________ 718s 718s @contextlib.contextmanager 718s def map_httpcore_exceptions() -> typing.Iterator[None]: 718s try: 718s > yield 718s 718s /usr/lib/python3/dist-packages/httpx/_transports/default.py:69: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/httpx/_transports/default.py:373: in handle_async_request 718s resp = await self._pool.handle_async_request(req) 718s /usr/lib/python3/dist-packages/httpcore/_async/connection_pool.py:216: in handle_async_request 718s raise exc from None 718s /usr/lib/python3/dist-packages/httpcore/_async/connection_pool.py:196: in handle_async_request 718s response = await connection.handle_async_request( 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s self = 718s request = 718s 718s async def handle_async_request(self, request: Request) -> Response: 718s timeouts = request.extensions.get("timeout", {}) 718s timeout = timeouts.get("connect", None) 718s 718s async with self._connect_lock: 718s if not self._connected: 718s target = b"%b:%d" % (self._remote_origin.host, self._remote_origin.port) 718s 718s connect_url = URL( 718s scheme=self._proxy_origin.scheme, 718s host=self._proxy_origin.host, 718s port=self._proxy_origin.port, 718s target=target, 718s ) 718s connect_headers = merge_headers( 718s [(b"Host", target), (b"Accept", b"*/*")], self._proxy_headers 718s ) 718s connect_request = Request( 718s method=b"CONNECT", 718s url=connect_url, 718s headers=connect_headers, 718s extensions=request.extensions, 718s ) 718s connect_response = await self._connection.handle_async_request( 718s connect_request 718s ) 718s 718s if connect_response.status < 200 or connect_response.status > 299: 718s reason_bytes = connect_response.extensions.get("reason_phrase", b"") 718s reason_str = reason_bytes.decode("ascii", errors="ignore") 718s msg = "%d %s" % (connect_response.status, reason_str) 718s await self._connection.aclose() 718s > raise ProxyError(msg) 718s E httpcore.ProxyError: 503 Service Unavailable 718s 718s /usr/lib/python3/dist-packages/httpcore/_async/http_proxy.py:298: ProxyError 718s 718s The above exception was the direct cause of the following exception: 718s 718s @pytest.mark.asyncio 718s async def test_oauth2_authorize_code_challenge(): 718s app = AsyncPathMapDispatch({ 718s '/token': {'body': get_bearer_token()} 718s }) 718s oauth = OAuth() 718s client = oauth.register( 718s 'dev', 718s client_id='dev', 718s api_base_url='https://i.b/api', 718s access_token_url='https://i.b/token', 718s authorize_url='https://i.b/authorize', 718s client_kwargs={ 718s 'code_challenge_method': 'S256', 718s 'app': app, 718s }, 718s ) 718s 718s req_scope = {'type': 'http', 'session': {}} 718s req = Request(req_scope) 718s 718s resp = await client.authorize_redirect(req, redirect_uri='https://b.com/bar') 718s assert resp.status_code == 302 718s 718s url = resp.headers.get('Location') 718s assert 'code_challenge=' in url 718s assert 'code_challenge_method=S256' in url 718s 718s state = dict(url_decode(urlparse.urlparse(url).query))['state'] 718s state_data = req.session[f'_state_dev_{state}']['data'] 718s 718s verifier = state_data['code_verifier'] 718s assert verifier is not None 718s 718s req_scope.update( 718s { 718s 'path': '/', 718s 'query_string': f'code=a&state={state}'.encode(), 718s 'session': req.session, 718s } 718s ) 718s req = Request(req_scope) 718s 718s > token = await client.authorize_access_token(req) 718s 718s tests/clients/test_starlette/test_oauth_client.py:183: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/authlib/integrations/starlette_client/apps.py:81: in authorize_access_token 718s token = await self.fetch_access_token(**params, **kwargs) 718s /usr/lib/python3/dist-packages/authlib/integrations/base_client/async_app.py:125: in fetch_access_token 718s token = await client.fetch_token(token_endpoint, **params) 718s /usr/lib/python3/dist-packages/authlib/integrations/httpx_client/oauth2_client.py:125: in _fetch_token 718s resp = await self.post( 718s /usr/lib/python3/dist-packages/httpx/_client.py:1892: in post 718s return await self.request( 718s /usr/lib/python3/dist-packages/authlib/integrations/httpx_client/oauth2_client.py:90: in request 718s return await super().request( 718s /usr/lib/python3/dist-packages/httpx/_client.py:1574: in request 718s return await self.send(request, auth=auth, follow_redirects=follow_redirects) 718s /usr/lib/python3/dist-packages/httpx/_client.py:1661: in send 718s response = await self._send_handling_auth( 718s /usr/lib/python3/dist-packages/httpx/_client.py:1689: in _send_handling_auth 718s response = await self._send_handling_redirects( 718s /usr/lib/python3/dist-packages/httpx/_client.py:1726: in _send_handling_redirects 718s response = await self._send_single_request(request) 718s /usr/lib/python3/dist-packages/httpx/_client.py:1763: in _send_single_request 718s response = await transport.handle_async_request(request) 718s /usr/lib/python3/dist-packages/httpx/_transports/default.py:372: in handle_async_request 718s with map_httpcore_exceptions(): 718s /usr/lib/python3.12/contextlib.py:158: in __exit__ 718s self.gen.throw(value) 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s @contextlib.contextmanager 718s def map_httpcore_exceptions() -> typing.Iterator[None]: 718s try: 718s yield 718s except Exception as exc: 718s mapped_exc = None 718s 718s for from_exc, to_exc in HTTPCORE_EXC_MAP.items(): 718s if not isinstance(exc, from_exc): 718s continue 718s # We want to map to the most specific exception we can find. 718s # Eg if `exc` is an `httpcore.ReadTimeout`, we want to map to 718s # `httpx.ReadTimeout`, not just `httpx.TimeoutException`. 718s if mapped_exc is None or issubclass(to_exc, mapped_exc): 718s mapped_exc = to_exc 718s 718s if mapped_exc is None: # pragma: no cover 718s raise 718s 718s message = str(exc) 718s > raise mapped_exc(message) from exc 718s E httpx.ProxyError: 503 Service Unavailable 718s 718s /usr/lib/python3/dist-packages/httpx/_transports/default.py:86: ProxyError 718s ______________________ test_with_fetch_token_in_register _______________________ 718s 718s @contextlib.contextmanager 718s def map_httpcore_exceptions() -> typing.Iterator[None]: 718s try: 718s > yield 718s 718s /usr/lib/python3/dist-packages/httpx/_transports/default.py:69: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/httpx/_transports/default.py:373: in handle_async_request 718s resp = await self._pool.handle_async_request(req) 718s /usr/lib/python3/dist-packages/httpcore/_async/connection_pool.py:216: in handle_async_request 718s raise exc from None 718s /usr/lib/python3/dist-packages/httpcore/_async/connection_pool.py:196: in handle_async_request 718s response = await connection.handle_async_request( 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s self = 718s request = 718s 718s async def handle_async_request(self, request: Request) -> Response: 718s timeouts = request.extensions.get("timeout", {}) 718s timeout = timeouts.get("connect", None) 718s 718s async with self._connect_lock: 718s if not self._connected: 718s target = b"%b:%d" % (self._remote_origin.host, self._remote_origin.port) 718s 718s connect_url = URL( 718s scheme=self._proxy_origin.scheme, 718s host=self._proxy_origin.host, 718s port=self._proxy_origin.port, 718s target=target, 718s ) 718s connect_headers = merge_headers( 718s [(b"Host", target), (b"Accept", b"*/*")], self._proxy_headers 718s ) 718s connect_request = Request( 718s method=b"CONNECT", 718s url=connect_url, 718s headers=connect_headers, 718s extensions=request.extensions, 718s ) 718s connect_response = await self._connection.handle_async_request( 718s connect_request 718s ) 718s 718s if connect_response.status < 200 or connect_response.status > 299: 718s reason_bytes = connect_response.extensions.get("reason_phrase", b"") 718s reason_str = reason_bytes.decode("ascii", errors="ignore") 718s msg = "%d %s" % (connect_response.status, reason_str) 718s await self._connection.aclose() 718s > raise ProxyError(msg) 718s E httpcore.ProxyError: 503 Service Unavailable 718s 718s /usr/lib/python3/dist-packages/httpcore/_async/http_proxy.py:298: ProxyError 718s 718s The above exception was the direct cause of the following exception: 718s 718s @pytest.mark.asyncio 718s async def test_with_fetch_token_in_register(): 718s async def fetch_token(request): 718s return {'access_token': 'dev', 'token_type': 'bearer'} 718s 718s app = AsyncPathMapDispatch({ 718s '/user': {'body': {'sub': '123'}} 718s }) 718s oauth = OAuth() 718s client = oauth.register( 718s 'dev', 718s client_id='dev', 718s client_secret='dev', 718s api_base_url='https://i.b/api', 718s access_token_url='https://i.b/token', 718s authorize_url='https://i.b/authorize', 718s fetch_token=fetch_token, 718s client_kwargs={ 718s 'app': app, 718s } 718s ) 718s 718s req_scope = {'type': 'http', 'session': {}} 718s req = Request(req_scope) 718s > resp = await client.get('/user', request=req) 718s 718s tests/clients/test_starlette/test_oauth_client.py:211: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/authlib/integrations/base_client/async_app.py:86: in request 718s return await _http_request(self, session, method, url, token, kwargs) 718s /usr/lib/python3/dist-packages/authlib/integrations/base_client/async_app.py:144: in _http_request 718s return await session.request(method, url, **kwargs) 718s /usr/lib/python3/dist-packages/authlib/integrations/httpx_client/oauth2_client.py:90: in request 718s return await super().request( 718s /usr/lib/python3/dist-packages/httpx/_client.py:1574: in request 718s return await self.send(request, auth=auth, follow_redirects=follow_redirects) 718s /usr/lib/python3/dist-packages/httpx/_client.py:1661: in send 718s response = await self._send_handling_auth( 718s /usr/lib/python3/dist-packages/httpx/_client.py:1689: in _send_handling_auth 718s response = await self._send_handling_redirects( 718s /usr/lib/python3/dist-packages/httpx/_client.py:1726: in _send_handling_redirects 718s response = await self._send_single_request(request) 718s /usr/lib/python3/dist-packages/httpx/_client.py:1763: in _send_single_request 718s response = await transport.handle_async_request(request) 718s /usr/lib/python3/dist-packages/httpx/_transports/default.py:372: in handle_async_request 718s with map_httpcore_exceptions(): 718s /usr/lib/python3.12/contextlib.py:158: in __exit__ 718s self.gen.throw(value) 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s @contextlib.contextmanager 718s def map_httpcore_exceptions() -> typing.Iterator[None]: 718s try: 718s yield 718s except Exception as exc: 718s mapped_exc = None 718s 718s for from_exc, to_exc in HTTPCORE_EXC_MAP.items(): 718s if not isinstance(exc, from_exc): 718s continue 718s # We want to map to the most specific exception we can find. 718s # Eg if `exc` is an `httpcore.ReadTimeout`, we want to map to 718s # `httpx.ReadTimeout`, not just `httpx.TimeoutException`. 718s if mapped_exc is None or issubclass(to_exc, mapped_exc): 718s mapped_exc = to_exc 718s 718s if mapped_exc is None: # pragma: no cover 718s raise 718s 718s message = str(exc) 718s > raise mapped_exc(message) from exc 718s E httpx.ProxyError: 503 Service Unavailable 718s 718s /usr/lib/python3/dist-packages/httpx/_transports/default.py:86: ProxyError 718s ________________________ test_with_fetch_token_in_oauth ________________________ 718s 718s @contextlib.contextmanager 718s def map_httpcore_exceptions() -> typing.Iterator[None]: 718s try: 718s > yield 718s 718s /usr/lib/python3/dist-packages/httpx/_transports/default.py:69: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/httpx/_transports/default.py:373: in handle_async_request 718s resp = await self._pool.handle_async_request(req) 718s /usr/lib/python3/dist-packages/httpcore/_async/connection_pool.py:216: in handle_async_request 718s raise exc from None 718s /usr/lib/python3/dist-packages/httpcore/_async/connection_pool.py:196: in handle_async_request 718s response = await connection.handle_async_request( 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s self = 718s request = 718s 718s async def handle_async_request(self, request: Request) -> Response: 718s timeouts = request.extensions.get("timeout", {}) 718s timeout = timeouts.get("connect", None) 718s 718s async with self._connect_lock: 718s if not self._connected: 718s target = b"%b:%d" % (self._remote_origin.host, self._remote_origin.port) 718s 718s connect_url = URL( 718s scheme=self._proxy_origin.scheme, 718s host=self._proxy_origin.host, 718s port=self._proxy_origin.port, 718s target=target, 718s ) 718s connect_headers = merge_headers( 718s [(b"Host", target), (b"Accept", b"*/*")], self._proxy_headers 718s ) 718s connect_request = Request( 718s method=b"CONNECT", 718s url=connect_url, 718s headers=connect_headers, 718s extensions=request.extensions, 718s ) 718s connect_response = await self._connection.handle_async_request( 718s connect_request 718s ) 718s 718s if connect_response.status < 200 or connect_response.status > 299: 718s reason_bytes = connect_response.extensions.get("reason_phrase", b"") 718s reason_str = reason_bytes.decode("ascii", errors="ignore") 718s msg = "%d %s" % (connect_response.status, reason_str) 718s await self._connection.aclose() 718s > raise ProxyError(msg) 718s E httpcore.ProxyError: 503 Service Unavailable 718s 718s /usr/lib/python3/dist-packages/httpcore/_async/http_proxy.py:298: ProxyError 718s 718s The above exception was the direct cause of the following exception: 718s 718s @pytest.mark.asyncio 718s async def test_with_fetch_token_in_oauth(): 718s async def fetch_token(name, request): 718s return {'access_token': 'dev', 'token_type': 'bearer'} 718s 718s app = AsyncPathMapDispatch({ 718s '/user': {'body': {'sub': '123'}} 718s }) 718s oauth = OAuth(fetch_token=fetch_token) 718s client = oauth.register( 718s 'dev', 718s client_id='dev', 718s client_secret='dev', 718s api_base_url='https://i.b/api', 718s access_token_url='https://i.b/token', 718s authorize_url='https://i.b/authorize', 718s client_kwargs={ 718s 'app': app, 718s } 718s ) 718s 718s req_scope = {'type': 'http', 'session': {}} 718s req = Request(req_scope) 718s > resp = await client.get('/user', request=req) 718s 718s tests/clients/test_starlette/test_oauth_client.py:238: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/authlib/integrations/base_client/async_app.py:86: in request 718s return await _http_request(self, session, method, url, token, kwargs) 718s /usr/lib/python3/dist-packages/authlib/integrations/base_client/async_app.py:144: in _http_request 718s return await session.request(method, url, **kwargs) 718s /usr/lib/python3/dist-packages/authlib/integrations/httpx_client/oauth2_client.py:90: in request 718s return await super().request( 718s /usr/lib/python3/dist-packages/httpx/_client.py:1574: in request 718s return await self.send(request, auth=auth, follow_redirects=follow_redirects) 718s /usr/lib/python3/dist-packages/httpx/_client.py:1661: in send 718s response = await self._send_handling_auth( 718s /usr/lib/python3/dist-packages/httpx/_client.py:1689: in _send_handling_auth 718s response = await self._send_handling_redirects( 718s /usr/lib/python3/dist-packages/httpx/_client.py:1726: in _send_handling_redirects 718s response = await self._send_single_request(request) 718s /usr/lib/python3/dist-packages/httpx/_client.py:1763: in _send_single_request 718s response = await transport.handle_async_request(request) 718s /usr/lib/python3/dist-packages/httpx/_transports/default.py:372: in handle_async_request 718s with map_httpcore_exceptions(): 718s /usr/lib/python3.12/contextlib.py:158: in __exit__ 718s self.gen.throw(value) 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s @contextlib.contextmanager 718s def map_httpcore_exceptions() -> typing.Iterator[None]: 718s try: 718s yield 718s except Exception as exc: 718s mapped_exc = None 718s 718s for from_exc, to_exc in HTTPCORE_EXC_MAP.items(): 718s if not isinstance(exc, from_exc): 718s continue 718s # We want to map to the most specific exception we can find. 718s # Eg if `exc` is an `httpcore.ReadTimeout`, we want to map to 718s # `httpx.ReadTimeout`, not just `httpx.TimeoutException`. 718s if mapped_exc is None or issubclass(to_exc, mapped_exc): 718s mapped_exc = to_exc 718s 718s if mapped_exc is None: # pragma: no cover 718s raise 718s 718s message = str(exc) 718s > raise mapped_exc(message) from exc 718s E httpx.ProxyError: 503 Service Unavailable 718s 718s /usr/lib/python3/dist-packages/httpx/_transports/default.py:86: ProxyError 718s _________________________ test_request_withhold_token __________________________ 718s 718s @contextlib.contextmanager 718s def map_httpcore_exceptions() -> typing.Iterator[None]: 718s try: 718s > yield 718s 718s /usr/lib/python3/dist-packages/httpx/_transports/default.py:69: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/httpx/_transports/default.py:373: in handle_async_request 718s resp = await self._pool.handle_async_request(req) 718s /usr/lib/python3/dist-packages/httpcore/_async/connection_pool.py:216: in handle_async_request 718s raise exc from None 718s /usr/lib/python3/dist-packages/httpcore/_async/connection_pool.py:196: in handle_async_request 718s response = await connection.handle_async_request( 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s self = 718s request = 718s 718s async def handle_async_request(self, request: Request) -> Response: 718s timeouts = request.extensions.get("timeout", {}) 718s timeout = timeouts.get("connect", None) 718s 718s async with self._connect_lock: 718s if not self._connected: 718s target = b"%b:%d" % (self._remote_origin.host, self._remote_origin.port) 718s 718s connect_url = URL( 718s scheme=self._proxy_origin.scheme, 718s host=self._proxy_origin.host, 718s port=self._proxy_origin.port, 718s target=target, 718s ) 718s connect_headers = merge_headers( 718s [(b"Host", target), (b"Accept", b"*/*")], self._proxy_headers 718s ) 718s connect_request = Request( 718s method=b"CONNECT", 718s url=connect_url, 718s headers=connect_headers, 718s extensions=request.extensions, 718s ) 718s connect_response = await self._connection.handle_async_request( 718s connect_request 718s ) 718s 718s if connect_response.status < 200 or connect_response.status > 299: 718s reason_bytes = connect_response.extensions.get("reason_phrase", b"") 718s reason_str = reason_bytes.decode("ascii", errors="ignore") 718s msg = "%d %s" % (connect_response.status, reason_str) 718s await self._connection.aclose() 718s > raise ProxyError(msg) 718s E httpcore.ProxyError: 503 Service Unavailable 718s 718s /usr/lib/python3/dist-packages/httpcore/_async/http_proxy.py:298: ProxyError 718s 718s The above exception was the direct cause of the following exception: 718s 718s @pytest.mark.asyncio 718s async def test_request_withhold_token(): 718s oauth = OAuth() 718s app = AsyncPathMapDispatch({ 718s '/user': {'body': {'sub': '123'}} 718s }) 718s client = oauth.register( 718s "dev", 718s client_id="dev", 718s client_secret="dev", 718s api_base_url="https://i.b/api", 718s access_token_url="https://i.b/token", 718s authorize_url="https://i.b/authorize", 718s client_kwargs={ 718s 'app': app, 718s } 718s ) 718s req_scope = {'type': 'http', 'session': {}} 718s req = Request(req_scope) 718s > resp = await client.get('/user', request=req, withhold_token=True) 718s 718s tests/clients/test_starlette/test_oauth_client.py:261: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/authlib/integrations/base_client/async_app.py:86: in request 718s return await _http_request(self, session, method, url, token, kwargs) 718s /usr/lib/python3/dist-packages/authlib/integrations/base_client/async_app.py:136: in _http_request 718s return await session.request(method, url, **kwargs) 718s /usr/lib/python3/dist-packages/authlib/integrations/httpx_client/oauth2_client.py:90: in request 718s return await super().request( 718s /usr/lib/python3/dist-packages/httpx/_client.py:1574: in request 718s return await self.send(request, auth=auth, follow_redirects=follow_redirects) 718s /usr/lib/python3/dist-packages/httpx/_client.py:1661: in send 718s response = await self._send_handling_auth( 718s /usr/lib/python3/dist-packages/httpx/_client.py:1689: in _send_handling_auth 718s response = await self._send_handling_redirects( 718s /usr/lib/python3/dist-packages/httpx/_client.py:1726: in _send_handling_redirects 718s response = await self._send_single_request(request) 718s /usr/lib/python3/dist-packages/httpx/_client.py:1763: in _send_single_request 718s response = await transport.handle_async_request(request) 718s /usr/lib/python3/dist-packages/httpx/_transports/default.py:372: in handle_async_request 718s with map_httpcore_exceptions(): 718s /usr/lib/python3.12/contextlib.py:158: in __exit__ 718s self.gen.throw(value) 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s @contextlib.contextmanager 718s def map_httpcore_exceptions() -> typing.Iterator[None]: 718s try: 718s yield 718s except Exception as exc: 718s mapped_exc = None 718s 718s for from_exc, to_exc in HTTPCORE_EXC_MAP.items(): 718s if not isinstance(exc, from_exc): 718s continue 718s # We want to map to the most specific exception we can find. 718s # Eg if `exc` is an `httpcore.ReadTimeout`, we want to map to 718s # `httpx.ReadTimeout`, not just `httpx.TimeoutException`. 718s if mapped_exc is None or issubclass(to_exc, mapped_exc): 718s mapped_exc = to_exc 718s 718s if mapped_exc is None: # pragma: no cover 718s raise 718s 718s message = str(exc) 718s > raise mapped_exc(message) from exc 718s E httpx.ProxyError: 503 Service Unavailable 718s 718s /usr/lib/python3/dist-packages/httpx/_transports/default.py:86: ProxyError 718s _____________________ test_oauth2_authorize_with_metadata ______________________ 718s 718s @contextlib.contextmanager 718s def map_httpcore_exceptions() -> typing.Iterator[None]: 718s try: 718s > yield 718s 718s /usr/lib/python3/dist-packages/httpx/_transports/default.py:69: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/httpx/_transports/default.py:373: in handle_async_request 718s resp = await self._pool.handle_async_request(req) 718s /usr/lib/python3/dist-packages/httpcore/_async/connection_pool.py:216: in handle_async_request 718s raise exc from None 718s /usr/lib/python3/dist-packages/httpcore/_async/connection_pool.py:196: in handle_async_request 718s response = await connection.handle_async_request( 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s self = 718s request = 718s 718s async def handle_async_request(self, request: Request) -> Response: 718s timeouts = request.extensions.get("timeout", {}) 718s timeout = timeouts.get("connect", None) 718s 718s async with self._connect_lock: 718s if not self._connected: 718s target = b"%b:%d" % (self._remote_origin.host, self._remote_origin.port) 718s 718s connect_url = URL( 718s scheme=self._proxy_origin.scheme, 718s host=self._proxy_origin.host, 718s port=self._proxy_origin.port, 718s target=target, 718s ) 718s connect_headers = merge_headers( 718s [(b"Host", target), (b"Accept", b"*/*")], self._proxy_headers 718s ) 718s connect_request = Request( 718s method=b"CONNECT", 718s url=connect_url, 718s headers=connect_headers, 718s extensions=request.extensions, 718s ) 718s connect_response = await self._connection.handle_async_request( 718s connect_request 718s ) 718s 718s if connect_response.status < 200 or connect_response.status > 299: 718s reason_bytes = connect_response.extensions.get("reason_phrase", b"") 718s reason_str = reason_bytes.decode("ascii", errors="ignore") 718s msg = "%d %s" % (connect_response.status, reason_str) 718s await self._connection.aclose() 718s > raise ProxyError(msg) 718s E httpcore.ProxyError: 503 Service Unavailable 718s 718s /usr/lib/python3/dist-packages/httpcore/_async/http_proxy.py:298: ProxyError 718s 718s The above exception was the direct cause of the following exception: 718s 718s @pytest.mark.asyncio 718s async def test_oauth2_authorize_with_metadata(): 718s oauth = OAuth() 718s app = AsyncPathMapDispatch({ 718s '/.well-known/openid-configuration': {'body': { 718s 'authorization_endpoint': 'https://i.b/authorize' 718s }} 718s }) 718s client = oauth.register( 718s 'dev', 718s client_id='dev', 718s client_secret='dev', 718s api_base_url='https://i.b/api', 718s access_token_url='https://i.b/token', 718s server_metadata_url='https://i.b/.well-known/openid-configuration', 718s client_kwargs={ 718s 'app': app, 718s } 718s ) 718s req_scope = {'type': 'http', 'session': {}} 718s req = Request(req_scope) 718s > resp = await client.authorize_redirect(req, 'https://b.com/bar') 718s 718s tests/clients/test_starlette/test_oauth_client.py:302: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/authlib/integrations/starlette_client/apps.py:34: in authorize_redirect 718s rv = await self.create_authorization_url(redirect_uri, **kwargs) 718s /usr/lib/python3/dist-packages/authlib/integrations/base_client/async_app.py:95: in create_authorization_url 718s metadata = await self.load_server_metadata() 718s /usr/lib/python3/dist-packages/authlib/integrations/base_client/async_app.py:76: in load_server_metadata 718s resp = await client.request('GET', self._server_metadata_url, withhold_token=True) 718s /usr/lib/python3/dist-packages/authlib/integrations/httpx_client/oauth2_client.py:90: in request 718s return await super().request( 718s /usr/lib/python3/dist-packages/httpx/_client.py:1574: in request 718s return await self.send(request, auth=auth, follow_redirects=follow_redirects) 718s /usr/lib/python3/dist-packages/httpx/_client.py:1661: in send 718s response = await self._send_handling_auth( 718s /usr/lib/python3/dist-packages/httpx/_client.py:1689: in _send_handling_auth 718s response = await self._send_handling_redirects( 718s /usr/lib/python3/dist-packages/httpx/_client.py:1726: in _send_handling_redirects 718s response = await self._send_single_request(request) 718s /usr/lib/python3/dist-packages/httpx/_client.py:1763: in _send_single_request 718s response = await transport.handle_async_request(request) 718s /usr/lib/python3/dist-packages/httpx/_transports/default.py:372: in handle_async_request 718s with map_httpcore_exceptions(): 718s /usr/lib/python3.12/contextlib.py:158: in __exit__ 718s self.gen.throw(value) 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s @contextlib.contextmanager 718s def map_httpcore_exceptions() -> typing.Iterator[None]: 718s try: 718s yield 718s except Exception as exc: 718s mapped_exc = None 718s 718s for from_exc, to_exc in HTTPCORE_EXC_MAP.items(): 718s if not isinstance(exc, from_exc): 718s continue 718s # We want to map to the most specific exception we can find. 718s # Eg if `exc` is an `httpcore.ReadTimeout`, we want to map to 718s # `httpx.ReadTimeout`, not just `httpx.TimeoutException`. 718s if mapped_exc is None or issubclass(to_exc, mapped_exc): 718s mapped_exc = to_exc 718s 718s if mapped_exc is None: # pragma: no cover 718s raise 718s 718s message = str(exc) 718s > raise mapped_exc(message) from exc 718s E httpx.ProxyError: 503 Service Unavailable 718s 718s /usr/lib/python3/dist-packages/httpx/_transports/default.py:86: ProxyError 718s _____________________________ test_fetch_userinfo ______________________________ 718s 718s @contextlib.contextmanager 718s def map_httpcore_exceptions() -> typing.Iterator[None]: 718s try: 718s > yield 718s 718s /usr/lib/python3/dist-packages/httpx/_transports/default.py:69: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/httpx/_transports/default.py:373: in handle_async_request 718s resp = await self._pool.handle_async_request(req) 718s /usr/lib/python3/dist-packages/httpcore/_async/connection_pool.py:216: in handle_async_request 718s raise exc from None 718s /usr/lib/python3/dist-packages/httpcore/_async/connection_pool.py:196: in handle_async_request 718s response = await connection.handle_async_request( 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s self = 718s request = 718s 718s async def handle_async_request(self, request: Request) -> Response: 718s timeouts = request.extensions.get("timeout", {}) 718s timeout = timeouts.get("connect", None) 718s 718s async with self._connect_lock: 718s if not self._connected: 718s target = b"%b:%d" % (self._remote_origin.host, self._remote_origin.port) 718s 718s connect_url = URL( 718s scheme=self._proxy_origin.scheme, 718s host=self._proxy_origin.host, 718s port=self._proxy_origin.port, 718s target=target, 718s ) 718s connect_headers = merge_headers( 718s [(b"Host", target), (b"Accept", b"*/*")], self._proxy_headers 718s ) 718s connect_request = Request( 718s method=b"CONNECT", 718s url=connect_url, 718s headers=connect_headers, 718s extensions=request.extensions, 718s ) 718s connect_response = await self._connection.handle_async_request( 718s connect_request 718s ) 718s 718s if connect_response.status < 200 or connect_response.status > 299: 718s reason_bytes = connect_response.extensions.get("reason_phrase", b"") 718s reason_str = reason_bytes.decode("ascii", errors="ignore") 718s msg = "%d %s" % (connect_response.status, reason_str) 718s await self._connection.aclose() 718s > raise ProxyError(msg) 718s E httpcore.ProxyError: 503 Service Unavailable 718s 718s /usr/lib/python3/dist-packages/httpcore/_async/http_proxy.py:298: ProxyError 718s 718s The above exception was the direct cause of the following exception: 718s 718s @pytest.mark.asyncio 718s async def test_fetch_userinfo(): 718s > await run_fetch_userinfo({'sub': '123'}) 718s 718s tests/clients/test_starlette/test_user_mixin.py:42: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s tests/clients/test_starlette/test_user_mixin.py:36: in run_fetch_userinfo 718s user = await client.userinfo(request=req) 718s /usr/lib/python3/dist-packages/authlib/integrations/base_client/async_openid.py:29: in userinfo 718s resp = await self.get(metadata['userinfo_endpoint'], **kwargs) 718s /usr/lib/python3/dist-packages/authlib/integrations/base_client/async_app.py:86: in request 718s return await _http_request(self, session, method, url, token, kwargs) 718s /usr/lib/python3/dist-packages/authlib/integrations/base_client/async_app.py:144: in _http_request 718s return await session.request(method, url, **kwargs) 718s /usr/lib/python3/dist-packages/authlib/integrations/httpx_client/oauth2_client.py:90: in request 718s return await super().request( 718s /usr/lib/python3/dist-packages/httpx/_client.py:1574: in request 718s return await self.send(request, auth=auth, follow_redirects=follow_redirects) 718s /usr/lib/python3/dist-packages/httpx/_client.py:1661: in send 718s response = await self._send_handling_auth( 718s /usr/lib/python3/dist-packages/httpx/_client.py:1689: in _send_handling_auth 718s response = await self._send_handling_redirects( 718s /usr/lib/python3/dist-packages/httpx/_client.py:1726: in _send_handling_redirects 718s response = await self._send_single_request(request) 718s /usr/lib/python3/dist-packages/httpx/_client.py:1763: in _send_single_request 718s response = await transport.handle_async_request(request) 718s /usr/lib/python3/dist-packages/httpx/_transports/default.py:372: in handle_async_request 718s with map_httpcore_exceptions(): 718s /usr/lib/python3.12/contextlib.py:158: in __exit__ 718s self.gen.throw(value) 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s @contextlib.contextmanager 718s def map_httpcore_exceptions() -> typing.Iterator[None]: 718s try: 718s yield 718s except Exception as exc: 718s mapped_exc = None 718s 718s for from_exc, to_exc in HTTPCORE_EXC_MAP.items(): 718s if not isinstance(exc, from_exc): 718s continue 718s # We want to map to the most specific exception we can find. 718s # Eg if `exc` is an `httpcore.ReadTimeout`, we want to map to 718s # `httpx.ReadTimeout`, not just `httpx.TimeoutException`. 718s if mapped_exc is None or issubclass(to_exc, mapped_exc): 718s mapped_exc = to_exc 718s 718s if mapped_exc is None: # pragma: no cover 718s raise 718s 718s message = str(exc) 718s > raise mapped_exc(message) from exc 718s E httpx.ProxyError: 503 Service Unavailable 718s 718s /usr/lib/python3/dist-packages/httpx/_transports/default.py:86: ProxyError 718s __________________________ test_force_fetch_jwks_uri ___________________________ 718s 718s @contextlib.contextmanager 718s def map_httpcore_exceptions() -> typing.Iterator[None]: 718s try: 718s > yield 718s 718s /usr/lib/python3/dist-packages/httpx/_transports/default.py:69: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/httpx/_transports/default.py:373: in handle_async_request 718s resp = await self._pool.handle_async_request(req) 718s /usr/lib/python3/dist-packages/httpcore/_async/connection_pool.py:216: in handle_async_request 718s raise exc from None 718s /usr/lib/python3/dist-packages/httpcore/_async/connection_pool.py:196: in handle_async_request 718s response = await connection.handle_async_request( 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s self = 718s request = 718s 718s async def handle_async_request(self, request: Request) -> Response: 718s timeouts = request.extensions.get("timeout", {}) 718s timeout = timeouts.get("connect", None) 718s 718s async with self._connect_lock: 718s if not self._connected: 718s target = b"%b:%d" % (self._remote_origin.host, self._remote_origin.port) 718s 718s connect_url = URL( 718s scheme=self._proxy_origin.scheme, 718s host=self._proxy_origin.host, 718s port=self._proxy_origin.port, 718s target=target, 718s ) 718s connect_headers = merge_headers( 718s [(b"Host", target), (b"Accept", b"*/*")], self._proxy_headers 718s ) 718s connect_request = Request( 718s method=b"CONNECT", 718s url=connect_url, 718s headers=connect_headers, 718s extensions=request.extensions, 718s ) 718s connect_response = await self._connection.handle_async_request( 718s connect_request 718s ) 718s 718s if connect_response.status < 200 or connect_response.status > 299: 718s reason_bytes = connect_response.extensions.get("reason_phrase", b"") 718s reason_str = reason_bytes.decode("ascii", errors="ignore") 718s msg = "%d %s" % (connect_response.status, reason_str) 718s await self._connection.aclose() 718s > raise ProxyError(msg) 718s E httpcore.ProxyError: 503 Service Unavailable 718s 718s /usr/lib/python3/dist-packages/httpcore/_async/http_proxy.py:298: ProxyError 718s 718s The above exception was the direct cause of the following exception: 718s 718s @pytest.mark.asyncio 718s async def test_force_fetch_jwks_uri(): 718s secret_keys = read_key_file('jwks_private.json') 718s token = get_bearer_token() 718s id_token = generate_id_token( 718s token, {'sub': '123'}, secret_keys, 718s alg='RS256', iss='https://i.b', 718s aud='dev', exp=3600, nonce='n', 718s ) 718s token['id_token'] = id_token 718s 718s app = AsyncPathMapDispatch({ 718s '/jwks': {'body': read_key_file('jwks_public.json')} 718s }) 718s 718s oauth = OAuth() 718s client = oauth.register( 718s 'dev', 718s client_id='dev', 718s client_secret='dev', 718s fetch_token=get_bearer_token, 718s jwks_uri='https://i.b/jwks', 718s issuer='https://i.b', 718s client_kwargs={ 718s 'app': app, 718s } 718s ) 718s > user = await client.parse_id_token(token, nonce='n') 718s 718s tests/clients/test_starlette/test_user_mixin.py:129: 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s /usr/lib/python3/dist-packages/authlib/integrations/base_client/async_openid.py:56: in parse_id_token 718s jwk_set = await self.fetch_jwk_set() 718s /usr/lib/python3/dist-packages/authlib/integrations/base_client/async_openid.py:19: in fetch_jwk_set 718s resp = await client.request('GET', uri, withhold_token=True) 718s /usr/lib/python3/dist-packages/authlib/integrations/httpx_client/oauth2_client.py:90: in request 718s return await super().request( 718s /usr/lib/python3/dist-packages/httpx/_client.py:1574: in request 718s return await self.send(request, auth=auth, follow_redirects=follow_redirects) 718s /usr/lib/python3/dist-packages/httpx/_client.py:1661: in send 718s response = await self._send_handling_auth( 718s /usr/lib/python3/dist-packages/httpx/_client.py:1689: in _send_handling_auth 718s response = await self._send_handling_redirects( 718s /usr/lib/python3/dist-packages/httpx/_client.py:1726: in _send_handling_redirects 718s response = await self._send_single_request(request) 718s /usr/lib/python3/dist-packages/httpx/_client.py:1763: in _send_single_request 718s response = await transport.handle_async_request(request) 718s /usr/lib/python3/dist-packages/httpx/_transports/default.py:372: in handle_async_request 718s with map_httpcore_exceptions(): 718s /usr/lib/python3.12/contextlib.py:158: in __exit__ 718s self.gen.throw(value) 718s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 718s 718s @contextlib.contextmanager 718s def map_httpcore_exceptions() -> typing.Iterator[None]: 718s try: 718s yield 718s except Exception as exc: 718s mapped_exc = None 718s 718s for from_exc, to_exc in HTTPCORE_EXC_MAP.items(): 718s if not isinstance(exc, from_exc): 718s continue 718s # We want to map to the most specific exception we can find. 718s # Eg if `exc` is an `httpcore.ReadTimeout`, we want to map to 718s # `httpx.ReadTimeout`, not just `httpx.TimeoutException`. 718s if mapped_exc is None or issubclass(to_exc, mapped_exc): 718s mapped_exc = to_exc 718s 718s if mapped_exc is None: # pragma: no cover 718s raise 718s 718s message = str(exc) 718s > raise mapped_exc(message) from exc 718s E httpx.ProxyError: 503 Service Unavailable 718s 718s /usr/lib/python3/dist-packages/httpx/_transports/default.py:86: ProxyError 718s =============================== warnings summary =============================== 718s ../../../usr/lib/python3/dist-packages/httpx/_client.py:1426: 2 warnings 718s tests/clients/test_httpx/test_async_assertion_client.py: 2 warnings 718s tests/clients/test_httpx/test_async_oauth1_client.py: 7 warnings 718s tests/clients/test_httpx/test_async_oauth2_client.py: 19 warnings 718s tests/clients/test_starlette/test_oauth_client.py: 9 warnings 718s tests/clients/test_starlette/test_user_mixin.py: 2 warnings 718s /usr/lib/python3/dist-packages/httpx/_client.py:1426: DeprecationWarning: The 'app' shortcut is now deprecated. Use the explicit style 'transport=ASGITransport(app=...)' instead. 718s warnings.warn(message, DeprecationWarning) 718s 718s tests/clients/test_flask/test_oauth_client.py::FlaskOAuthTest::test_openid_authorize 718s /usr/lib/python3/dist-packages/authlib/jose/jwk.py:14: AuthlibDeprecationWarning: Please use ``JsonWebKey`` directly. 718s deprecate('Please use ``JsonWebKey`` directly.') 718s 718s tests/clients/test_httpx/test_assertion_client.py: 3 warnings 718s tests/clients/test_httpx/test_oauth1_client.py: 7 warnings 718s tests/clients/test_httpx/test_oauth2_client.py: 23 warnings 718s /usr/lib/python3/dist-packages/httpx/_client.py:680: DeprecationWarning: The 'app' shortcut is now deprecated. Use the explicit style 'transport=WSGITransport(app=...)' instead. 718s warnings.warn(message, DeprecationWarning) 718s 718s tests/clients/test_httpx/test_async_oauth2_client.py::test_httpx_client_stream_match[client0] 718s tests/clients/test_httpx/test_async_oauth2_client.py::test_httpx_client_stream_match[client1] 718s /usr/lib/python3/dist-packages/_pytest/python.py:183: PytestUnhandledCoroutineWarning: async def functions are not natively supported and have been skipped. 718s You need to install a suitable plugin for your async framework, for example: 718s - anyio 718s - pytest-asyncio 718s - pytest-tornasync 718s - pytest-trio 718s - pytest-twisted 718s warnings.warn(PytestUnhandledCoroutineWarning(msg.format(nodeid))) 718s 718s -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html 718s =========================== short test summary info ============================ 718s FAILED tests/clients/test_httpx/test_async_assertion_client.py::test_refresh_token 718s FAILED tests/clients/test_httpx/test_async_oauth1_client.py::test_fetch_request_token_via_header 718s FAILED tests/clients/test_httpx/test_async_oauth1_client.py::test_fetch_request_token_via_body 718s FAILED tests/clients/test_httpx/test_async_oauth1_client.py::test_fetch_request_token_via_query 718s FAILED tests/clients/test_httpx/test_async_oauth1_client.py::test_fetch_access_token 718s FAILED tests/clients/test_httpx/test_async_oauth1_client.py::test_get_via_header 718s FAILED tests/clients/test_httpx/test_async_oauth1_client.py::test_get_via_body 718s FAILED tests/clients/test_httpx/test_async_oauth1_client.py::test_get_via_query 718s FAILED tests/clients/test_httpx/test_async_oauth2_client.py::test_add_token_get_request[assert_token_in_header-header] 718s FAILED tests/clients/test_httpx/test_async_oauth2_client.py::test_add_token_get_request[assert_token_in_body-body] 718s FAILED tests/clients/test_httpx/test_async_oauth2_client.py::test_add_token_get_request[assert_token_in_uri-uri] 718s FAILED tests/clients/test_httpx/test_async_oauth2_client.py::test_add_token_to_streaming_request[assert_token_in_header-header] 718s FAILED tests/clients/test_httpx/test_async_oauth2_client.py::test_add_token_to_streaming_request[assert_token_in_body-body] 718s FAILED tests/clients/test_httpx/test_async_oauth2_client.py::test_add_token_to_streaming_request[assert_token_in_uri-uri] 718s FAILED tests/clients/test_httpx/test_async_oauth2_client.py::test_fetch_token_post 718s FAILED tests/clients/test_httpx/test_async_oauth2_client.py::test_fetch_token_get 718s FAILED tests/clients/test_httpx/test_async_oauth2_client.py::test_token_auth_method_client_secret_post 718s FAILED tests/clients/test_httpx/test_async_oauth2_client.py::test_access_token_response_hook 718s FAILED tests/clients/test_httpx/test_async_oauth2_client.py::test_password_grant_type 718s FAILED tests/clients/test_httpx/test_async_oauth2_client.py::test_client_credentials_type 718s FAILED tests/clients/test_httpx/test_async_oauth2_client.py::test_cleans_previous_token_before_fetching_new_one 718s FAILED tests/clients/test_httpx/test_async_oauth2_client.py::test_auto_refresh_token 718s FAILED tests/clients/test_httpx/test_async_oauth2_client.py::test_auto_refresh_token2 718s FAILED tests/clients/test_httpx/test_async_oauth2_client.py::test_auto_refresh_token3 718s FAILED tests/clients/test_httpx/test_async_oauth2_client.py::test_auto_refresh_token4 718s FAILED tests/clients/test_httpx/test_async_oauth2_client.py::test_revoke_token 718s FAILED tests/clients/test_starlette/test_oauth_client.py::test_oauth1_authorize 718s FAILED tests/clients/test_starlette/test_oauth_client.py::test_oauth2_authorize 718s FAILED tests/clients/test_starlette/test_oauth_client.py::test_oauth2_authorize_code_challenge 718s FAILED tests/clients/test_starlette/test_oauth_client.py::test_with_fetch_token_in_register 718s FAILED tests/clients/test_starlette/test_oauth_client.py::test_with_fetch_token_in_oauth 718s FAILED tests/clients/test_starlette/test_oauth_client.py::test_request_withhold_token 718s FAILED tests/clients/test_starlette/test_oauth_client.py::test_oauth2_authorize_with_metadata 718s FAILED tests/clients/test_starlette/test_user_mixin.py::test_fetch_userinfo 718s FAILED tests/clients/test_starlette/test_user_mixin.py::test_force_fetch_jwks_uri 718s =========== 35 failed, 130 passed, 2 skipped, 77 warnings in 33.15s ============ 721s autopkgtest [16:58:16]: test unittests3: -----------------------] 726s autopkgtest [16:58:21]: test unittests3: - - - - - - - - - - results - - - - - - - - - - 726s unittests3 FAIL non-zero exit status 1 730s autopkgtest [16:58:25]: @@@@@@@@@@@@@@@@@@@@ summary 730s unittests3 FAIL non-zero exit status 1