0s autopkgtest [10:21:48]: starting date and time: 2024-06-16 10:21:48+0000 0s autopkgtest [10:21:48]: git checkout: 433ed4cb Merge branch 'skia/nova_flock' into 'ubuntu/5.34+prod' 0s autopkgtest [10:21:48]: host juju-7f2275-prod-proposed-migration-environment-3; command line: /home/ubuntu/autopkgtest/runner/autopkgtest --output-dir /tmp/autopkgtest-work.rdh_n4h5/out --timeout-copy=6000 --setup-commands /home/ubuntu/autopkgtest-cloud/worker-config-production/setup-canonical.sh --apt-pocket=proposed=src:flask-sqlalchemy,src:httpx --apt-upgrade python-authlib --timeout-short=300 --timeout-copy=20000 --timeout-build=20000 '--env=ADT_TEST_TRIGGERS=flask-sqlalchemy/3.1.1-2 httpx/0.27.0-1' -- ssh -s /home/ubuntu/autopkgtest/ssh-setup/nova -- --flavor autopkgtest --security-groups autopkgtest-juju-7f2275-prod-proposed-migration-environment-3@bos02-ppc64el-19.secgroup --name adt-oracular-ppc64el-python-authlib-20240616-102147-juju-7f2275-prod-proposed-migration-environment-3-ae98d50a-5307-4ab5-b513-31b29513cce1 --image adt/ubuntu-oracular-ppc64el-server --keyname testbed-juju-7f2275-prod-proposed-migration-environment-3 --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/ 176s autopkgtest [10:24:44]: testbed dpkg architecture: ppc64el 177s autopkgtest [10:24:45]: testbed apt version: 2.9.3 177s autopkgtest [10:24:45]: @@@@@@@@@@@@@@@@@@@@ test bed setup 178s Get:1 http://ftpmaster.internal/ubuntu oracular-proposed InRelease [110 kB] 178s Get:2 http://ftpmaster.internal/ubuntu oracular-proposed/restricted Sources [7052 B] 178s Get:3 http://ftpmaster.internal/ubuntu oracular-proposed/multiverse Sources [2576 B] 178s Get:4 http://ftpmaster.internal/ubuntu oracular-proposed/universe Sources [389 kB] 178s Get:5 http://ftpmaster.internal/ubuntu oracular-proposed/main Sources [36.1 kB] 178s Get:6 http://ftpmaster.internal/ubuntu oracular-proposed/main ppc64el Packages [42.8 kB] 178s Get:7 http://ftpmaster.internal/ubuntu oracular-proposed/restricted ppc64el Packages [1860 B] 178s Get:8 http://ftpmaster.internal/ubuntu oracular-proposed/universe ppc64el Packages [312 kB] 178s Get:9 http://ftpmaster.internal/ubuntu oracular-proposed/multiverse ppc64el Packages [2532 B] 178s Fetched 905 kB in 1s (1045 kB/s) 178s Reading package lists... 181s Reading package lists... 181s Building dependency tree... 181s Reading state information... 181s Calculating upgrade... 182s The following packages will be upgraded: 182s apt apt-utils dracut-install libapt-pkg6.0t64 libc-bin libc-dev-bin 182s libc-devtools libc6 libc6-dev libldap-common libldap2 libnss3 locales 182s python3-certifi ubuntu-pro-client ubuntu-pro-client-l10n 182s 16 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 182s Need to get 15.6 MB of archives. 182s After this operation, 122 kB disk space will be freed. 182s Get:1 http://ftpmaster.internal/ubuntu oracular/main ppc64el libc-devtools ppc64el 2.39-0ubuntu9 [29.6 kB] 182s Get:2 http://ftpmaster.internal/ubuntu oracular/main ppc64el libc6-dev ppc64el 2.39-0ubuntu9 [2102 kB] 182s Get:3 http://ftpmaster.internal/ubuntu oracular/main ppc64el libc-dev-bin ppc64el 2.39-0ubuntu9 [21.3 kB] 182s Get:4 http://ftpmaster.internal/ubuntu oracular/main ppc64el libc6 ppc64el 2.39-0ubuntu9 [3275 kB] 182s Get:5 http://ftpmaster.internal/ubuntu oracular/main ppc64el libc-bin ppc64el 2.39-0ubuntu9 [751 kB] 182s Get:6 http://ftpmaster.internal/ubuntu oracular/main ppc64el libapt-pkg6.0t64 ppc64el 2.9.5 [1099 kB] 182s Get:7 http://ftpmaster.internal/ubuntu oracular/main ppc64el apt ppc64el 2.9.5 [1428 kB] 183s Get:8 http://ftpmaster.internal/ubuntu oracular/main ppc64el apt-utils ppc64el 2.9.5 [231 kB] 183s Get:9 http://ftpmaster.internal/ubuntu oracular/main ppc64el locales all 2.39-0ubuntu9 [4235 kB] 183s Get:10 http://ftpmaster.internal/ubuntu oracular/main ppc64el ubuntu-pro-client-l10n ppc64el 32.3.1 [19.4 kB] 183s Get:11 http://ftpmaster.internal/ubuntu oracular/main ppc64el ubuntu-pro-client ppc64el 32.3.1 [229 kB] 183s Get:12 http://ftpmaster.internal/ubuntu oracular/main ppc64el dracut-install ppc64el 102-3ubuntu2 [35.9 kB] 183s Get:13 http://ftpmaster.internal/ubuntu oracular/main ppc64el libldap-common all 2.6.7+dfsg-1~exp1ubuntu9 [31.5 kB] 183s Get:14 http://ftpmaster.internal/ubuntu oracular/main ppc64el libldap2 ppc64el 2.6.7+dfsg-1~exp1ubuntu9 [231 kB] 183s Get:15 http://ftpmaster.internal/ubuntu oracular/main ppc64el libnss3 ppc64el 2:3.101-1 [1749 kB] 183s Get:16 http://ftpmaster.internal/ubuntu oracular/main ppc64el python3-certifi all 2024.6.2-1 [160 kB] 183s Preconfiguring packages ... 183s Fetched 15.6 MB in 1s (14.1 MB/s) 183s (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 ... 72666 files and directories currently installed.) 183s Preparing to unpack .../libc-devtools_2.39-0ubuntu9_ppc64el.deb ... 183s Unpacking libc-devtools (2.39-0ubuntu9) over (2.39-0ubuntu8.1) ... 183s Preparing to unpack .../libc6-dev_2.39-0ubuntu9_ppc64el.deb ... 183s Unpacking libc6-dev:ppc64el (2.39-0ubuntu9) over (2.39-0ubuntu8.1) ... 183s Preparing to unpack .../libc-dev-bin_2.39-0ubuntu9_ppc64el.deb ... 183s Unpacking libc-dev-bin (2.39-0ubuntu9) over (2.39-0ubuntu8.1) ... 183s Preparing to unpack .../libc6_2.39-0ubuntu9_ppc64el.deb ... 184s Unpacking libc6:ppc64el (2.39-0ubuntu9) over (2.39-0ubuntu8.1) ... 184s Setting up libc6:ppc64el (2.39-0ubuntu9) ... 185s (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 ... 72666 files and directories currently installed.) 185s Preparing to unpack .../libc-bin_2.39-0ubuntu9_ppc64el.deb ... 185s Unpacking libc-bin (2.39-0ubuntu9) over (2.39-0ubuntu8.1) ... 185s Setting up libc-bin (2.39-0ubuntu9) ... 185s (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 ... 72666 files and directories currently installed.) 185s Preparing to unpack .../libapt-pkg6.0t64_2.9.5_ppc64el.deb ... 185s Unpacking libapt-pkg6.0t64:ppc64el (2.9.5) over (2.9.3) ... 185s Setting up libapt-pkg6.0t64:ppc64el (2.9.5) ... 185s (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 ... 72666 files and directories currently installed.) 185s Preparing to unpack .../archives/apt_2.9.5_ppc64el.deb ... 185s Unpacking apt (2.9.5) over (2.9.3) ... 185s Setting up apt (2.9.5) ... 186s (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 ... 72666 files and directories currently installed.) 186s Preparing to unpack .../0-apt-utils_2.9.5_ppc64el.deb ... 186s Unpacking apt-utils (2.9.5) over (2.9.3) ... 186s Preparing to unpack .../1-locales_2.39-0ubuntu9_all.deb ... 186s Unpacking locales (2.39-0ubuntu9) over (2.39-0ubuntu8.1) ... 186s Preparing to unpack .../2-ubuntu-pro-client-l10n_32.3.1_ppc64el.deb ... 186s Unpacking ubuntu-pro-client-l10n (32.3.1) over (32.3) ... 186s Preparing to unpack .../3-ubuntu-pro-client_32.3.1_ppc64el.deb ... 186s Unpacking ubuntu-pro-client (32.3.1) over (32.3) ... 186s Preparing to unpack .../4-dracut-install_102-3ubuntu2_ppc64el.deb ... 186s Unpacking dracut-install (102-3ubuntu2) over (102-3ubuntu1) ... 186s Preparing to unpack .../5-libldap-common_2.6.7+dfsg-1~exp1ubuntu9_all.deb ... 186s Unpacking libldap-common (2.6.7+dfsg-1~exp1ubuntu9) over (2.6.7+dfsg-1~exp1ubuntu8) ... 186s Preparing to unpack .../6-libldap2_2.6.7+dfsg-1~exp1ubuntu9_ppc64el.deb ... 186s Unpacking libldap2:ppc64el (2.6.7+dfsg-1~exp1ubuntu9) over (2.6.7+dfsg-1~exp1ubuntu8) ... 186s Preparing to unpack .../7-libnss3_2%3a3.101-1_ppc64el.deb ... 186s Unpacking libnss3:ppc64el (2:3.101-1) over (2:3.100-1) ... 186s Preparing to unpack .../8-python3-certifi_2024.6.2-1_all.deb ... 186s Unpacking python3-certifi (2024.6.2-1) over (2023.11.17-1) ... 186s Setting up apt-utils (2.9.5) ... 186s Setting up libnss3:ppc64el (2:3.101-1) ... 186s Setting up locales (2.39-0ubuntu9) ... 187s Generating locales (this might take a while)... 188s en_US.UTF-8... done 188s Generation complete. 188s Setting up libldap-common (2.6.7+dfsg-1~exp1ubuntu9) ... 188s Setting up python3-certifi (2024.6.2-1) ... 189s Setting up dracut-install (102-3ubuntu2) ... 189s Setting up libc-dev-bin (2.39-0ubuntu9) ... 189s Setting up ubuntu-pro-client (32.3.1) ... 189s Installing new version of config file /etc/apparmor.d/ubuntu_pro_esm_cache ... 191s Setting up libldap2:ppc64el (2.6.7+dfsg-1~exp1ubuntu9) ... 191s Setting up libc-devtools (2.39-0ubuntu9) ... 191s Setting up ubuntu-pro-client-l10n (32.3.1) ... 191s Setting up libc6-dev:ppc64el (2.39-0ubuntu9) ... 191s Processing triggers for man-db (2.12.1-2) ... 192s Processing triggers for libc-bin (2.39-0ubuntu9) ... 193s Reading package lists... 193s Building dependency tree... 193s Reading state information... 194s 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 194s Hit:1 http://ftpmaster.internal/ubuntu oracular-proposed InRelease 194s Hit:2 http://ftpmaster.internal/ubuntu oracular InRelease 194s Hit:3 http://ftpmaster.internal/ubuntu oracular-updates InRelease 194s Hit:4 http://ftpmaster.internal/ubuntu oracular-security InRelease 195s Reading package lists... 195s Reading package lists... 196s Building dependency tree... 196s Reading state information... 196s Calculating upgrade... 196s 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 196s Reading package lists... 196s Building dependency tree... 196s Reading state information... 196s 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 197s autopkgtest [10:25:05]: rebooting testbed after setup commands that affected boot 231s autopkgtest-virt-ssh: WARNING: ssh connection failed. Retrying in 3 seconds... 241s autopkgtest-virt-ssh: WARNING: ssh connection failed. Retrying in 3 seconds... 247s autopkgtest [10:25:55]: testbed running kernel: Linux 6.8.0-31-generic #31-Ubuntu SMP Sat Apr 20 00:05:55 UTC 2024 250s autopkgtest [10:25:58]: @@@@@@@@@@@@@@@@@@@@ apt-source python-authlib 252s Get:1 http://ftpmaster.internal/ubuntu oracular/universe python-authlib 1.3.1-1 (dsc) [2494 B] 252s Get:2 http://ftpmaster.internal/ubuntu oracular/universe python-authlib 1.3.1-1 (tar) [320 kB] 252s Get:3 http://ftpmaster.internal/ubuntu oracular/universe python-authlib 1.3.1-1 (diff) [5564 B] 253s gpgv: Signature made Thu Jun 6 10:39:37 2024 UTC 253s gpgv: using EDDSA key EE9AD6F90520FA11F69F4824477B0DB0263A54D8 253s gpgv: issuer "stefanor@debian.org" 253s gpgv: Can't check signature: No public key 253s dpkg-source: warning: cannot verify inline signature for ./python-authlib_1.3.1-1.dsc: no acceptable signature found 253s autopkgtest [10:26:01]: testing package python-authlib version 1.3.1-1 253s autopkgtest [10:26:01]: build not needed 254s autopkgtest [10:26:02]: test unittests3: preparing testbed 255s Reading package lists... 255s Building dependency tree... 255s Reading state information... 255s Starting pkgProblemResolver with broken count: 1 255s Starting 2 pkgProblemResolver with broken count: 1 255s Investigating (0) python3-flask-sqlalchemy:ppc64el < none -> 3.1.1-2 @un puN Ib > 255s Broken python3-flask-sqlalchemy:ppc64el Depends on python3-sqlalchemy:ppc64el < none | 1.4.50+ds1-1build1 @un uH > (>= 2.0.16) 255s Considering python3-sqlalchemy:ppc64el 0 as a solution to python3-flask-sqlalchemy:ppc64el 0 255s Re-Instated python3-greenlet:ppc64el 255s Re-Instated python3-sqlalchemy:ppc64el 255s Done 255s Some packages could not be installed. This may mean that you have 255s requested an impossible situation or if you are using the unstable 255s distribution that some required packages have not yet been created 255s or been moved out of Incoming. 255s The following information may help to resolve the situation: 255s 255s The following packages have unmet dependencies: 255s python3-flask-sqlalchemy : Depends: python3-sqlalchemy (>= 2.0.16) but 1.4.50+ds1-1build1 is to be installed 255s E: Unable to correct problems, you have held broken packages. 255s autopkgtest: WARNING: Test dependencies are unsatisfiable with using apt pinning. Retrying with using all packages from oracular-proposed 256s Reading package lists... 256s Building dependency tree... 256s Reading state information... 256s Starting pkgProblemResolver with broken count: 0 256s Starting 2 pkgProblemResolver with broken count: 0 256s Done 256s The following additional packages will be installed: 256s libjs-jquery python3-all python3-anyio python3-asgiref 256s python3-async-generator python3-authlib python3-cachelib python3-click 256s python3-colorama python3-django python3-flask python3-flask-sqlalchemy 256s python3-greenlet python3-h11 python3-httpcore python3-httpx 256s python3-iniconfig python3-itsdangerous python3-packaging python3-pluggy 256s python3-pycryptodome python3-pytest python3-pytest-asyncio 256s python3-pytest-django python3-sniffio python3-sqlalchemy python3-sqlparse 256s python3-starlette python3-werkzeug 256s Suggested packages: 256s python-cachelib-doc bpython3 geoip-database-contrib gettext ipython3 256s libgdal20 libsqlite3-mod-spatialite python-django-doc python3-bcrypt 256s python3-flup python3-memcache python3-mysqldb python3-pil python3-psycopg2 256s python3-selenium python3-sqlite python3-dotenv python-flask-doc 256s python-greenlet-dev python-greenlet-doc python-sqlalchemy-doc 256s python3-asyncpg python3-pg8000 python3-psycopg2cffi python3-aiosqlite 256s python3-mariadb-connector python3-mysql.connector python3-pyodbc 256s python3-pymssql python3-cx-oracle python3-oracledb python-sqlparse-doc 256s python3-databases python-werkzeug-doc python3-lxml python3-watchdog 256s Recommended packages: 256s javascript-common python3-tz python3-simplejson python3-sqlalchemy-ext 256s python3-uvicorn | python3-daphne python3-aiofiles python3-multipart 256s python3-pyinotify 256s The following NEW packages will be installed: 256s autopkgtest-satdep libjs-jquery python3-all python3-anyio python3-asgiref 256s python3-async-generator python3-authlib python3-cachelib python3-click 256s python3-colorama python3-django python3-flask python3-flask-sqlalchemy 256s python3-greenlet python3-h11 python3-httpcore python3-httpx 256s python3-iniconfig python3-itsdangerous python3-packaging python3-pluggy 256s python3-pycryptodome python3-pytest python3-pytest-asyncio 256s python3-pytest-django python3-sniffio python3-sqlalchemy python3-sqlparse 256s python3-starlette python3-werkzeug 256s 0 upgraded, 30 newly installed, 0 to remove and 30 not upgraded. 256s Need to get 6988 kB/6989 kB of archives. 256s After this operation, 47.9 MB of additional disk space will be used. 256s Get:1 /tmp/autopkgtest.nkCinV/1-autopkgtest-satdep.deb autopkgtest-satdep ppc64el 0 [812 B] 257s Get:2 http://ftpmaster.internal/ubuntu oracular/main ppc64el libjs-jquery all 3.6.1+dfsg+~3.5.14-1 [328 kB] 257s Get:3 http://ftpmaster.internal/ubuntu oracular/main ppc64el python3-all ppc64el 3.12.3-0ubuntu1 [888 B] 257s Get:4 http://ftpmaster.internal/ubuntu oracular/universe ppc64el python3-sniffio all 1.3.1-1 [7262 B] 257s Get:5 http://ftpmaster.internal/ubuntu oracular-proposed/universe ppc64el python3-anyio all 4.4.0-1 [57.4 kB] 257s Get:6 http://ftpmaster.internal/ubuntu oracular/main ppc64el python3-asgiref all 3.8.1-1 [24.8 kB] 257s Get:7 http://ftpmaster.internal/ubuntu oracular/universe ppc64el python3-async-generator all 1.10-4 [17.5 kB] 257s Get:8 http://ftpmaster.internal/ubuntu oracular/universe ppc64el python3-pycryptodome ppc64el 3.20.0+dfsg-1 [1142 kB] 258s Get:9 http://ftpmaster.internal/ubuntu oracular/universe ppc64el python3-authlib all 1.3.1-1 [112 kB] 258s Get:10 http://ftpmaster.internal/ubuntu oracular/universe ppc64el python3-cachelib all 0.13.0-2 [20.7 kB] 258s Get:11 http://ftpmaster.internal/ubuntu oracular/main ppc64el python3-colorama all 0.4.6-4 [32.1 kB] 258s Get:12 http://ftpmaster.internal/ubuntu oracular/main ppc64el python3-click all 8.1.7-1 [79.1 kB] 258s Get:13 http://ftpmaster.internal/ubuntu oracular/main ppc64el python3-sqlparse all 0.5.0-1 [32.4 kB] 258s Get:14 http://ftpmaster.internal/ubuntu oracular/main ppc64el python3-django all 3:4.2.13-1 [2919 kB] 259s Get:15 http://ftpmaster.internal/ubuntu oracular/main ppc64el python3-itsdangerous all 2.2.0-1 [15.2 kB] 259s Get:16 http://ftpmaster.internal/ubuntu oracular/main ppc64el python3-werkzeug all 3.0.3-1 [170 kB] 259s Get:17 http://ftpmaster.internal/ubuntu oracular/main ppc64el python3-flask all 3.0.3-1ubuntu1 [83.2 kB] 259s Get:18 http://ftpmaster.internal/ubuntu oracular/main ppc64el python3-greenlet ppc64el 3.0.3-0ubuntu5 [163 kB] 259s Get:19 http://ftpmaster.internal/ubuntu oracular-proposed/main ppc64el python3-sqlalchemy all 2.0.30+ds1-3 [1204 kB] 259s Get:20 http://ftpmaster.internal/ubuntu oracular-proposed/universe ppc64el python3-flask-sqlalchemy all 3.1.1-2 [30.9 kB] 259s Get:21 http://ftpmaster.internal/ubuntu oracular/universe ppc64el python3-h11 all 0.14.0-1 [51.1 kB] 259s Get:22 http://ftpmaster.internal/ubuntu oracular/universe ppc64el python3-httpcore all 1.0.4-1 [38.8 kB] 259s Get:23 http://ftpmaster.internal/ubuntu oracular-proposed/universe ppc64el python3-httpx all 0.27.0-1 [60.9 kB] 259s Get:24 http://ftpmaster.internal/ubuntu oracular/universe ppc64el python3-iniconfig all 1.1.1-2 [6024 B] 259s Get:25 http://ftpmaster.internal/ubuntu oracular/main ppc64el python3-packaging all 24.0-1 [41.1 kB] 259s Get:26 http://ftpmaster.internal/ubuntu oracular/universe ppc64el python3-pluggy all 1.5.0-1 [21.0 kB] 259s Get:27 http://ftpmaster.internal/ubuntu oracular-proposed/universe ppc64el python3-pytest all 8.2.2-1ubuntu1 [250 kB] 259s Get:28 http://ftpmaster.internal/ubuntu oracular/universe ppc64el python3-pytest-asyncio all 0.20.3-1.3 [10.7 kB] 259s Get:29 http://ftpmaster.internal/ubuntu oracular/universe ppc64el python3-pytest-django all 4.5.2-3 [18.5 kB] 259s Get:30 http://ftpmaster.internal/ubuntu oracular-proposed/universe ppc64el python3-starlette all 0.37.2-1 [50.0 kB] 260s Fetched 6988 kB in 3s (2399 kB/s) 260s Selecting previously unselected package libjs-jquery. 260s (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 ... 72666 files and directories currently installed.) 260s Preparing to unpack .../00-libjs-jquery_3.6.1+dfsg+~3.5.14-1_all.deb ... 260s Unpacking libjs-jquery (3.6.1+dfsg+~3.5.14-1) ... 260s Selecting previously unselected package python3-all. 260s Preparing to unpack .../01-python3-all_3.12.3-0ubuntu1_ppc64el.deb ... 260s Unpacking python3-all (3.12.3-0ubuntu1) ... 260s Selecting previously unselected package python3-sniffio. 260s Preparing to unpack .../02-python3-sniffio_1.3.1-1_all.deb ... 260s Unpacking python3-sniffio (1.3.1-1) ... 260s Selecting previously unselected package python3-anyio. 260s Preparing to unpack .../03-python3-anyio_4.4.0-1_all.deb ... 260s Unpacking python3-anyio (4.4.0-1) ... 260s Selecting previously unselected package python3-asgiref. 260s Preparing to unpack .../04-python3-asgiref_3.8.1-1_all.deb ... 260s Unpacking python3-asgiref (3.8.1-1) ... 260s Selecting previously unselected package python3-async-generator. 260s Preparing to unpack .../05-python3-async-generator_1.10-4_all.deb ... 260s Unpacking python3-async-generator (1.10-4) ... 260s Selecting previously unselected package python3-pycryptodome. 260s Preparing to unpack .../06-python3-pycryptodome_3.20.0+dfsg-1_ppc64el.deb ... 260s Unpacking python3-pycryptodome (3.20.0+dfsg-1) ... 260s Selecting previously unselected package python3-authlib. 260s Preparing to unpack .../07-python3-authlib_1.3.1-1_all.deb ... 260s Unpacking python3-authlib (1.3.1-1) ... 260s Selecting previously unselected package python3-cachelib. 260s Preparing to unpack .../08-python3-cachelib_0.13.0-2_all.deb ... 260s Unpacking python3-cachelib (0.13.0-2) ... 260s Selecting previously unselected package python3-colorama. 260s Preparing to unpack .../09-python3-colorama_0.4.6-4_all.deb ... 260s Unpacking python3-colorama (0.4.6-4) ... 260s Selecting previously unselected package python3-click. 260s Preparing to unpack .../10-python3-click_8.1.7-1_all.deb ... 260s Unpacking python3-click (8.1.7-1) ... 260s Selecting previously unselected package python3-sqlparse. 260s Preparing to unpack .../11-python3-sqlparse_0.5.0-1_all.deb ... 260s Unpacking python3-sqlparse (0.5.0-1) ... 260s Selecting previously unselected package python3-django. 260s Preparing to unpack .../12-python3-django_3%3a4.2.13-1_all.deb ... 260s Unpacking python3-django (3:4.2.13-1) ... 261s Selecting previously unselected package python3-itsdangerous. 261s Preparing to unpack .../13-python3-itsdangerous_2.2.0-1_all.deb ... 261s Unpacking python3-itsdangerous (2.2.0-1) ... 261s Selecting previously unselected package python3-werkzeug. 261s Preparing to unpack .../14-python3-werkzeug_3.0.3-1_all.deb ... 261s Unpacking python3-werkzeug (3.0.3-1) ... 261s Selecting previously unselected package python3-flask. 261s Preparing to unpack .../15-python3-flask_3.0.3-1ubuntu1_all.deb ... 261s Unpacking python3-flask (3.0.3-1ubuntu1) ... 261s Selecting previously unselected package python3-greenlet. 261s Preparing to unpack .../16-python3-greenlet_3.0.3-0ubuntu5_ppc64el.deb ... 261s Unpacking python3-greenlet (3.0.3-0ubuntu5) ... 261s Selecting previously unselected package python3-sqlalchemy. 261s Preparing to unpack .../17-python3-sqlalchemy_2.0.30+ds1-3_all.deb ... 261s Unpacking python3-sqlalchemy (2.0.30+ds1-3) ... 261s Selecting previously unselected package python3-flask-sqlalchemy. 261s Preparing to unpack .../18-python3-flask-sqlalchemy_3.1.1-2_all.deb ... 261s Unpacking python3-flask-sqlalchemy (3.1.1-2) ... 261s Selecting previously unselected package python3-h11. 261s Preparing to unpack .../19-python3-h11_0.14.0-1_all.deb ... 261s Unpacking python3-h11 (0.14.0-1) ... 261s Selecting previously unselected package python3-httpcore. 261s Preparing to unpack .../20-python3-httpcore_1.0.4-1_all.deb ... 261s Unpacking python3-httpcore (1.0.4-1) ... 261s Selecting previously unselected package python3-httpx. 261s Preparing to unpack .../21-python3-httpx_0.27.0-1_all.deb ... 261s Unpacking python3-httpx (0.27.0-1) ... 261s Selecting previously unselected package python3-iniconfig. 261s Preparing to unpack .../22-python3-iniconfig_1.1.1-2_all.deb ... 261s Unpacking python3-iniconfig (1.1.1-2) ... 261s Selecting previously unselected package python3-packaging. 261s Preparing to unpack .../23-python3-packaging_24.0-1_all.deb ... 261s Unpacking python3-packaging (24.0-1) ... 261s Selecting previously unselected package python3-pluggy. 261s Preparing to unpack .../24-python3-pluggy_1.5.0-1_all.deb ... 261s Unpacking python3-pluggy (1.5.0-1) ... 261s Selecting previously unselected package python3-pytest. 261s Preparing to unpack .../25-python3-pytest_8.2.2-1ubuntu1_all.deb ... 261s Unpacking python3-pytest (8.2.2-1ubuntu1) ... 261s Selecting previously unselected package python3-pytest-asyncio. 261s Preparing to unpack .../26-python3-pytest-asyncio_0.20.3-1.3_all.deb ... 261s Unpacking python3-pytest-asyncio (0.20.3-1.3) ... 261s Selecting previously unselected package python3-pytest-django. 261s Preparing to unpack .../27-python3-pytest-django_4.5.2-3_all.deb ... 261s Unpacking python3-pytest-django (4.5.2-3) ... 261s Selecting previously unselected package python3-starlette. 261s Preparing to unpack .../28-python3-starlette_0.37.2-1_all.deb ... 261s Unpacking python3-starlette (0.37.2-1) ... 261s Selecting previously unselected package autopkgtest-satdep. 261s Preparing to unpack .../29-1-autopkgtest-satdep.deb ... 261s Unpacking autopkgtest-satdep (0) ... 261s Setting up python3-iniconfig (1.1.1-2) ... 262s Setting up python3-sniffio (1.3.1-1) ... 262s Setting up python3-async-generator (1.10-4) ... 262s Setting up python3-anyio (4.4.0-1) ... 262s Setting up python3-colorama (0.4.6-4) ... 262s Setting up python3-pycryptodome (3.20.0+dfsg-1) ... 263s Setting up python3-itsdangerous (2.2.0-1) ... 263s Setting up python3-all (3.12.3-0ubuntu1) ... 263s Setting up python3-starlette (0.37.2-1) ... 263s Setting up python3-click (8.1.7-1) ... 264s Setting up python3-packaging (24.0-1) ... 264s Setting up python3-sqlparse (0.5.0-1) ... 264s Setting up python3-greenlet (3.0.3-0ubuntu5) ... 264s Setting up python3-h11 (0.14.0-1) ... 264s Setting up python3-pluggy (1.5.0-1) ... 265s Setting up python3-cachelib (0.13.0-2) ... 265s Setting up libjs-jquery (3.6.1+dfsg+~3.5.14-1) ... 265s Setting up python3-asgiref (3.8.1-1) ... 265s Setting up python3-authlib (1.3.1-1) ... 265s Setting up python3-httpcore (1.0.4-1) ... 265s Setting up python3-django (3:4.2.13-1) ... 267s Setting up python3-pytest (8.2.2-1ubuntu1) ... 267s Setting up python3-pytest-django (4.5.2-3) ... 268s Setting up python3-sqlalchemy (2.0.30+ds1-3) ... 269s Setting up python3-httpx (0.27.0-1) ... 270s Setting up python3-werkzeug (3.0.3-1) ... 270s Setting up python3-pytest-asyncio (0.20.3-1.3) ... 270s Setting up python3-flask (3.0.3-1ubuntu1) ... 270s Setting up python3-flask-sqlalchemy (3.1.1-2) ... 270s Setting up autopkgtest-satdep (0) ... 270s Processing triggers for man-db (2.12.1-2) ... 273s (Reading database ... 80523 files and directories currently installed.) 273s Removing autopkgtest-satdep (0) ... 274s autopkgtest [10:26:22]: test unittests3: [----------------------- 274s === python3.12 === 275s ============================= test session starts ============================== 275s platform linux -- Python 3.12.4, pytest-8.2.2, pluggy-1.5.0 275s rootdir: /tmp/autopkgtest.nkCinV/autopkgtest_tmp 275s configfile: setup.cfg 275s plugins: anyio-4.4.0, asyncio-0.20.3, django-4.5.2 275s asyncio: mode=Mode.STRICT 275s collected 101 items 275s 275s tests/core/test_oauth2/test_rfc6749_misc.py ...... [ 5%] 275s tests/core/test_oauth2/test_rfc7523.py ........................ [ 29%] 275s tests/core/test_oauth2/test_rfc7591.py ...... [ 35%] 275s tests/core/test_oauth2/test_rfc7662.py ...... [ 41%] 275s tests/core/test_oauth2/test_rfc8414.py .......................... [ 67%] 275s tests/core/test_oidc/test_core.py .......... [ 77%] 275s tests/core/test_oidc/test_discovery.py ....................... [100%] 275s 275s ============================= 101 passed in 0.74s ============================== 277s ============================= test session starts ============================== 277s platform linux -- Python 3.12.4, pytest-8.2.2, pluggy-1.5.0 277s django: settings: tests.clients.test_django.settings (from env) 277s rootdir: /tmp/autopkgtest.nkCinV/autopkgtest_tmp 277s configfile: setup.cfg 277s plugins: anyio-4.4.0, asyncio-0.20.3, django-4.5.2 277s asyncio: mode=Mode.STRICT 277s collected 167 items 277s 277s tests/clients/test_django/test_oauth_client.py ............. [ 7%] 277s tests/clients/test_flask/test_oauth_client.py .................... [ 19%] 277s tests/clients/test_flask/test_user_mixin.py ..... [ 22%] 277s tests/clients/test_httpx/test_assertion_client.py .. [ 23%] 278s tests/clients/test_httpx/test_async_assertion_client.py F. [ 25%] 286s tests/clients/test_httpx/test_async_oauth1_client.py FFFFFFF [ 29%] 298s tests/clients/test_httpx/test_async_oauth2_client.py FFFFFFss...FFFFFFF. [ 40%] 301s FFFFF. [ 44%] 301s tests/clients/test_httpx/test_oauth1_client.py ....... [ 48%] 302s tests/clients/test_httpx/test_oauth2_client.py ...................... [ 61%] 302s tests/clients/test_requests/test_assertion_session.py .. [ 62%] 302s tests/clients/test_requests/test_oauth1_session.py ................ [ 72%] 302s tests/clients/test_requests/test_oauth2_session.py ..................... [ 85%] 302s ......... [ 90%] 306s tests/clients/test_starlette/test_oauth_client.py ...FF.FFFF.F [ 97%] 307s tests/clients/test_starlette/test_user_mixin.py F..F [100%] 307s 307s =================================== FAILURES =================================== 307s ______________________________ test_refresh_token ______________________________ 307s 307s @contextlib.contextmanager 307s def map_httpcore_exceptions() -> typing.Iterator[None]: 307s try: 307s > yield 307s 307s /usr/lib/python3/dist-packages/httpx/_transports/default.py:69: 307s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 307s /usr/lib/python3/dist-packages/httpx/_transports/default.py:373: in handle_async_request 307s resp = await self._pool.handle_async_request(req) 307s /usr/lib/python3/dist-packages/httpcore/_async/connection_pool.py:216: in handle_async_request 307s raise exc from None 307s /usr/lib/python3/dist-packages/httpcore/_async/connection_pool.py:196: in handle_async_request 307s response = await connection.handle_async_request( 307s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 307s 307s self = 307s request = 307s 307s async def handle_async_request(self, request: Request) -> Response: 307s timeouts = request.extensions.get("timeout", {}) 307s timeout = timeouts.get("connect", None) 307s 307s async with self._connect_lock: 307s if not self._connected: 307s target = b"%b:%d" % (self._remote_origin.host, self._remote_origin.port) 307s 307s connect_url = URL( 307s scheme=self._proxy_origin.scheme, 307s host=self._proxy_origin.host, 307s port=self._proxy_origin.port, 307s target=target, 307s ) 307s connect_headers = merge_headers( 307s [(b"Host", target), (b"Accept", b"*/*")], self._proxy_headers 307s ) 307s connect_request = Request( 307s method=b"CONNECT", 307s url=connect_url, 307s headers=connect_headers, 307s extensions=request.extensions, 307s ) 307s connect_response = await self._connection.handle_async_request( 307s connect_request 307s ) 307s 307s if connect_response.status < 200 or connect_response.status > 299: 307s reason_bytes = connect_response.extensions.get("reason_phrase", b"") 307s reason_str = reason_bytes.decode("ascii", errors="ignore") 307s msg = "%d %s" % (connect_response.status, reason_str) 307s await self._connection.aclose() 307s > raise ProxyError(msg) 307s E httpcore.ProxyError: 503 Service Unavailable 307s 307s /usr/lib/python3/dist-packages/httpcore/_async/http_proxy.py:298: ProxyError 307s 307s The above exception was the direct cause of the following exception: 307s 307s @pytest.mark.asyncio 307s async def test_refresh_token(): 307s async def verifier(request): 307s content = await request.body() 307s if str(request.url) == 'https://i.b/token': 307s assert b'assertion=' in content 307s 307s async with AsyncAssertionClient( 307s 'https://i.b/token', 307s grant_type=AsyncAssertionClient.JWT_BEARER_GRANT_TYPE, 307s issuer='foo', 307s subject='foo', 307s audience='foo', 307s alg='HS256', 307s key='secret', 307s app=AsyncMockDispatch(default_token, assert_func=verifier) 307s ) as client: 307s > await client.get('https://i.b') 307s 307s tests/clients/test_httpx/test_async_assertion_client.py:33: 307s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 307s /usr/lib/python3/dist-packages/httpx/_client.py:1801: in get 307s return await self.request( 307s /usr/lib/python3/dist-packages/authlib/integrations/httpx_client/assertion_client.py:38: in request 307s await self.refresh_token() 307s /usr/lib/python3/dist-packages/authlib/integrations/httpx_client/assertion_client.py:45: in _refresh_token 307s resp = await self.request( 307s /usr/lib/python3/dist-packages/authlib/integrations/httpx_client/assertion_client.py:41: in request 307s return await super().request( 307s /usr/lib/python3/dist-packages/httpx/_client.py:1574: in request 307s return await self.send(request, auth=auth, follow_redirects=follow_redirects) 307s /usr/lib/python3/dist-packages/httpx/_client.py:1661: in send 307s response = await self._send_handling_auth( 307s /usr/lib/python3/dist-packages/httpx/_client.py:1689: in _send_handling_auth 307s response = await self._send_handling_redirects( 307s /usr/lib/python3/dist-packages/httpx/_client.py:1726: in _send_handling_redirects 307s response = await self._send_single_request(request) 307s /usr/lib/python3/dist-packages/httpx/_client.py:1763: in _send_single_request 307s response = await transport.handle_async_request(request) 307s /usr/lib/python3/dist-packages/httpx/_transports/default.py:372: in handle_async_request 307s with map_httpcore_exceptions(): 307s /usr/lib/python3.12/contextlib.py:158: in __exit__ 307s self.gen.throw(value) 307s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 307s 307s @contextlib.contextmanager 307s def map_httpcore_exceptions() -> typing.Iterator[None]: 307s try: 307s yield 307s except Exception as exc: 307s mapped_exc = None 307s 307s for from_exc, to_exc in HTTPCORE_EXC_MAP.items(): 307s if not isinstance(exc, from_exc): 307s continue 307s # We want to map to the most specific exception we can find. 307s # Eg if `exc` is an `httpcore.ReadTimeout`, we want to map to 307s # `httpx.ReadTimeout`, not just `httpx.TimeoutException`. 307s if mapped_exc is None or issubclass(to_exc, mapped_exc): 307s mapped_exc = to_exc 307s 307s if mapped_exc is None: # pragma: no cover 307s raise 307s 307s message = str(exc) 307s > raise mapped_exc(message) from exc 307s E httpx.ProxyError: 503 Service Unavailable 307s 307s /usr/lib/python3/dist-packages/httpx/_transports/default.py:86: ProxyError 307s _____________________ test_fetch_request_token_via_header ______________________ 307s 307s @pytest.mark.asyncio 307s async def test_fetch_request_token_via_header(): 307s request_token = {'oauth_token': '1', 'oauth_token_secret': '2'} 307s 307s async def assert_func(request): 307s auth_header = request.headers.get('authorization') 307s assert 'oauth_consumer_key="id"' in auth_header 307s assert 'oauth_signature=' in auth_header 307s 307s app = AsyncMockDispatch(request_token, assert_func=assert_func) 307s async with AsyncOAuth1Client('id', 'secret', app=app) as client: 307s > response = await client.fetch_request_token(oauth_url) 307s 307s tests/clients/test_httpx/test_async_oauth1_client.py:24: 307s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 307s /usr/lib/python3/dist-packages/authlib/integrations/httpx_client/oauth1_client.py:70: in _fetch_token 307s token = self.parse_response_token(resp.status_code, to_unicode(text)) 307s /usr/lib/python3/dist-packages/authlib/oauth1/client.py:152: in parse_response_token 307s self.handle_error('fetch_token_denied', message) 307s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 307s 307s error_type = 'fetch_token_denied' 307s error_description = 'Token request failed with code 404, response was \'\n\n\t\t\n\t\n\n\'.' 307s 307s @staticmethod 307s def handle_error(error_type, error_description): 307s > raise OAuthError(error_type, error_description) 307s E authlib.integrations.base_client.errors.OAuthError: fetch_token_denied: Token request failed with code 404, response was ' 307s E 307s E 307s E 307s E 404 - Not Found 307s E 307s E 307s E

404 - Not Found

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

404 - Not Found

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

404 - Not Found

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

404 - Not Found

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

More information...

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