0s autopkgtest [10:21:49]: starting date and time: 2024-06-16 10:21:49+0000 0s autopkgtest [10:21:49]: git checkout: 433ed4cb Merge branch 'skia/nova_flock' into 'ubuntu/5.34+prod' 0s autopkgtest [10:21:49]: host juju-7f2275-prod-proposed-migration-environment-2; command line: /home/ubuntu/autopkgtest/runner/autopkgtest --output-dir /tmp/autopkgtest-work.f6v1m_h3/out --timeout-copy=6000 --setup-commands /home/ubuntu/autopkgtest-cloud/worker-config-production/setup-canonical.sh --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 -- ssh -s /home/ubuntu/autopkgtest/ssh-setup/nova -- --flavor autopkgtest --security-groups autopkgtest-juju-7f2275-prod-proposed-migration-environment-2@bos03-arm64-14.secgroup --name adt-oracular-arm64-python-authlib-20240616-102149-juju-7f2275-prod-proposed-migration-environment-2-272f3552-c143-4051-aca0-0c62825b3bf9 --image adt/ubuntu-oracular-arm64-server --keyname testbed-juju-7f2275-prod-proposed-migration-environment-2 --net-id=net_prod-proposed-migration -e TERM=linux -e ''"'"'http_proxy=http://squid.internal:3128'"'"'' -e ''"'"'https_proxy=http://squid.internal:3128'"'"'' -e ''"'"'no_proxy=127.0.0.1,127.0.1.1,login.ubuntu.com,localhost,localdomain,novalocal,internal,archive.ubuntu.com,ports.ubuntu.com,security.ubuntu.com,ddebs.ubuntu.com,changelogs.ubuntu.com,keyserver.ubuntu.com,launchpadlibrarian.net,launchpadcontent.net,launchpad.net,10.24.0.0/24,keystone.ps5.canonical.com,objectstorage.prodstack5.canonical.com'"'"'' --mirror=http://ftpmaster.internal/ubuntu/ 1360s autopkgtest [10:44:29]: testbed dpkg architecture: arm64 1360s autopkgtest [10:44:29]: testbed apt version: 2.9.3 1360s autopkgtest [10:44:29]: @@@@@@@@@@@@@@@@@@@@ test bed setup 1361s Get:1 http://ftpmaster.internal/ubuntu oracular-proposed InRelease [110 kB] 1361s Get:2 http://ftpmaster.internal/ubuntu oracular-proposed/main Sources [36.1 kB] 1362s Get:3 http://ftpmaster.internal/ubuntu oracular-proposed/multiverse Sources [2576 B] 1362s Get:4 http://ftpmaster.internal/ubuntu oracular-proposed/restricted Sources [7052 B] 1362s Get:5 http://ftpmaster.internal/ubuntu oracular-proposed/universe Sources [389 kB] 1362s Get:6 http://ftpmaster.internal/ubuntu oracular-proposed/main arm64 Packages [55.3 kB] 1362s Get:7 http://ftpmaster.internal/ubuntu oracular-proposed/restricted arm64 Packages [33.3 kB] 1362s Get:8 http://ftpmaster.internal/ubuntu oracular-proposed/universe arm64 Packages [312 kB] 1362s Get:9 http://ftpmaster.internal/ubuntu oracular-proposed/multiverse arm64 Packages [8312 B] 1363s Fetched 955 kB in 2s (533 kB/s) 1364s Reading package lists... 1375s Reading package lists... 1375s Building dependency tree... 1375s Reading state information... 1375s Calculating upgrade... 1376s The following packages will be upgraded: 1376s apt apt-utils dracut-install libapt-pkg6.0t64 libc-bin libc-dev-bin 1376s libc-devtools libc6 libc6-dev libldap-common libldap2 libnss3 locales 1376s python3-certifi ubuntu-pro-client ubuntu-pro-client-l10n 1377s 16 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 1377s Need to get 13.8 MB of archives. 1377s After this operation, 9216 B of additional disk space will be used. 1377s Get:1 http://ftpmaster.internal/ubuntu oracular/main arm64 libc-devtools arm64 2.39-0ubuntu9 [27.8 kB] 1377s Get:2 http://ftpmaster.internal/ubuntu oracular/main arm64 libc6-dev arm64 2.39-0ubuntu9 [1595 kB] 1377s Get:3 http://ftpmaster.internal/ubuntu oracular/main arm64 libc-dev-bin arm64 2.39-0ubuntu9 [19.7 kB] 1377s Get:4 http://ftpmaster.internal/ubuntu oracular/main arm64 libc6 arm64 2.39-0ubuntu9 [2776 kB] 1377s Get:5 http://ftpmaster.internal/ubuntu oracular/main arm64 libc-bin arm64 2.39-0ubuntu9 [591 kB] 1377s Get:6 http://ftpmaster.internal/ubuntu oracular/main arm64 libapt-pkg6.0t64 arm64 2.9.5 [967 kB] 1377s Get:7 http://ftpmaster.internal/ubuntu oracular/main arm64 apt arm64 2.9.5 [1362 kB] 1377s Get:8 http://ftpmaster.internal/ubuntu oracular/main arm64 apt-utils arm64 2.9.5 [211 kB] 1377s Get:9 http://ftpmaster.internal/ubuntu oracular/main arm64 locales all 2.39-0ubuntu9 [4235 kB] 1378s Get:10 http://ftpmaster.internal/ubuntu oracular/main arm64 ubuntu-pro-client-l10n arm64 32.3.1 [19.4 kB] 1378s Get:11 http://ftpmaster.internal/ubuntu oracular/main arm64 ubuntu-pro-client arm64 32.3.1 [228 kB] 1378s Get:12 http://ftpmaster.internal/ubuntu oracular/main arm64 dracut-install arm64 102-3ubuntu2 [32.4 kB] 1378s Get:13 http://ftpmaster.internal/ubuntu oracular/main arm64 libldap-common all 2.6.7+dfsg-1~exp1ubuntu9 [31.5 kB] 1378s Get:14 http://ftpmaster.internal/ubuntu oracular/main arm64 libldap2 arm64 2.6.7+dfsg-1~exp1ubuntu9 [193 kB] 1378s Get:15 http://ftpmaster.internal/ubuntu oracular/main arm64 libnss3 arm64 2:3.101-1 [1361 kB] 1378s Get:16 http://ftpmaster.internal/ubuntu oracular/main arm64 python3-certifi all 2024.6.2-1 [160 kB] 1384s Preconfiguring packages ... 1385s Fetched 13.8 MB in 1s (9671 kB/s) 1385s (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 ... 78264 files and directories currently installed.) 1385s Preparing to unpack .../libc-devtools_2.39-0ubuntu9_arm64.deb ... 1385s Unpacking libc-devtools (2.39-0ubuntu9) over (2.39-0ubuntu8.1) ... 1386s Preparing to unpack .../libc6-dev_2.39-0ubuntu9_arm64.deb ... 1386s Unpacking libc6-dev:arm64 (2.39-0ubuntu9) over (2.39-0ubuntu8.1) ... 1386s Preparing to unpack .../libc-dev-bin_2.39-0ubuntu9_arm64.deb ... 1386s Unpacking libc-dev-bin (2.39-0ubuntu9) over (2.39-0ubuntu8.1) ... 1386s Preparing to unpack .../libc6_2.39-0ubuntu9_arm64.deb ... 1387s Unpacking libc6:arm64 (2.39-0ubuntu9) over (2.39-0ubuntu8.1) ... 1390s Setting up libc6:arm64 (2.39-0ubuntu9) ... 1392s (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 ... 78264 files and directories currently installed.) 1392s Preparing to unpack .../libc-bin_2.39-0ubuntu9_arm64.deb ... 1392s Unpacking libc-bin (2.39-0ubuntu9) over (2.39-0ubuntu8.1) ... 1394s Setting up libc-bin (2.39-0ubuntu9) ... 1394s (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 ... 78264 files and directories currently installed.) 1394s Preparing to unpack .../libapt-pkg6.0t64_2.9.5_arm64.deb ... 1394s Unpacking libapt-pkg6.0t64:arm64 (2.9.5) over (2.9.3) ... 1394s Setting up libapt-pkg6.0t64:arm64 (2.9.5) ... 1394s (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 ... 78264 files and directories currently installed.) 1394s Preparing to unpack .../archives/apt_2.9.5_arm64.deb ... 1395s Unpacking apt (2.9.5) over (2.9.3) ... 1395s Setting up apt (2.9.5) ... 1396s (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 ... 78264 files and directories currently installed.) 1396s Preparing to unpack .../0-apt-utils_2.9.5_arm64.deb ... 1396s Unpacking apt-utils (2.9.5) over (2.9.3) ... 1397s Preparing to unpack .../1-locales_2.39-0ubuntu9_all.deb ... 1397s Unpacking locales (2.39-0ubuntu9) over (2.39-0ubuntu8.1) ... 1398s Preparing to unpack .../2-ubuntu-pro-client-l10n_32.3.1_arm64.deb ... 1398s Unpacking ubuntu-pro-client-l10n (32.3.1) over (32.3) ... 1400s Preparing to unpack .../3-ubuntu-pro-client_32.3.1_arm64.deb ... 1402s Unpacking ubuntu-pro-client (32.3.1) over (32.3) ... 1407s Preparing to unpack .../4-dracut-install_102-3ubuntu2_arm64.deb ... 1407s Unpacking dracut-install (102-3ubuntu2) over (102-3ubuntu1) ... 1408s Preparing to unpack .../5-libldap-common_2.6.7+dfsg-1~exp1ubuntu9_all.deb ... 1408s Unpacking libldap-common (2.6.7+dfsg-1~exp1ubuntu9) over (2.6.7+dfsg-1~exp1ubuntu8) ... 1409s Preparing to unpack .../6-libldap2_2.6.7+dfsg-1~exp1ubuntu9_arm64.deb ... 1409s Unpacking libldap2:arm64 (2.6.7+dfsg-1~exp1ubuntu9) over (2.6.7+dfsg-1~exp1ubuntu8) ... 1409s Preparing to unpack .../7-libnss3_2%3a3.101-1_arm64.deb ... 1409s Unpacking libnss3:arm64 (2:3.101-1) over (2:3.100-1) ... 1410s Preparing to unpack .../8-python3-certifi_2024.6.2-1_all.deb ... 1410s Unpacking python3-certifi (2024.6.2-1) over (2023.11.17-1) ... 1410s Setting up apt-utils (2.9.5) ... 1410s Setting up libnss3:arm64 (2:3.101-1) ... 1410s Setting up locales (2.39-0ubuntu9) ... 1426s Generating locales (this might take a while)... 1429s en_US.UTF-8... done 1429s Generation complete. 1430s Setting up libldap-common (2.6.7+dfsg-1~exp1ubuntu9) ... 1430s Setting up python3-certifi (2024.6.2-1) ... 1430s Setting up dracut-install (102-3ubuntu2) ... 1430s Setting up libc-dev-bin (2.39-0ubuntu9) ... 1430s Setting up ubuntu-pro-client (32.3.1) ... 1430s Installing new version of config file /etc/apparmor.d/ubuntu_pro_esm_cache ... 1440s Setting up libldap2:arm64 (2.6.7+dfsg-1~exp1ubuntu9) ... 1440s Setting up libc-devtools (2.39-0ubuntu9) ... 1440s Setting up ubuntu-pro-client-l10n (32.3.1) ... 1440s Setting up libc6-dev:arm64 (2.39-0ubuntu9) ... 1440s Processing triggers for man-db (2.12.1-2) ... 1445s Processing triggers for libc-bin (2.39-0ubuntu9) ... 1450s Reading package lists... 1450s Building dependency tree... 1450s Reading state information... 1451s 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 1452s Hit:1 http://ftpmaster.internal/ubuntu oracular InRelease 1452s Hit:2 http://ftpmaster.internal/ubuntu oracular-updates InRelease 1452s Hit:3 http://ftpmaster.internal/ubuntu oracular-security InRelease 1452s Hit:4 http://ftpmaster.internal/ubuntu oracular-proposed InRelease 1454s Reading package lists... 1454s Reading package lists... 1455s Building dependency tree... 1455s Reading state information... 1455s Calculating upgrade... 1455s 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 1456s Reading package lists... 1456s Building dependency tree... 1456s Reading state information... 1457s 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 1458s autopkgtest [10:46:07]: rebooting testbed after setup commands that affected boot 1468s autopkgtest-virt-ssh: WARNING: ssh connection failed. Retrying in 3 seconds... 1501s autopkgtest-virt-ssh: WARNING: ssh connection failed. Retrying in 3 seconds... 1534s autopkgtest-virt-ssh: WARNING: ssh connection failed. Retrying in 3 seconds... 1567s autopkgtest-virt-ssh: WARNING: ssh connection failed. Retrying in 3 seconds... 1600s autopkgtest-virt-ssh: WARNING: ssh connection failed. Retrying in 3 seconds... 1633s autopkgtest-virt-ssh: WARNING: ssh connection failed. Retrying in 3 seconds... 1666s autopkgtest-virt-ssh: WARNING: ssh connection failed. Retrying in 3 seconds... 1699s autopkgtest-virt-ssh: WARNING: ssh connection failed. Retrying in 3 seconds... 1708s autopkgtest-virt-ssh: WARNING: ssh connection failed. Retrying in 3 seconds... 1731s autopkgtest [10:50:40]: testbed running kernel: Linux 6.8.0-31-generic #31-Ubuntu SMP PREEMPT_DYNAMIC Sat Apr 20 02:32:42 UTC 2024 1742s autopkgtest [10:50:51]: @@@@@@@@@@@@@@@@@@@@ apt-source python-authlib 1748s Get:1 http://ftpmaster.internal/ubuntu oracular/universe python-authlib 1.3.1-1 (dsc) [2494 B] 1748s Get:2 http://ftpmaster.internal/ubuntu oracular/universe python-authlib 1.3.1-1 (tar) [320 kB] 1748s Get:3 http://ftpmaster.internal/ubuntu oracular/universe python-authlib 1.3.1-1 (diff) [5564 B] 1748s gpgv: Signature made Thu Jun 6 10:39:37 2024 UTC 1748s gpgv: using EDDSA key EE9AD6F90520FA11F69F4824477B0DB0263A54D8 1748s gpgv: issuer "stefanor@debian.org" 1748s gpgv: Can't check signature: No public key 1748s dpkg-source: warning: cannot verify inline signature for ./python-authlib_1.3.1-1.dsc: no acceptable signature found 1749s autopkgtest [10:50:58]: testing package python-authlib version 1.3.1-1 1749s autopkgtest [10:50:58]: build not needed 1750s autopkgtest [10:50:59]: test unittests3: preparing testbed 1752s Reading package lists... 1752s Building dependency tree... 1752s Reading state information... 1752s Starting pkgProblemResolver with broken count: 0 1752s Starting 2 pkgProblemResolver with broken count: 0 1752s Done 1753s The following additional packages will be installed: 1753s libjs-jquery python3-all python3-anyio python3-asgiref 1753s python3-async-generator python3-authlib python3-cachelib python3-click 1753s python3-colorama python3-django python3-flask python3-flask-sqlalchemy 1753s python3-greenlet python3-h11 python3-httpcore python3-httpx 1753s python3-iniconfig python3-itsdangerous python3-packaging python3-pluggy 1753s python3-pycryptodome python3-pytest python3-pytest-asyncio 1753s python3-pytest-django python3-sniffio python3-sqlalchemy python3-sqlparse 1753s python3-starlette python3-werkzeug 1753s Suggested packages: 1753s python-cachelib-doc bpython3 geoip-database-contrib gettext ipython3 1753s libgdal20 libsqlite3-mod-spatialite python-django-doc python3-bcrypt 1753s python3-flup python3-memcache python3-mysqldb python3-pil python3-psycopg2 1753s python3-selenium python3-sqlite python3-dotenv python-flask-doc 1753s python-greenlet-dev python-greenlet-doc python-sqlalchemy-doc python3-fdb 1753s python3-pymssql python3-asyncpg python3-aiosqlite python-sqlparse-doc 1753s python3-databases python-werkzeug-doc python3-lxml python3-watchdog 1753s Recommended packages: 1753s javascript-common python3-simplejson python3-sqlalchemy-ext python3-uvicorn 1753s | python3-daphne python3-aiofiles python3-multipart python3-pyinotify 1753s The following NEW packages will be installed: 1753s autopkgtest-satdep libjs-jquery python3-all python3-anyio python3-asgiref 1753s python3-async-generator python3-authlib python3-cachelib python3-click 1753s python3-colorama python3-django python3-flask python3-flask-sqlalchemy 1753s python3-greenlet python3-h11 python3-httpcore python3-httpx 1753s python3-iniconfig python3-itsdangerous python3-packaging python3-pluggy 1753s python3-pycryptodome python3-pytest python3-pytest-asyncio 1753s python3-pytest-django python3-sniffio python3-sqlalchemy python3-sqlparse 1753s python3-starlette python3-werkzeug 1754s 0 upgraded, 30 newly installed, 0 to remove and 0 not upgraded. 1754s Need to get 6793 kB/6794 kB of archives. 1754s After this operation, 46.1 MB of additional disk space will be used. 1754s Get:1 /tmp/autopkgtest.OTPQ1i/1-autopkgtest-satdep.deb autopkgtest-satdep arm64 0 [812 B] 1754s Get:2 http://ftpmaster.internal/ubuntu oracular/main arm64 libjs-jquery all 3.6.1+dfsg+~3.5.14-1 [328 kB] 1754s Get:3 http://ftpmaster.internal/ubuntu oracular/main arm64 python3-all arm64 3.12.3-0ubuntu1 [888 B] 1754s Get:4 http://ftpmaster.internal/ubuntu oracular/universe arm64 python3-sniffio all 1.3.1-1 [7262 B] 1754s Get:5 http://ftpmaster.internal/ubuntu oracular/universe arm64 python3-anyio all 4.3.0-1 [56.6 kB] 1754s Get:6 http://ftpmaster.internal/ubuntu oracular/main arm64 python3-asgiref all 3.8.1-1 [24.8 kB] 1754s Get:7 http://ftpmaster.internal/ubuntu oracular/universe arm64 python3-async-generator all 1.10-4 [17.5 kB] 1754s Get:8 http://ftpmaster.internal/ubuntu oracular/universe arm64 python3-pycryptodome arm64 3.20.0+dfsg-1 [1088 kB] 1755s Get:9 http://ftpmaster.internal/ubuntu oracular/universe arm64 python3-authlib all 1.3.1-1 [112 kB] 1755s Get:10 http://ftpmaster.internal/ubuntu oracular/universe arm64 python3-cachelib all 0.13.0-2 [20.7 kB] 1755s Get:11 http://ftpmaster.internal/ubuntu oracular/main arm64 python3-colorama all 0.4.6-4 [32.1 kB] 1755s Get:12 http://ftpmaster.internal/ubuntu oracular/main arm64 python3-click all 8.1.7-1 [79.1 kB] 1755s Get:13 http://ftpmaster.internal/ubuntu oracular/main arm64 python3-sqlparse all 0.5.0-1 [32.4 kB] 1755s Get:14 http://ftpmaster.internal/ubuntu oracular/main arm64 python3-django all 3:4.2.13-1 [2919 kB] 1755s Get:15 http://ftpmaster.internal/ubuntu oracular/main arm64 python3-itsdangerous all 2.2.0-1 [15.2 kB] 1755s Get:16 http://ftpmaster.internal/ubuntu oracular/main arm64 python3-werkzeug all 3.0.3-1 [170 kB] 1755s Get:17 http://ftpmaster.internal/ubuntu oracular/main arm64 python3-flask all 3.0.3-1ubuntu1 [83.2 kB] 1755s Get:18 http://ftpmaster.internal/ubuntu oracular/main arm64 python3-greenlet arm64 3.0.3-0ubuntu5 [153 kB] 1755s Get:19 http://ftpmaster.internal/ubuntu oracular/main arm64 python3-sqlalchemy all 1.4.50+ds1-1build1 [1020 kB] 1755s Get:20 http://ftpmaster.internal/ubuntu oracular/universe arm64 python3-flask-sqlalchemy all 3.0.3-1 [30.9 kB] 1755s Get:21 http://ftpmaster.internal/ubuntu oracular/universe arm64 python3-h11 all 0.14.0-1 [51.1 kB] 1755s Get:22 http://ftpmaster.internal/ubuntu oracular/universe arm64 python3-httpcore all 1.0.4-1 [38.8 kB] 1755s Get:23 http://ftpmaster.internal/ubuntu oracular-proposed/universe arm64 python3-httpx all 0.27.0-1 [60.9 kB] 1756s Get:24 http://ftpmaster.internal/ubuntu oracular/universe arm64 python3-iniconfig all 1.1.1-2 [6024 B] 1756s Get:25 http://ftpmaster.internal/ubuntu oracular/main arm64 python3-packaging all 24.0-1 [41.1 kB] 1756s Get:26 http://ftpmaster.internal/ubuntu oracular/universe arm64 python3-pluggy all 1.5.0-1 [21.0 kB] 1756s Get:27 http://ftpmaster.internal/ubuntu oracular/universe arm64 python3-pytest all 7.4.4-1 [305 kB] 1756s Get:28 http://ftpmaster.internal/ubuntu oracular/universe arm64 python3-pytest-asyncio all 0.20.3-1.3 [10.7 kB] 1756s Get:29 http://ftpmaster.internal/ubuntu oracular/universe arm64 python3-pytest-django all 4.5.2-3 [18.5 kB] 1756s Get:30 http://ftpmaster.internal/ubuntu oracular/universe arm64 python3-starlette all 0.31.1-1 [49.4 kB] 1757s Fetched 6793 kB in 2s (3124 kB/s) 1757s Selecting previously unselected package libjs-jquery. 1757s (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 ... 78264 files and directories currently installed.) 1757s Preparing to unpack .../00-libjs-jquery_3.6.1+dfsg+~3.5.14-1_all.deb ... 1758s Unpacking libjs-jquery (3.6.1+dfsg+~3.5.14-1) ... 1758s Selecting previously unselected package python3-all. 1758s Preparing to unpack .../01-python3-all_3.12.3-0ubuntu1_arm64.deb ... 1758s Unpacking python3-all (3.12.3-0ubuntu1) ... 1758s Selecting previously unselected package python3-sniffio. 1759s Preparing to unpack .../02-python3-sniffio_1.3.1-1_all.deb ... 1759s Unpacking python3-sniffio (1.3.1-1) ... 1759s Selecting previously unselected package python3-anyio. 1759s Preparing to unpack .../03-python3-anyio_4.3.0-1_all.deb ... 1759s Unpacking python3-anyio (4.3.0-1) ... 1759s Selecting previously unselected package python3-asgiref. 1760s Preparing to unpack .../04-python3-asgiref_3.8.1-1_all.deb ... 1760s Unpacking python3-asgiref (3.8.1-1) ... 1760s Selecting previously unselected package python3-async-generator. 1760s Preparing to unpack .../05-python3-async-generator_1.10-4_all.deb ... 1760s Unpacking python3-async-generator (1.10-4) ... 1760s Selecting previously unselected package python3-pycryptodome. 1761s Preparing to unpack .../06-python3-pycryptodome_3.20.0+dfsg-1_arm64.deb ... 1761s Unpacking python3-pycryptodome (3.20.0+dfsg-1) ... 1761s Selecting previously unselected package python3-authlib. 1762s Preparing to unpack .../07-python3-authlib_1.3.1-1_all.deb ... 1762s Unpacking python3-authlib (1.3.1-1) ... 1762s Selecting previously unselected package python3-cachelib. 1762s Preparing to unpack .../08-python3-cachelib_0.13.0-2_all.deb ... 1762s Unpacking python3-cachelib (0.13.0-2) ... 1762s Selecting previously unselected package python3-colorama. 1763s Preparing to unpack .../09-python3-colorama_0.4.6-4_all.deb ... 1763s Unpacking python3-colorama (0.4.6-4) ... 1763s Selecting previously unselected package python3-click. 1764s Preparing to unpack .../10-python3-click_8.1.7-1_all.deb ... 1764s Unpacking python3-click (8.1.7-1) ... 1764s Selecting previously unselected package python3-sqlparse. 1764s Preparing to unpack .../11-python3-sqlparse_0.5.0-1_all.deb ... 1764s Unpacking python3-sqlparse (0.5.0-1) ... 1764s Selecting previously unselected package python3-django. 1767s Preparing to unpack .../12-python3-django_3%3a4.2.13-1_all.deb ... 1767s Unpacking python3-django (3:4.2.13-1) ... 1770s Selecting previously unselected package python3-itsdangerous. 1770s Preparing to unpack .../13-python3-itsdangerous_2.2.0-1_all.deb ... 1770s Unpacking python3-itsdangerous (2.2.0-1) ... 1771s Selecting previously unselected package python3-werkzeug. 1771s Preparing to unpack .../14-python3-werkzeug_3.0.3-1_all.deb ... 1771s Unpacking python3-werkzeug (3.0.3-1) ... 1771s Selecting previously unselected package python3-flask. 1771s Preparing to unpack .../15-python3-flask_3.0.3-1ubuntu1_all.deb ... 1771s Unpacking python3-flask (3.0.3-1ubuntu1) ... 1771s Selecting previously unselected package python3-greenlet. 1772s Preparing to unpack .../16-python3-greenlet_3.0.3-0ubuntu5_arm64.deb ... 1772s Unpacking python3-greenlet (3.0.3-0ubuntu5) ... 1772s Selecting previously unselected package python3-sqlalchemy. 1772s Preparing to unpack .../17-python3-sqlalchemy_1.4.50+ds1-1build1_all.deb ... 1772s Unpacking python3-sqlalchemy (1.4.50+ds1-1build1) ... 1772s Selecting previously unselected package python3-flask-sqlalchemy. 1774s Preparing to unpack .../18-python3-flask-sqlalchemy_3.0.3-1_all.deb ... 1774s Unpacking python3-flask-sqlalchemy (3.0.3-1) ... 1774s Selecting previously unselected package python3-h11. 1776s Preparing to unpack .../19-python3-h11_0.14.0-1_all.deb ... 1776s Unpacking python3-h11 (0.14.0-1) ... 1776s Selecting previously unselected package python3-httpcore. 1776s Preparing to unpack .../20-python3-httpcore_1.0.4-1_all.deb ... 1776s Unpacking python3-httpcore (1.0.4-1) ... 1776s Selecting previously unselected package python3-httpx. 1776s Preparing to unpack .../21-python3-httpx_0.27.0-1_all.deb ... 1776s Unpacking python3-httpx (0.27.0-1) ... 1777s Selecting previously unselected package python3-iniconfig. 1777s Preparing to unpack .../22-python3-iniconfig_1.1.1-2_all.deb ... 1777s Unpacking python3-iniconfig (1.1.1-2) ... 1777s Selecting previously unselected package python3-packaging. 1777s Preparing to unpack .../23-python3-packaging_24.0-1_all.deb ... 1777s Unpacking python3-packaging (24.0-1) ... 1777s Selecting previously unselected package python3-pluggy. 1777s Preparing to unpack .../24-python3-pluggy_1.5.0-1_all.deb ... 1777s Unpacking python3-pluggy (1.5.0-1) ... 1777s Selecting previously unselected package python3-pytest. 1777s Preparing to unpack .../25-python3-pytest_7.4.4-1_all.deb ... 1777s Unpacking python3-pytest (7.4.4-1) ... 1777s Selecting previously unselected package python3-pytest-asyncio. 1777s Preparing to unpack .../26-python3-pytest-asyncio_0.20.3-1.3_all.deb ... 1777s Unpacking python3-pytest-asyncio (0.20.3-1.3) ... 1777s Selecting previously unselected package python3-pytest-django. 1777s Preparing to unpack .../27-python3-pytest-django_4.5.2-3_all.deb ... 1777s Unpacking python3-pytest-django (4.5.2-3) ... 1777s Selecting previously unselected package python3-starlette. 1777s Preparing to unpack .../28-python3-starlette_0.31.1-1_all.deb ... 1777s Unpacking python3-starlette (0.31.1-1) ... 1777s Selecting previously unselected package autopkgtest-satdep. 1778s Preparing to unpack .../29-1-autopkgtest-satdep.deb ... 1778s Unpacking autopkgtest-satdep (0) ... 1778s Setting up python3-iniconfig (1.1.1-2) ... 1778s Setting up python3-sniffio (1.3.1-1) ... 1778s Setting up python3-async-generator (1.10-4) ... 1778s Setting up python3-anyio (4.3.0-1) ... 1778s Setting up python3-colorama (0.4.6-4) ... 1779s Setting up python3-pycryptodome (3.20.0+dfsg-1) ... 1779s Setting up python3-itsdangerous (2.2.0-1) ... 1779s Setting up python3-all (3.12.3-0ubuntu1) ... 1779s Setting up python3-starlette (0.31.1-1) ... 1780s Setting up python3-click (8.1.7-1) ... 1780s Setting up python3-packaging (24.0-1) ... 1780s Setting up python3-sqlparse (0.5.0-1) ... 1780s Setting up python3-greenlet (3.0.3-0ubuntu5) ... 1781s Setting up python3-h11 (0.14.0-1) ... 1782s Setting up python3-pluggy (1.5.0-1) ... 1782s Setting up python3-cachelib (0.13.0-2) ... 1783s Setting up libjs-jquery (3.6.1+dfsg+~3.5.14-1) ... 1783s Setting up python3-asgiref (3.8.1-1) ... 1783s Setting up python3-authlib (1.3.1-1) ... 1783s Setting up python3-httpcore (1.0.4-1) ... 1783s Setting up python3-django (3:4.2.13-1) ... 1785s Setting up python3-pytest (7.4.4-1) ... 1786s Setting up python3-pytest-django (4.5.2-3) ... 1786s Setting up python3-sqlalchemy (1.4.50+ds1-1build1) ... 1787s Setting up python3-httpx (0.27.0-1) ... 1788s Setting up python3-werkzeug (3.0.3-1) ... 1788s Setting up python3-pytest-asyncio (0.20.3-1.3) ... 1788s Setting up python3-flask (3.0.3-1ubuntu1) ... 1788s Setting up python3-flask-sqlalchemy (3.0.3-1) ... 1789s Setting up autopkgtest-satdep (0) ... 1789s Processing triggers for man-db (2.12.1-2) ... 1795s (Reading database ... 86098 files and directories currently installed.) 1795s Removing autopkgtest-satdep (0) ... 1796s autopkgtest [10:51:45]: test unittests3: [----------------------- 1796s === python3.12 === 1797s ============================= test session starts ============================== 1797s platform linux -- Python 3.12.4, pytest-7.4.4, pluggy-1.5.0 1797s rootdir: /tmp/autopkgtest.OTPQ1i/autopkgtest_tmp 1797s configfile: setup.cfg 1797s plugins: asyncio-0.20.3, django-4.5.2, anyio-4.3.0 1797s asyncio: mode=Mode.STRICT 1797s collected 101 items 1797s 1797s tests/core/test_oauth2/test_rfc6749_misc.py ...... [ 5%] 1798s tests/core/test_oauth2/test_rfc7523.py ........................ [ 29%] 1798s tests/core/test_oauth2/test_rfc7591.py ...... [ 35%] 1798s tests/core/test_oauth2/test_rfc7662.py ...... [ 41%] 1798s tests/core/test_oauth2/test_rfc8414.py .......................... [ 67%] 1798s tests/core/test_oidc/test_core.py .......... [ 77%] 1798s tests/core/test_oidc/test_discovery.py ....................... [100%] 1798s 1798s ============================= 101 passed in 1.58s ============================== 1800s ============================= test session starts ============================== 1800s platform linux -- Python 3.12.4, pytest-7.4.4, pluggy-1.5.0 1800s django: settings: tests.clients.test_django.settings (from env) 1800s rootdir: /tmp/autopkgtest.OTPQ1i/autopkgtest_tmp 1800s configfile: setup.cfg 1800s plugins: asyncio-0.20.3, django-4.5.2, anyio-4.3.0 1800s asyncio: mode=Mode.STRICT 1800s collected 167 items 1800s 1800s tests/clients/test_django/test_oauth_client.py ............. [ 7%] 1800s tests/clients/test_flask/test_oauth_client.py .................... [ 19%] 1801s tests/clients/test_flask/test_user_mixin.py ..... [ 22%] 1801s tests/clients/test_httpx/test_assertion_client.py .. [ 23%] 1801s tests/clients/test_httpx/test_async_assertion_client.py F. [ 25%] 1808s tests/clients/test_httpx/test_async_oauth1_client.py FFFFFFF [ 29%] 1818s tests/clients/test_httpx/test_async_oauth2_client.py FFFFFFss...FFFFFFF. [ 40%] 1820s FFFFF. [ 44%] 1820s tests/clients/test_httpx/test_oauth1_client.py ....... [ 48%] 1821s tests/clients/test_httpx/test_oauth2_client.py ...................... [ 61%] 1821s tests/clients/test_requests/test_assertion_session.py .. [ 62%] 1821s tests/clients/test_requests/test_oauth1_session.py ................ [ 72%] 1821s tests/clients/test_requests/test_oauth2_session.py ..................... [ 85%] 1821s ......... [ 90%] 1824s tests/clients/test_starlette/test_oauth_client.py ...FF.FFFF.F [ 97%] 1824s tests/clients/test_starlette/test_user_mixin.py F..F [100%] 1824s 1824s =================================== FAILURES =================================== 1824s ______________________________ test_refresh_token ______________________________ 1824s 1824s @contextlib.contextmanager 1824s def map_httpcore_exceptions() -> typing.Iterator[None]: 1824s try: 1824s > yield 1824s 1824s /usr/lib/python3/dist-packages/httpx/_transports/default.py:69: 1824s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1824s /usr/lib/python3/dist-packages/httpx/_transports/default.py:373: in handle_async_request 1824s resp = await self._pool.handle_async_request(req) 1824s /usr/lib/python3/dist-packages/httpcore/_async/connection_pool.py:216: in handle_async_request 1824s raise exc from None 1824s /usr/lib/python3/dist-packages/httpcore/_async/connection_pool.py:196: in handle_async_request 1824s response = await connection.handle_async_request( 1824s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1824s 1824s self = 1824s request = 1824s 1824s async def handle_async_request(self, request: Request) -> Response: 1824s timeouts = request.extensions.get("timeout", {}) 1824s timeout = timeouts.get("connect", None) 1824s 1824s async with self._connect_lock: 1824s if not self._connected: 1824s target = b"%b:%d" % (self._remote_origin.host, self._remote_origin.port) 1824s 1824s connect_url = URL( 1824s scheme=self._proxy_origin.scheme, 1824s host=self._proxy_origin.host, 1824s port=self._proxy_origin.port, 1824s target=target, 1824s ) 1824s connect_headers = merge_headers( 1824s [(b"Host", target), (b"Accept", b"*/*")], self._proxy_headers 1824s ) 1824s connect_request = Request( 1824s method=b"CONNECT", 1824s url=connect_url, 1824s headers=connect_headers, 1824s extensions=request.extensions, 1824s ) 1824s connect_response = await self._connection.handle_async_request( 1824s connect_request 1824s ) 1824s 1824s if connect_response.status < 200 or connect_response.status > 299: 1824s reason_bytes = connect_response.extensions.get("reason_phrase", b"") 1824s reason_str = reason_bytes.decode("ascii", errors="ignore") 1824s msg = "%d %s" % (connect_response.status, reason_str) 1824s await self._connection.aclose() 1824s > raise ProxyError(msg) 1824s E httpcore.ProxyError: 503 Service Unavailable 1824s 1824s /usr/lib/python3/dist-packages/httpcore/_async/http_proxy.py:298: ProxyError 1824s 1824s The above exception was the direct cause of the following exception: 1824s 1824s @pytest.mark.asyncio 1824s async def test_refresh_token(): 1824s async def verifier(request): 1824s content = await request.body() 1824s if str(request.url) == 'https://i.b/token': 1824s assert b'assertion=' in content 1824s 1824s async with AsyncAssertionClient( 1824s 'https://i.b/token', 1824s grant_type=AsyncAssertionClient.JWT_BEARER_GRANT_TYPE, 1824s issuer='foo', 1824s subject='foo', 1824s audience='foo', 1824s alg='HS256', 1824s key='secret', 1824s app=AsyncMockDispatch(default_token, assert_func=verifier) 1824s ) as client: 1824s > await client.get('https://i.b') 1824s 1824s tests/clients/test_httpx/test_async_assertion_client.py:33: 1824s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1824s /usr/lib/python3/dist-packages/httpx/_client.py:1801: in get 1824s return await self.request( 1824s /usr/lib/python3/dist-packages/authlib/integrations/httpx_client/assertion_client.py:38: in request 1824s await self.refresh_token() 1824s /usr/lib/python3/dist-packages/authlib/integrations/httpx_client/assertion_client.py:45: in _refresh_token 1824s resp = await self.request( 1824s /usr/lib/python3/dist-packages/authlib/integrations/httpx_client/assertion_client.py:41: in request 1824s return await super().request( 1824s /usr/lib/python3/dist-packages/httpx/_client.py:1574: in request 1824s return await self.send(request, auth=auth, follow_redirects=follow_redirects) 1824s /usr/lib/python3/dist-packages/httpx/_client.py:1661: in send 1824s response = await self._send_handling_auth( 1824s /usr/lib/python3/dist-packages/httpx/_client.py:1689: in _send_handling_auth 1824s response = await self._send_handling_redirects( 1824s /usr/lib/python3/dist-packages/httpx/_client.py:1726: in _send_handling_redirects 1824s response = await self._send_single_request(request) 1824s /usr/lib/python3/dist-packages/httpx/_client.py:1763: in _send_single_request 1824s response = await transport.handle_async_request(request) 1824s /usr/lib/python3/dist-packages/httpx/_transports/default.py:372: in handle_async_request 1824s with map_httpcore_exceptions(): 1824s /usr/lib/python3.12/contextlib.py:158: in __exit__ 1824s self.gen.throw(value) 1824s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1824s 1824s @contextlib.contextmanager 1824s def map_httpcore_exceptions() -> typing.Iterator[None]: 1824s try: 1824s yield 1824s except Exception as exc: 1824s mapped_exc = None 1824s 1824s for from_exc, to_exc in HTTPCORE_EXC_MAP.items(): 1824s if not isinstance(exc, from_exc): 1824s continue 1824s # We want to map to the most specific exception we can find. 1824s # Eg if `exc` is an `httpcore.ReadTimeout`, we want to map to 1824s # `httpx.ReadTimeout`, not just `httpx.TimeoutException`. 1824s if mapped_exc is None or issubclass(to_exc, mapped_exc): 1824s mapped_exc = to_exc 1824s 1824s if mapped_exc is None: # pragma: no cover 1824s raise 1824s 1824s message = str(exc) 1824s > raise mapped_exc(message) from exc 1824s E httpx.ProxyError: 503 Service Unavailable 1824s 1824s /usr/lib/python3/dist-packages/httpx/_transports/default.py:86: ProxyError 1824s _____________________ test_fetch_request_token_via_header ______________________ 1824s 1824s @pytest.mark.asyncio 1824s async def test_fetch_request_token_via_header(): 1824s request_token = {'oauth_token': '1', 'oauth_token_secret': '2'} 1824s 1824s async def assert_func(request): 1824s auth_header = request.headers.get('authorization') 1824s assert 'oauth_consumer_key="id"' in auth_header 1824s assert 'oauth_signature=' in auth_header 1824s 1824s app = AsyncMockDispatch(request_token, assert_func=assert_func) 1824s async with AsyncOAuth1Client('id', 'secret', app=app) as client: 1824s > response = await client.fetch_request_token(oauth_url) 1824s 1824s tests/clients/test_httpx/test_async_oauth1_client.py:24: 1824s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1824s /usr/lib/python3/dist-packages/authlib/integrations/httpx_client/oauth1_client.py:70: in _fetch_token 1824s token = self.parse_response_token(resp.status_code, to_unicode(text)) 1824s /usr/lib/python3/dist-packages/authlib/oauth1/client.py:152: in parse_response_token 1824s self.handle_error('fetch_token_denied', message) 1824s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1824s 1824s error_type = 'fetch_token_denied' 1824s error_description = 'Token request failed with code 404, response was \'\n\n\t\t\n\t\n\n\'.' 1824s 1824s @staticmethod 1824s def handle_error(error_type, error_description): 1824s > raise OAuthError(error_type, error_description) 1824s E authlib.integrations.base_client.errors.OAuthError: fetch_token_denied: Token request failed with code 404, response was ' 1824s E 1824s E 1824s E 1824s E 404 - Not Found 1824s E 1824s E 1824s E

404 - Not Found

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

404 - Not Found

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

404 - Not Found

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

404 - Not Found

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

More information...

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