Warning: Permanently added '2620:52:3:1:dead:beef:cafe:c14e' (ED25519) to the list of known hosts. You can reproduce this build on your computer by running: sudo dnf install copr-rpmbuild /usr/bin/copr-rpmbuild --verbose --drop-resultdir --task-url https://copr.fedorainfracloud.org/backend/get-build-task/8458191-fedora-41-x86_64 --chroot fedora-41-x86_64 Version: 1.2 PID: 9799 Logging PID: 9800 Task: {'allow_user_ssh': False, 'appstream': False, 'background': True, 'bootstrap': 'off', 'build_id': 8458191, 'buildroot_pkgs': [], 'chroot': 'fedora-41-x86_64', 'enable_net': False, 'fedora_review': False, 'git_hash': '4d0c4e7ec6db953e57f5c82d06bb804a773f5453', 'git_repo': 'https://copr-dist-git.fedorainfracloud.org/git/@python/python3.12:pr:21/python-starlette', 'isolation': 'default', 'memory_reqs': 2048, 'package_name': 'python-starlette', 'package_version': '0.45.1-1', 'project_dirname': 'python3.12:pr:21', 'project_name': 'python3.12', 'project_owner': '@python', 'repo_priority': None, 'repos': [{'baseurl': 'https://download.copr.fedorainfracloud.org/results/@python/python3.12/fedora-41-x86_64/', 'id': 'copr_base', 'name': 'Copr repository', 'priority': None}, {'baseurl': 'http://kojipkgs.fedoraproject.org/repos/rawhide/latest/$basearch/', 'id': 'http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch', 'name': 'Additional repo http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch'}], 'sandbox': '@python/python3.12--https://src.fedoraproject.org/user/music', 'source_json': {}, 'source_type': None, 'ssh_public_keys': None, 'storage': None, 'submitter': 'https://src.fedoraproject.org/user/music', 'tags': [], 'task_id': '8458191-fedora-41-x86_64', 'timeout': 18000, 'uses_devel_repo': False, 'with_opts': [], 'without_opts': []} Running: git clone https://copr-dist-git.fedorainfracloud.org/git/@python/python3.12:pr:21/python-starlette /var/lib/copr-rpmbuild/workspace/workdir-rccg_dvk/python-starlette --depth 500 --no-single-branch --recursive cmd: ['git', 'clone', 'https://copr-dist-git.fedorainfracloud.org/git/@python/python3.12:pr:21/python-starlette', '/var/lib/copr-rpmbuild/workspace/workdir-rccg_dvk/python-starlette', '--depth', '500', '--no-single-branch', '--recursive'] cwd: . rc: 0 stdout: stderr: Cloning into '/var/lib/copr-rpmbuild/workspace/workdir-rccg_dvk/python-starlette'... Running: git checkout 4d0c4e7ec6db953e57f5c82d06bb804a773f5453 -- cmd: ['git', 'checkout', '4d0c4e7ec6db953e57f5c82d06bb804a773f5453', '--'] cwd: /var/lib/copr-rpmbuild/workspace/workdir-rccg_dvk/python-starlette rc: 0 stdout: stderr: Note: switching to '4d0c4e7ec6db953e57f5c82d06bb804a773f5453'. You are in 'detached HEAD' state. You can look around, make experimental changes and commit them, and you can discard any commits you make in this state without impacting any branches by switching back to a branch. If you want to create a new branch to retain commits you create, you may do so (now or later) by using -c with the switch command. Example: git switch -c Or undo this operation with: git switch - Turn off this advice by setting config variable advice.detachedHead to false HEAD is now at 4d0c4e7 automatic import of python-starlette Running: dist-git-client sources cmd: ['dist-git-client', 'sources'] cwd: /var/lib/copr-rpmbuild/workspace/workdir-rccg_dvk/python-starlette rc: 0 stdout: stderr: INFO: Reading stdout from command: git rev-parse --abbrev-ref HEAD INFO: Reading stdout from command: git rev-parse HEAD INFO: Reading sources specification file: sources INFO: Downloading starlette-0.45.1.tar.gz INFO: Reading stdout from command: curl --help all INFO: Calling: curl -H Pragma: -o starlette-0.45.1.tar.gz --location --connect-timeout 60 --retry 3 --retry-delay 10 --remote-time --show-error --fail --retry-all-errors https://copr-dist-git.fedorainfracloud.org/repo/pkgs/@python/python3.12:pr:21/python-starlette/starlette-0.45.1.tar.gz/md5/0731c71f6ddff1dd150e5a67d15ef79d/starlette-0.45.1.tar.gz % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 2513k 100 2513k 0 0 4255k 0 --:--:-- --:--:-- --:--:-- 4253k INFO: Reading stdout from command: md5sum starlette-0.45.1.tar.gz /usr/bin/tail: /var/lib/copr-rpmbuild/main.log: file truncated Running (timeout=18000): unbuffer mock --spec /var/lib/copr-rpmbuild/workspace/workdir-rccg_dvk/python-starlette/python-starlette.spec --sources /var/lib/copr-rpmbuild/workspace/workdir-rccg_dvk/python-starlette --resultdir /var/lib/copr-rpmbuild/results --uniqueext 1735650614.938785 -r /var/lib/copr-rpmbuild/results/configs/child.cfg INFO: mock.py version 6.0 starting (python version = 3.13.0, NVR = mock-6.0-1.fc41), args: /usr/libexec/mock/mock --spec /var/lib/copr-rpmbuild/workspace/workdir-rccg_dvk/python-starlette/python-starlette.spec --sources /var/lib/copr-rpmbuild/workspace/workdir-rccg_dvk/python-starlette --resultdir /var/lib/copr-rpmbuild/results --uniqueext 1735650614.938785 -r /var/lib/copr-rpmbuild/results/configs/child.cfg Start: init plugins INFO: tmpfs initialized INFO: selinux enabled INFO: chroot_scan: initialized INFO: compress_logs: initialized Finish: init plugins INFO: Signal handler active Start: run INFO: Start(/var/lib/copr-rpmbuild/workspace/workdir-rccg_dvk/python-starlette/python-starlette.spec) Config(fedora-41-x86_64) Start: clean chroot Finish: clean chroot Mock Version: 6.0 INFO: Mock Version: 6.0 Start: chroot init INFO: mounting tmpfs at /var/lib/mock/fedora-41-x86_64-1735650614.938785/root. INFO: calling preinit hooks INFO: enabled root cache INFO: enabled package manager cache Start: cleaning package manager metadata Finish: cleaning package manager metadata INFO: enabled HW Info plugin INFO: Package manager dnf5 detected and used (fallback) INFO: Buildroot is handled by package management from host and used with --installroot: rpm-4.20.0-1.fc41.x86_64 rpm-sequoia-1.7.0-2.fc41.x86_64 python3-dnf-4.22.0-1.fc41.noarch python3-dnf-plugins-core-4.10.0-1.fc41.noarch dnf5-5.2.8.1-2.fc41.x86_64 dnf5-plugins-5.2.8.1-2.fc41.x86_64 Start: installing minimal buildroot with dnf5 Updating and loading repositories: updates 100% | 5.0 MiB/s | 8.5 MiB | 00m02s fedora 100% | 17.2 MiB/s | 35.4 MiB | 00m02s Copr repository 100% | 21.6 MiB/s | 3.5 MiB | 00m00s Additional repo http_kojipkgs_fedorapr 100% | 44.5 MiB/s | 14.3 MiB | 00m00s Repositories loaded. Package Arch Version Repository Size Installing group/module packages: bash x86_64 5.2.37-1.fc42 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 8.2 MiB bzip2 x86_64 1.0.8-19.fc41 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 95.7 KiB coreutils x86_64 9.5-11.fc42 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 5.4 MiB cpio x86_64 2.15-2.fc41 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 1.1 MiB diffutils x86_64 3.10-8.fc41 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 1.6 MiB fedora-release-common noarch 42-0.11 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 19.8 KiB findutils x86_64 1:4.10.0-4.fc41 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 1.8 MiB gawk x86_64 5.3.0-4.fc41 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 1.7 MiB glibc-minimal-langpack x86_64 2.40.9000-24.fc42 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 0.0 B grep x86_64 3.11-9.fc41 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 1.0 MiB gzip x86_64 1.13-2.fc41 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 389.0 KiB info x86_64 7.1.1-2.fc42 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 361.8 KiB patch x86_64 2.7.6-25.fc41 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 266.7 KiB redhat-rpm-config noarch 296-1.fc42 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 186.6 KiB rpm-build x86_64 4.20.0-3.fc42 copr_base 185.8 KiB sed x86_64 4.9-3.fc41 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 861.5 KiB shadow-utils x86_64 2:4.17.0-2.fc42 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 4.0 MiB tar x86_64 2:1.35-4.fc41 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 2.9 MiB unzip x86_64 6.0-65.fc42 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 398.2 KiB util-linux x86_64 2.40.2-8.fc42 copr_base 3.7 MiB which x86_64 2.21-42.fc41 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 80.2 KiB xz x86_64 1:5.6.3-2.fc42 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 1.2 MiB Installing dependencies: add-determinism x86_64 0.5.0-1.fc42 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 2.4 MiB alternatives x86_64 1.31-1.fc42 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 64.8 KiB ansible-srpm-macros noarch 1-16.fc41 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 35.7 KiB audit-libs x86_64 4.0.2-1.fc42 copr_base 331.3 KiB authselect x86_64 1.5.0-8.fc42 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 157.5 KiB authselect-libs x86_64 1.5.0-8.fc42 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 822.2 KiB basesystem noarch 11-21.fc41 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 0.0 B binutils x86_64 2.43.50-9.fc42 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 25.8 MiB build-reproducibility-srpm-macros noarch 0.5.0-1.fc42 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 735.0 B bzip2-libs x86_64 1.0.8-19.fc41 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 80.7 KiB ca-certificates noarch 2024.2.69_v8.0.401-4.fc42 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 2.6 MiB coreutils-common x86_64 9.5-11.fc42 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 11.2 MiB cracklib x86_64 2.9.11-6.fc41 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 238.9 KiB crypto-policies noarch 20241128-1.gitbb7b0b0.fc42 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 137.3 KiB curl x86_64 8.11.1-2.fc42 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 452.0 KiB cyrus-sasl-lib x86_64 2.1.28-27.fc41 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 2.3 MiB debugedit x86_64 5.1-2.fc42 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 200.3 KiB dwz x86_64 0.15-8.fc42 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 299.2 KiB ed x86_64 1.20.2-2.fc41 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 146.9 KiB efi-srpm-macros noarch 5-13.fc42 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 40.2 KiB elfutils x86_64 0.192-7.fc42 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 2.6 MiB elfutils-debuginfod-client x86_64 0.192-7.fc42 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 81.4 KiB elfutils-default-yama-scope noarch 0.192-7.fc42 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 1.8 KiB elfutils-libelf x86_64 0.192-7.fc42 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 1.2 MiB elfutils-libs x86_64 0.192-7.fc42 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 662.9 KiB fedora-gpg-keys noarch 42-0.3 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 126.4 KiB fedora-release noarch 42-0.11 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 0.0 B fedora-release-identity-basic noarch 42-0.11 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 719.0 B fedora-repos noarch 42-0.3 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 4.9 KiB fedora-repos-rawhide noarch 42-0.3 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 2.2 KiB file x86_64 5.45-8.fc42 copr_base 103.7 KiB file-libs x86_64 5.45-8.fc42 copr_base 9.9 MiB filesystem x86_64 3.18-29.fc42 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 106.0 B fonts-srpm-macros noarch 1:2.0.5-17.fc41 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 55.8 KiB forge-srpm-macros noarch 0.4.0-1.fc42 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 38.9 KiB fpc-srpm-macros noarch 1.3-13.fc41 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 144.0 B gdb-minimal x86_64 15.2-6.fc42 copr_base 12.7 MiB gdbm x86_64 1:1.23-7.fc41 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 460.9 KiB gdbm-libs x86_64 1:1.23-7.fc41 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 121.9 KiB ghc-srpm-macros noarch 1.9.2-1.fc42 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 779.0 B glibc x86_64 2.40.9000-24.fc42 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 6.7 MiB glibc-common x86_64 2.40.9000-24.fc42 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 1.0 MiB glibc-gconv-extra x86_64 2.40.9000-24.fc42 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 8.0 MiB gmp x86_64 1:6.3.0-2.fc41 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 811.4 KiB gnat-srpm-macros noarch 6-6.fc41 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 1.0 KiB go-srpm-macros noarch 3.6.0-5.fc42 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 60.8 KiB jansson x86_64 2.14-1.fc42 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 93.1 KiB json-c x86_64 0.18-1.fc42 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 83.3 KiB kernel-srpm-macros noarch 1.0-24.fc41 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 1.9 KiB keyutils-libs x86_64 1.6.3-4.fc41 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 54.4 KiB krb5-libs x86_64 1.21.3-3.fc42 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 2.3 MiB libacl x86_64 2.3.2-2.fc41 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 40.0 KiB libarchive x86_64 3.7.7-1.fc42 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 932.3 KiB libattr x86_64 2.5.2-4.fc41 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 28.5 KiB libblkid x86_64 2.40.2-8.fc42 copr_base 262.5 KiB libbrotli x86_64 1.1.0-5.fc41 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 837.6 KiB libcap x86_64 2.71-1.fc42 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 210.8 KiB libcap-ng x86_64 0.8.5-3.fc41 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 69.2 KiB libcom_err x86_64 1.47.1-6.fc42 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 67.2 KiB libcurl x86_64 8.11.1-2.fc42 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 817.3 KiB libeconf x86_64 0.7.5-1.fc42 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 66.7 KiB libevent x86_64 2.1.12-14.fc41 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 895.7 KiB libfdisk x86_64 2.40.2-8.fc42 copr_base 362.9 KiB libffi x86_64 3.4.6-3.fc42 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 86.4 KiB libgcc x86_64 14.2.1-6.fc42 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 270.6 KiB libgomp x86_64 14.2.1-6.fc42 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 519.8 KiB libidn2 x86_64 2.3.7-2.fc41 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 329.1 KiB libmount x86_64 2.40.2-8.fc42 copr_base 355.8 KiB libnghttp2 x86_64 1.64.0-1.fc42 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 174.5 KiB libnsl2 x86_64 2.0.1-2.fc41 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 57.9 KiB libpkgconf x86_64 2.3.0-1.fc42 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 78.2 KiB libpsl x86_64 0.21.5-4.fc41 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 80.5 KiB libpwquality x86_64 1.4.5-11.fc41 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 417.8 KiB libselinux x86_64 3.8-0.rc3.1.fc42 copr_base 191.6 KiB libsemanage x86_64 3.8-0.rc3.1.fc42 copr_base 305.3 KiB libsepol x86_64 3.8-0.rc3.1.fc42 copr_base 812.3 KiB libsmartcols x86_64 2.40.2-8.fc42 copr_base 180.4 KiB libssh x86_64 0.11.1-1.fc42 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 569.6 KiB libssh-config noarch 0.11.1-1.fc42 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 277.0 B libstdc++ x86_64 14.2.1-6.fc42 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 2.8 MiB libtasn1 x86_64 4.19.0-9.fc41 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 175.7 KiB libtirpc x86_64 1.3.6-1.fc42 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 205.5 KiB libtool-ltdl x86_64 2.5.4-1.fc42 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 68.1 KiB libunistring x86_64 1.1-8.fc41 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 1.7 MiB libuuid x86_64 2.40.2-8.fc42 copr_base 41.4 KiB libverto x86_64 0.3.2-9.fc41 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 29.5 KiB libxcrypt x86_64 4.4.37-1.fc42 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 269.6 KiB libxml2 x86_64 2.12.9-1.fc42 copr_base 1.7 MiB libzstd x86_64 1.5.6-2.fc41 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 795.9 KiB lua-libs x86_64 5.4.7-1.fc42 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 285.0 KiB lua-srpm-macros noarch 1-14.fc41 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 1.3 KiB lz4-libs x86_64 1.10.0-1.fc41 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 145.5 KiB mpfr x86_64 4.2.1-5.fc41 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 832.1 KiB ncurses-base noarch 6.5-2.20240629.fc41 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 326.3 KiB ncurses-libs x86_64 6.5-2.20240629.fc41 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 975.2 KiB ocaml-srpm-macros noarch 10-3.fc41 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 1.9 KiB openblas-srpm-macros noarch 2-18.fc41 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 112.0 B openldap x86_64 2.6.8-6.fc42 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 647.4 KiB openssl-libs x86_64 1:3.2.2-9.fc41 fedora 7.8 MiB p11-kit x86_64 0.25.5-4.fc42 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 2.2 MiB p11-kit-trust x86_64 0.25.5-4.fc42 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 403.8 KiB package-notes-srpm-macros noarch 0.5-12.fc41 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 1.6 KiB pam x86_64 1.7.0-3.fc42 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 1.8 MiB pam-libs x86_64 1.7.0-3.fc42 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 139.4 KiB pcre2 x86_64 10.44-1.fc41.1 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 653.5 KiB pcre2-syntax noarch 10.44-1.fc41.1 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 251.6 KiB perl-srpm-macros noarch 1-56.fc41 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 861.0 B pkgconf x86_64 2.3.0-1.fc42 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 88.6 KiB pkgconf-m4 noarch 2.3.0-1.fc42 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 14.4 KiB pkgconf-pkg-config x86_64 2.3.0-1.fc42 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 989.0 B popt x86_64 1.19-7.fc41 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 136.9 KiB publicsuffix-list-dafsa noarch 20240107-4.fc41 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 67.5 KiB pyproject-srpm-macros noarch 1.16.3-1.fc42 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 1.9 KiB python-srpm-macros noarch 3.13-3.fc41 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 51.0 KiB qt5-srpm-macros noarch 5.15.15-1.fc42 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 500.0 B qt6-srpm-macros noarch 6.8.1-4.fc42 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 456.0 B readline x86_64 8.2-11.fc42 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 493.1 KiB rpm x86_64 4.20.0-3.fc42 copr_base 3.1 MiB rpm-build-libs x86_64 4.20.0-3.fc42 copr_base 204.1 KiB rpm-libs x86_64 4.20.0-3.fc42 copr_base 710.4 KiB rpm-sequoia x86_64 1.7.0-3.fc42 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 2.3 MiB rust-srpm-macros noarch 26.3-3.fc42 copr_base 4.8 KiB setup noarch 2.15.0-9.fc42 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 720.7 KiB sqlite-libs x86_64 3.47.2-1.fc42 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 1.4 MiB systemd-libs x86_64 257.1-1.fc42 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 2.2 MiB util-linux-core x86_64 2.40.2-8.fc42 copr_base 1.5 MiB xxhash-libs x86_64 0.8.2-4.fc42 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 88.4 KiB xz-libs x86_64 1:5.6.3-2.fc42 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 218.4 KiB zig-srpm-macros noarch 1-3.fc41 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 1.1 KiB zip x86_64 3.0-42.fc42 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 695.9 KiB zlib-ng-compat x86_64 2.2.2-1.fc42 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 134.0 KiB zstd x86_64 1.5.6-2.fc41 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 1.7 MiB Installing groups: Buildsystem building group Transaction Summary: Installing: 154 packages Total size of inbound packages is 51 MiB. Need to download 51 MiB. After this operation, 178 MiB extra will be used (install 178 MiB, remove 0 B). [ 1/154] bzip2-0:1.0.8-19.fc41.x86_64 100% | 691.1 KiB/s | 52.5 KiB | 00m00s [ 2/154] bash-0:5.2.37-1.fc42.x86_64 100% | 16.1 MiB/s | 1.8 MiB | 00m00s [ 3/154] cpio-0:2.15-2.fc41.x86_64 100% | 7.3 MiB/s | 285.2 KiB | 00m00s [ 4/154] coreutils-0:9.5-11.fc42.x86_6 100% | 8.8 MiB/s | 1.1 MiB | 00m00s [ 5/154] fedora-release-common-0:42-0. 100% | 1.3 MiB/s | 23.9 KiB | 00m00s [ 6/154] diffutils-0:3.10-8.fc41.x86_6 100% | 16.2 MiB/s | 397.2 KiB | 00m00s [ 7/154] findutils-1:4.10.0-4.fc41.x86 100% | 22.0 MiB/s | 539.8 KiB | 00m00s [ 8/154] gawk-0:5.3.0-4.fc41.x86_64 100% | 33.1 MiB/s | 1.1 MiB | 00m00s [ 9/154] glibc-minimal-langpack-0:2.40 100% | 3.5 MiB/s | 122.0 KiB | 00m00s [ 10/154] grep-0:3.11-9.fc41.x86_64 100% | 7.1 MiB/s | 289.7 KiB | 00m00s [ 11/154] gzip-0:1.13-2.fc41.x86_64 100% | 5.9 MiB/s | 164.1 KiB | 00m00s [ 12/154] info-0:7.1.1-2.fc42.x86_64 100% | 6.2 MiB/s | 183.2 KiB | 00m00s [ 13/154] patch-0:2.7.6-25.fc41.x86_64 100% | 7.1 MiB/s | 131.0 KiB | 00m00s [ 14/154] redhat-rpm-config-0:296-1.fc4 100% | 3.9 MiB/s | 75.7 KiB | 00m00s [ 15/154] sed-0:4.9-3.fc41.x86_64 100% | 10.8 MiB/s | 309.3 KiB | 00m00s [ 16/154] rpm-build-0:4.20.0-3.fc42.x86 100% | 1.7 MiB/s | 67.9 KiB | 00m00s [ 17/154] shadow-utils-2:4.17.0-2.fc42. 100% | 28.9 MiB/s | 1.2 MiB | 00m00s [ 18/154] unzip-0:6.0-65.fc42.x86_64 100% | 8.2 MiB/s | 184.5 KiB | 00m00s [ 19/154] tar-2:1.35-4.fc41.x86_64 100% | 18.9 MiB/s | 852.1 KiB | 00m00s [ 20/154] which-0:2.21-42.fc41.x86_64 100% | 1.0 MiB/s | 41.6 KiB | 00m00s [ 21/154] util-linux-0:2.40.2-8.fc42.x8 100% | 24.3 MiB/s | 1.1 MiB | 00m00s [ 22/154] xz-1:5.6.3-2.fc42.x86_64 100% | 12.2 MiB/s | 461.7 KiB | 00m00s [ 23/154] fedora-repos-0:42-0.3.noarch 100% | 459.6 KiB/s | 9.2 KiB | 00m00s [ 24/154] glibc-common-0:2.40.9000-24.f 100% | 15.9 MiB/s | 391.3 KiB | 00m00s [ 25/154] coreutils-common-0:9.5-11.fc4 100% | 33.8 MiB/s | 2.1 MiB | 00m00s [ 26/154] rpm-0:4.20.0-3.fc42.x86_64 100% | 25.0 MiB/s | 512.4 KiB | 00m00s [ 27/154] glibc-0:2.40.9000-24.fc42.x86 100% | 35.8 MiB/s | 2.2 MiB | 00m00s [ 28/154] xz-libs-1:5.6.3-2.fc42.x86_64 100% | 5.0 MiB/s | 111.9 KiB | 00m00s [ 29/154] fedora-gpg-keys-0:42-0.3.noar 100% | 5.2 MiB/s | 123.4 KiB | 00m00s [ 30/154] rpm-libs-0:4.20.0-3.fc42.x86_ 100% | 14.4 MiB/s | 294.5 KiB | 00m00s [ 31/154] fedora-repos-rawhide-0:42-0.3 100% | 265.6 KiB/s | 8.8 KiB | 00m00s [ 32/154] glibc-gconv-extra-0:2.40.9000 100% | 39.8 MiB/s | 1.5 MiB | 00m00s [ 33/154] rpm-build-libs-0:4.20.0-3.fc4 100% | 7.8 MiB/s | 96.3 KiB | 00m00s [ 34/154] bzip2-libs-0:1.0.8-19.fc41.x8 100% | 2.4 MiB/s | 41.1 KiB | 00m00s [ 35/154] libselinux-0:3.8-0.rc3.1.fc42 100% | 6.0 MiB/s | 91.7 KiB | 00m00s [ 36/154] libacl-0:2.3.2-2.fc41.x86_64 100% | 1.1 MiB/s | 24.5 KiB | 00m00s [ 37/154] libxcrypt-0:4.4.37-1.fc42.x86 100% | 4.9 MiB/s | 115.9 KiB | 00m00s [ 38/154] pam-libs-0:1.7.0-3.fc42.x86_6 100% | 3.3 MiB/s | 58.0 KiB | 00m00s [ 39/154] libeconf-0:0.7.5-1.fc42.x86_6 100% | 1.9 MiB/s | 33.1 KiB | 00m00s [ 40/154] audit-libs-0:4.0.2-1.fc42.x86 100% | 9.5 MiB/s | 126.7 KiB | 00m00s [ 41/154] pam-0:1.7.0-3.fc42.x86_64 100% | 17.4 MiB/s | 517.9 KiB | 00m00s [ 42/154] setup-0:2.15.0-9.fc42.noarch 100% | 5.6 MiB/s | 149.6 KiB | 00m00s [ 43/154] libsemanage-0:3.8-0.rc3.1.fc4 100% | 10.3 MiB/s | 116.6 KiB | 00m00s [ 44/154] libattr-0:2.5.2-4.fc41.x86_64 100% | 1.0 MiB/s | 18.2 KiB | 00m00s [ 45/154] build-reproducibility-srpm-ma 100% | 546.3 KiB/s | 11.5 KiB | 00m00s [ 46/154] efi-srpm-macros-0:5-13.fc42.n 100% | 1.3 MiB/s | 22.5 KiB | 00m00s [ 47/154] add-determinism-0:0.5.0-1.fc4 100% | 30.7 MiB/s | 848.7 KiB | 00m00s [ 48/154] forge-srpm-macros-0:0.4.0-1.f 100% | 1.1 MiB/s | 19.8 KiB | 00m00s [ 49/154] go-srpm-macros-0:3.6.0-5.fc42 100% | 1.6 MiB/s | 28.0 KiB | 00m00s [ 50/154] pyproject-srpm-macros-0:1.16. 100% | 866.6 KiB/s | 13.9 KiB | 00m00s [ 51/154] qt6-srpm-macros-0:6.8.1-4.fc4 100% | 545.2 KiB/s | 9.3 KiB | 00m00s [ 52/154] ansible-srpm-macros-0:1-16.fc 100% | 1.1 MiB/s | 20.8 KiB | 00m00s [ 53/154] file-0:5.45-8.fc42.x86_64 100% | 5.3 MiB/s | 49.1 KiB | 00m00s [ 54/154] dwz-0:0.15-8.fc42.x86_64 100% | 4.9 MiB/s | 139.1 KiB | 00m00s [ 55/154] fonts-srpm-macros-1:2.0.5-17. 100% | 1.3 MiB/s | 27.0 KiB | 00m00s [ 56/154] fpc-srpm-macros-0:1.3-13.fc41 100% | 284.4 KiB/s | 8.0 KiB | 00m00s [ 57/154] ghc-srpm-macros-0:1.9.2-1.fc4 100% | 434.2 KiB/s | 9.1 KiB | 00m00s [ 58/154] gnat-srpm-macros-0:6-6.fc41.n 100% | 471.2 KiB/s | 9.0 KiB | 00m00s [ 59/154] kernel-srpm-macros-0:1.0-24.f 100% | 548.2 KiB/s | 9.9 KiB | 00m00s [ 60/154] ocaml-srpm-macros-0:10-3.fc41 100% | 575.0 KiB/s | 9.2 KiB | 00m00s [ 61/154] lua-srpm-macros-0:1-14.fc41.n 100% | 341.5 KiB/s | 8.9 KiB | 00m00s [ 62/154] openblas-srpm-macros-0:2-18.f 100% | 428.6 KiB/s | 7.7 KiB | 00m00s [ 63/154] package-notes-srpm-macros-0:0 100% | 427.4 KiB/s | 9.8 KiB | 00m00s [ 64/154] perl-srpm-macros-0:1-56.fc41. 100% | 386.9 KiB/s | 8.5 KiB | 00m00s [ 65/154] python-srpm-macros-0:3.13-3.f 100% | 1.1 MiB/s | 23.7 KiB | 00m00s [ 66/154] rust-srpm-macros-0:26.3-3.fc4 100% | 1.0 MiB/s | 12.7 KiB | 00m00s [ 67/154] qt5-srpm-macros-0:5.15.15-1.f 100% | 404.5 KiB/s | 8.9 KiB | 00m00s [ 68/154] zig-srpm-macros-0:1-3.fc41.no 100% | 324.9 KiB/s | 8.1 KiB | 00m00s [ 69/154] ed-0:1.20.2-2.fc41.x86_64 100% | 3.6 MiB/s | 81.8 KiB | 00m00s [ 70/154] zip-0:3.0-42.fc42.x86_64 100% | 9.3 MiB/s | 256.7 KiB | 00m00s [ 71/154] libtirpc-0:1.3.6-1.fc42.x86_6 100% | 4.9 MiB/s | 94.9 KiB | 00m00s [ 72/154] authselect-0:1.5.0-8.fc42.x86 100% | 6.3 MiB/s | 141.2 KiB | 00m00s [ 73/154] authselect-libs-0:1.5.0-8.fc4 100% | 7.4 MiB/s | 204.7 KiB | 00m00s [ 74/154] gdbm-1:1.23-7.fc41.x86_64 100% | 6.5 MiB/s | 147.2 KiB | 00m00s [ 75/154] gdbm-libs-1:1.23-7.fc41.x86_6 100% | 3.1 MiB/s | 56.3 KiB | 00m00s [ 76/154] libnsl2-0:2.0.1-2.fc41.x86_64 100% | 1.7 MiB/s | 29.6 KiB | 00m00s [ 77/154] libpwquality-0:1.4.5-11.fc41. 100% | 6.2 MiB/s | 108.2 KiB | 00m00s [ 78/154] libcom_err-0:1.47.1-6.fc42.x8 100% | 1.0 MiB/s | 26.6 KiB | 00m00s [ 79/154] krb5-libs-0:1.21.3-3.fc42.x86 100% | 24.6 MiB/s | 756.3 KiB | 00m00s [ 80/154] crypto-policies-0:20241128-1. 100% | 4.0 MiB/s | 73.7 KiB | 00m00s [ 81/154] cracklib-0:2.9.11-6.fc41.x86_ 100% | 3.5 MiB/s | 81.7 KiB | 00m00s [ 82/154] keyutils-libs-0:1.6.3-4.fc41. 100% | 1.2 MiB/s | 31.6 KiB | 00m00s [ 83/154] libverto-0:0.3.2-9.fc41.x86_6 100% | 862.1 KiB/s | 20.7 KiB | 00m00s [ 84/154] pcre2-0:10.44-1.fc41.1.x86_64 100% | 9.5 MiB/s | 243.1 KiB | 00m00s [ 85/154] ncurses-libs-0:6.5-2.20240629 100% | 10.2 MiB/s | 334.0 KiB | 00m00s [ 86/154] basesystem-0:11-21.fc41.noarc 100% | 335.1 KiB/s | 7.4 KiB | 00m00s [ 87/154] libgcc-0:14.2.1-6.fc42.x86_64 100% | 6.3 MiB/s | 135.2 KiB | 00m00s [ 88/154] openssl-libs-1:3.2.2-9.fc41.x 100% | 14.7 MiB/s | 2.3 MiB | 00m00s [ 89/154] readline-0:8.2-11.fc42.x86_64 100% | 7.2 MiB/s | 213.4 KiB | 00m00s [ 90/154] filesystem-0:3.18-29.fc42.x86 100% | 30.6 MiB/s | 1.1 MiB | 00m00s [ 91/154] mpfr-0:4.2.1-5.fc41.x86_64 100% | 14.1 MiB/s | 346.3 KiB | 00m00s [ 92/154] gmp-1:6.3.0-2.fc41.x86_64 100% | 10.7 MiB/s | 318.0 KiB | 00m00s [ 93/154] elfutils-libelf-0:0.192-7.fc4 100% | 7.7 MiB/s | 204.6 KiB | 00m00s [ 94/154] elfutils-libs-0:0.192-7.fc42. 100% | 12.3 MiB/s | 251.9 KiB | 00m00s [ 95/154] elfutils-0:0.192-7.fc42.x86_6 100% | 16.8 MiB/s | 499.5 KiB | 00m00s [ 96/154] elfutils-debuginfod-client-0: 100% | 2.1 MiB/s | 43.9 KiB | 00m00s [ 97/154] zlib-ng-compat-0:2.2.2-1.fc42 100% | 3.3 MiB/s | 76.9 KiB | 00m00s [ 98/154] libcap-0:2.71-1.fc42.x86_64 100% | 3.8 MiB/s | 86.4 KiB | 00m00s [ 99/154] systemd-libs-0:257.1-1.fc42.x 100% | 24.3 MiB/s | 770.4 KiB | 00m00s [100/154] popt-0:1.19-7.fc41.x86_64 100% | 2.8 MiB/s | 59.3 KiB | 00m00s [101/154] libblkid-0:2.40.2-8.fc42.x86_ 100% | 12.3 MiB/s | 125.5 KiB | 00m00s [102/154] libmount-0:2.40.2-8.fc42.x86_ 100% | 13.9 MiB/s | 156.6 KiB | 00m00s [103/154] libfdisk-0:2.40.2-8.fc42.x86_ 100% | 11.2 MiB/s | 160.1 KiB | 00m00s [104/154] libcap-ng-0:0.8.5-3.fc41.x86_ 100% | 1.4 MiB/s | 32.6 KiB | 00m00s [105/154] libsmartcols-0:2.40.2-8.fc42. 100% | 6.9 MiB/s | 84.4 KiB | 00m00s [106/154] libuuid-0:2.40.2-8.fc42.x86_6 100% | 2.4 MiB/s | 29.5 KiB | 00m00s [107/154] util-linux-core-0:2.40.2-8.fc 100% | 28.3 MiB/s | 522.0 KiB | 00m00s [108/154] libzstd-0:1.5.6-2.fc41.x86_64 100% | 13.2 MiB/s | 310.3 KiB | 00m00s [109/154] rpm-sequoia-0:1.7.0-3.fc42.x8 100% | 26.0 MiB/s | 826.0 KiB | 00m00s [110/154] lua-libs-0:5.4.7-1.fc42.x86_6 100% | 4.4 MiB/s | 132.1 KiB | 00m00s [111/154] file-libs-0:5.45-8.fc42.x86_6 100% | 41.5 MiB/s | 764.1 KiB | 00m00s [112/154] sqlite-libs-0:3.47.2-1.fc42.x 100% | 15.9 MiB/s | 699.8 KiB | 00m00s [113/154] libgomp-0:14.2.1-6.fc42.x86_6 100% | 12.0 MiB/s | 356.9 KiB | 00m00s [114/154] jansson-0:2.14-1.fc42.x86_64 100% | 1.7 MiB/s | 45.3 KiB | 00m00s [115/154] debugedit-0:5.1-2.fc42.x86_64 100% | 2.3 MiB/s | 78.2 KiB | 00m00s [116/154] binutils-0:2.43.50-9.fc42.x86 100% | 69.3 MiB/s | 5.8 MiB | 00m00s [117/154] pkgconf-pkg-config-0:2.3.0-1. 100% | 385.0 KiB/s | 10.0 KiB | 00m00s [118/154] libarchive-0:3.7.7-1.fc42.x86 100% | 9.9 MiB/s | 413.9 KiB | 00m00s [119/154] pkgconf-m4-0:2.3.0-1.fc42.noa 100% | 716.1 KiB/s | 14.3 KiB | 00m00s [120/154] pkgconf-0:2.3.0-1.fc42.x86_64 100% | 2.0 MiB/s | 45.2 KiB | 00m00s [121/154] libpkgconf-0:2.3.0-1.fc42.x86 100% | 1.7 MiB/s | 38.5 KiB | 00m00s [122/154] libsepol-0:3.8-0.rc3.1.fc42.x 100% | 20.3 MiB/s | 333.1 KiB | 00m00s [123/154] curl-0:8.11.1-2.fc42.x86_64 100% | 6.9 MiB/s | 220.2 KiB | 00m00s [124/154] zstd-0:1.5.6-2.fc41.x86_64 100% | 13.4 MiB/s | 481.5 KiB | 00m00s [125/154] ca-certificates-0:2024.2.69_v 100% | 23.7 MiB/s | 944.9 KiB | 00m00s [126/154] lz4-libs-0:1.10.0-1.fc41.x86_ 100% | 2.7 MiB/s | 70.7 KiB | 00m00s [127/154] libstdc++-0:14.2.1-6.fc42.x86 100% | 21.7 MiB/s | 890.1 KiB | 00m00s [128/154] ncurses-base-0:6.5-2.20240629 100% | 2.4 MiB/s | 63.8 KiB | 00m00s [129/154] pcre2-syntax-0:10.44-1.fc41.1 100% | 4.4 MiB/s | 149.9 KiB | 00m00s [130/154] libxml2-0:2.12.9-1.fc42.x86_6 100% | 33.8 MiB/s | 657.6 KiB | 00m00s [131/154] elfutils-default-yama-scope-0 100% | 623.2 KiB/s | 12.5 KiB | 00m00s [132/154] libffi-0:3.4.6-3.fc42.x86_64 100% | 2.1 MiB/s | 40.0 KiB | 00m00s [133/154] json-c-0:0.18-1.fc42.x86_64 100% | 2.0 MiB/s | 44.4 KiB | 00m00s [134/154] p11-kit-0:0.25.5-4.fc42.x86_6 100% | 16.1 MiB/s | 478.3 KiB | 00m00s [135/154] p11-kit-trust-0:0.25.5-4.fc42 100% | 4.8 MiB/s | 133.2 KiB | 00m00s [136/154] alternatives-0:1.31-1.fc42.x8 100% | 1.2 MiB/s | 39.4 KiB | 00m00s [137/154] fedora-release-identity-basic 100% | 725.6 KiB/s | 13.8 KiB | 00m00s [138/154] fedora-release-0:42-0.11.noar 100% | 447.6 KiB/s | 13.0 KiB | 00m00s [139/154] libtasn1-0:4.19.0-9.fc41.x86_ 100% | 2.3 MiB/s | 74.2 KiB | 00m00s [140/154] libssh-0:0.11.1-1.fc42.x86_64 100% | 10.8 MiB/s | 231.9 KiB | 00m00s [141/154] libcurl-0:8.11.1-2.fc42.x86_6 100% | 12.9 MiB/s | 356.7 KiB | 00m00s [142/154] libnghttp2-0:1.64.0-1.fc42.x8 100% | 2.9 MiB/s | 77.4 KiB | 00m00s [143/154] libssh-config-0:0.11.1-1.fc42 100% | 469.3 KiB/s | 9.4 KiB | 00m00s [144/154] xxhash-libs-0:0.8.2-4.fc42.x8 100% | 1.8 MiB/s | 36.8 KiB | 00m00s [145/154] openldap-0:2.6.8-6.fc42.x86_6 100% | 8.2 MiB/s | 243.4 KiB | 00m00s [146/154] libbrotli-0:1.1.0-5.fc41.x86_ 100% | 9.2 MiB/s | 340.5 KiB | 00m00s [147/154] gdb-minimal-0:15.2-6.fc42.x86 100% | 65.2 MiB/s | 4.0 MiB | 00m00s [148/154] libidn2-0:2.3.7-2.fc41.x86_64 100% | 5.2 MiB/s | 112.6 KiB | 00m00s [149/154] libpsl-0:0.21.5-4.fc41.x86_64 100% | 2.7 MiB/s | 64.1 KiB | 00m00s [150/154] cyrus-sasl-lib-0:2.1.28-27.fc 100% | 22.2 MiB/s | 794.9 KiB | 00m00s [151/154] libtool-ltdl-0:2.5.4-1.fc42.x 100% | 1.3 MiB/s | 34.2 KiB | 00m00s [152/154] libunistring-0:1.1-8.fc41.x86 100% | 19.0 MiB/s | 544.8 KiB | 00m00s [153/154] publicsuffix-list-dafsa-0:202 100% | 3.0 MiB/s | 58.3 KiB | 00m00s [154/154] libevent-0:2.1.12-14.fc41.x86 100% | 1.0 MiB/s | 257.5 KiB | 00m00s -------------------------------------------------------------------------------- [154/154] Total 100% | 29.8 MiB/s | 51.3 MiB | 00m02s Running transaction Importing OpenPGP key 0xE99D6AD1: UserID : "Fedora (41) " Fingerprint: 466CF2D8B60BC3057AA9453ED0622462E99D6AD1 From : file:///usr/share/distribution-gpg-keys/fedora/RPM-GPG-KEY-fedora-41-primary The key was successfully imported. [ 1/156] Verify package files 100% | 773.0 B/s | 154.0 B | 00m00s >>> Running pre-transaction scriptlet: filesystem-0:3.18-29.fc42.x86_64 >>> Finished pre-transaction scriptlet: filesystem-0:3.18-29.fc42.x86_64 >>> [RPM] /var/lib/mock/fedora-41-x86_64-1735650614.938785/root/var/cache/dnf/co [ 2/156] Prepare transaction 100% | 1.8 KiB/s | 154.0 B | 00m00s [ 3/156] Installing libgcc-0:14.2.1-6. 100% | 132.9 MiB/s | 272.3 KiB | 00m00s [ 4/156] Installing publicsuffix-list- 100% | 66.7 MiB/s | 68.3 KiB | 00m00s [ 5/156] Installing libssh-config-0:0. 100% | 0.0 B/s | 816.0 B | 00m00s [ 6/156] Installing fedora-release-ide 100% | 0.0 B/s | 976.0 B | 00m00s [ 7/156] Installing fedora-repos-rawhi 100% | 0.0 B/s | 2.4 KiB | 00m00s [ 8/156] Installing fedora-gpg-keys-0: 100% | 18.7 MiB/s | 172.2 KiB | 00m00s [ 9/156] Installing fedora-repos-0:42- 100% | 0.0 B/s | 5.7 KiB | 00m00s [ 10/156] Installing fedora-release-com 100% | 11.8 MiB/s | 24.1 KiB | 00m00s [ 11/156] Installing fedora-release-0:4 100% | 0.0 B/s | 124.0 B | 00m00s [ 12/156] Installing setup-0:2.15.0-9.f 100% | 50.7 MiB/s | 726.5 KiB | 00m00s >>> [RPM] /etc/hosts created as /etc/hosts.rpmnew [ 13/156] Installing filesystem-0:3.18- 100% | 1.6 MiB/s | 212.6 KiB | 00m00s [ 14/156] Installing basesystem-0:11-21 100% | 0.0 B/s | 124.0 B | 00m00s [ 15/156] Installing ncurses-base-0:6.5 100% | 38.2 MiB/s | 351.7 KiB | 00m00s [ 16/156] Installing glibc-minimal-lang 100% | 0.0 B/s | 124.0 B | 00m00s [ 17/156] Installing ncurses-libs-0:6.5 100% | 137.0 MiB/s | 981.8 KiB | 00m00s [ 18/156] Installing glibc-0:2.40.9000- 100% | 202.2 MiB/s | 6.7 MiB | 00m00s [ 19/156] Installing bash-0:5.2.37-1.fc 100% | 272.3 MiB/s | 8.2 MiB | 00m00s [ 20/156] Installing glibc-common-0:2.4 100% | 130.2 MiB/s | 1.0 MiB | 00m00s [ 21/156] Installing glibc-gconv-extra- 100% | 152.4 MiB/s | 8.1 MiB | 00m00s [ 22/156] Installing zlib-ng-compat-0:2 100% | 131.7 MiB/s | 134.9 KiB | 00m00s [ 23/156] Installing xz-libs-1:5.6.3-2. 100% | 214.3 MiB/s | 219.5 KiB | 00m00s [ 24/156] Installing bzip2-libs-0:1.0.8 100% | 79.9 MiB/s | 81.8 KiB | 00m00s [ 25/156] Installing readline-0:8.2-11. 100% | 241.8 MiB/s | 495.3 KiB | 00m00s [ 26/156] Installing popt-0:1.19-7.fc41 100% | 28.0 MiB/s | 143.5 KiB | 00m00s [ 27/156] Installing libuuid-0:2.40.2-8 100% | 41.5 MiB/s | 42.5 KiB | 00m00s [ 28/156] Installing libblkid-0:2.40.2- 100% | 257.5 MiB/s | 263.6 KiB | 00m00s [ 29/156] Installing libxcrypt-0:4.4.37 100% | 133.0 MiB/s | 272.3 KiB | 00m00s [ 30/156] Installing libattr-0:2.5.2-4. 100% | 28.8 MiB/s | 29.5 KiB | 00m00s [ 31/156] Installing libacl-0:2.3.2-2.f 100% | 39.8 MiB/s | 40.7 KiB | 00m00s [ 32/156] Installing gmp-1:6.3.0-2.fc41 100% | 264.9 MiB/s | 813.7 KiB | 00m00s [ 33/156] Installing libzstd-0:1.5.6-2. 100% | 259.5 MiB/s | 797.2 KiB | 00m00s [ 34/156] Installing elfutils-libelf-0: 100% | 291.7 MiB/s | 1.2 MiB | 00m00s [ 35/156] Installing libstdc++-0:14.2.1 100% | 276.0 MiB/s | 2.8 MiB | 00m00s [ 36/156] Installing libeconf-0:0.7.5-1 100% | 66.8 MiB/s | 68.4 KiB | 00m00s [ 37/156] Installing gdbm-libs-1:1.23-7 100% | 120.7 MiB/s | 123.6 KiB | 00m00s [ 38/156] Installing dwz-0:0.15-8.fc42. 100% | 146.8 MiB/s | 300.6 KiB | 00m00s [ 39/156] Installing mpfr-0:4.2.1-5.fc4 100% | 203.5 MiB/s | 833.7 KiB | 00m00s [ 40/156] Installing gawk-0:5.3.0-4.fc4 100% | 173.2 MiB/s | 1.7 MiB | 00m00s [ 41/156] Installing unzip-0:6.0-65.fc4 100% | 130.8 MiB/s | 401.7 KiB | 00m00s [ 42/156] Installing file-libs-0:5.45-8 100% | 496.9 MiB/s | 9.9 MiB | 00m00s [ 43/156] Installing file-0:5.45-8.fc42 100% | 6.4 MiB/s | 105.2 KiB | 00m00s [ 44/156] Installing crypto-policies-0: 100% | 14.5 MiB/s | 163.7 KiB | 00m00s [ 45/156] Installing libcom_err-0:1.47. 100% | 66.7 MiB/s | 68.3 KiB | 00m00s [ 46/156] Installing libcap-ng-0:0.8.5- 100% | 69.4 MiB/s | 71.0 KiB | 00m00s [ 47/156] Installing audit-libs-0:4.0.2 100% | 162.8 MiB/s | 333.4 KiB | 00m00s [ 48/156] Installing pam-libs-0:1.7.0-3 100% | 138.5 MiB/s | 141.8 KiB | 00m00s [ 49/156] Installing libcap-0:2.71-1.fc 100% | 70.3 MiB/s | 215.8 KiB | 00m00s [ 50/156] Installing systemd-libs-0:257 100% | 246.7 MiB/s | 2.2 MiB | 00m00s [ 51/156] Installing libsmartcols-0:2.4 100% | 177.1 MiB/s | 181.4 KiB | 00m00s [ 52/156] Installing lua-libs-0:5.4.7-1 100% | 279.5 MiB/s | 286.2 KiB | 00m00s [ 53/156] Installing libsepol-0:3.8-0.r 100% | 264.7 MiB/s | 813.3 KiB | 00m00s [ 54/156] Installing lz4-libs-0:1.10.0- 100% | 143.1 MiB/s | 146.6 KiB | 00m00s [ 55/156] Installing libffi-0:3.4.6-3.f 100% | 85.7 MiB/s | 87.8 KiB | 00m00s [ 56/156] Installing alternatives-0:1.3 100% | 32.4 MiB/s | 66.4 KiB | 00m00s [ 57/156] Installing libtasn1-0:4.19.0- 100% | 86.7 MiB/s | 177.5 KiB | 00m00s [ 58/156] Installing p11-kit-0:0.25.5-4 100% | 147.7 MiB/s | 2.2 MiB | 00m00s [ 59/156] Installing libunistring-0:1.1 100% | 288.5 MiB/s | 1.7 MiB | 00m00s [ 60/156] Installing libidn2-0:2.3.7-2. 100% | 81.8 MiB/s | 335.1 KiB | 00m00s [ 61/156] Installing libpsl-0:0.21.5-4. 100% | 79.7 MiB/s | 81.7 KiB | 00m00s [ 62/156] Installing p11-kit-trust-0:0. 100% | 22.0 MiB/s | 405.5 KiB | 00m00s [ 63/156] Installing zstd-0:1.5.6-2.fc4 100% | 241.6 MiB/s | 1.7 MiB | 00m00s [ 64/156] Installing zip-0:3.0-42.fc42. 100% | 170.9 MiB/s | 699.8 KiB | 00m00s [ 65/156] Installing gdbm-1:1.23-7.fc41 100% | 113.7 MiB/s | 465.8 KiB | 00m00s [ 66/156] Installing cyrus-sasl-lib-0:2 100% | 230.6 MiB/s | 2.3 MiB | 00m00s [ 67/156] Installing libfdisk-0:2.40.2- 100% | 177.7 MiB/s | 364.0 KiB | 00m00s [ 68/156] Installing bzip2-0:1.0.8-19.f 100% | 48.9 MiB/s | 100.2 KiB | 00m00s [ 69/156] Installing libxml2-0:2.12.9-1 100% | 240.9 MiB/s | 1.7 MiB | 00m00s [ 70/156] Installing add-determinism-0: 100% | 296.1 MiB/s | 2.4 MiB | 00m00s [ 71/156] Installing build-reproducibil 100% | 0.0 B/s | 1.0 KiB | 00m00s [ 72/156] Installing sqlite-libs-0:3.47 100% | 239.0 MiB/s | 1.4 MiB | 00m00s [ 73/156] Installing ed-0:1.20.2-2.fc41 100% | 72.8 MiB/s | 149.2 KiB | 00m00s [ 74/156] Installing elfutils-default-y 100% | 145.9 KiB/s | 2.0 KiB | 00m00s [ 75/156] Installing elfutils-libs-0:0. 100% | 162.3 MiB/s | 664.7 KiB | 00m00s [ 76/156] Installing cpio-0:2.15-2.fc41 100% | 157.1 MiB/s | 1.1 MiB | 00m00s [ 77/156] Installing diffutils-0:3.10-8 100% | 159.0 MiB/s | 1.6 MiB | 00m00s [ 78/156] Installing keyutils-libs-0:1. 100% | 54.5 MiB/s | 55.8 KiB | 00m00s [ 79/156] Installing libverto-0:0.3.2-9 100% | 30.5 MiB/s | 31.3 KiB | 00m00s [ 80/156] Installing libgomp-0:14.2.1-6 100% | 254.5 MiB/s | 521.2 KiB | 00m00s [ 81/156] Installing jansson-0:2.14-1.f 100% | 92.3 MiB/s | 94.5 KiB | 00m00s [ 82/156] Installing libpkgconf-0:2.3.0 100% | 77.5 MiB/s | 79.3 KiB | 00m00s [ 83/156] Installing pkgconf-0:2.3.0-1. 100% | 44.5 MiB/s | 91.1 KiB | 00m00s [ 84/156] Installing json-c-0:0.18-1.fc 100% | 82.6 MiB/s | 84.6 KiB | 00m00s [ 85/156] Installing libnghttp2-0:1.64. 100% | 171.5 MiB/s | 175.6 KiB | 00m00s [ 86/156] Installing xxhash-libs-0:0.8. 100% | 87.7 MiB/s | 89.8 KiB | 00m00s [ 87/156] Installing libbrotli-0:1.1.0- 100% | 205.0 MiB/s | 839.9 KiB | 00m00s [ 88/156] Installing libtool-ltdl-0:2.5 100% | 67.6 MiB/s | 69.2 KiB | 00m00s [ 89/156] Installing pcre2-syntax-0:10. 100% | 124.1 MiB/s | 254.1 KiB | 00m00s [ 90/156] Installing pcre2-0:10.44-1.fc 100% | 213.2 MiB/s | 654.9 KiB | 00m00s [ 91/156] Installing libselinux-0:3.8-0 100% | 188.4 MiB/s | 192.9 KiB | 00m00s [ 92/156] Installing sed-0:4.9-3.fc41.x 100% | 121.3 MiB/s | 869.7 KiB | 00m00s [ 93/156] Installing grep-0:3.11-9.fc41 100% | 111.5 MiB/s | 1.0 MiB | 00m00s [ 94/156] Installing findutils-1:4.10.0 100% | 168.9 MiB/s | 1.9 MiB | 00m00s [ 95/156] Installing xz-1:5.6.3-2.fc42. 100% | 123.7 MiB/s | 1.2 MiB | 00m00s [ 96/156] Installing libmount-0:2.40.2- 100% | 174.3 MiB/s | 356.9 KiB | 00m00s [ 97/156] Installing util-linux-core-0: 100% | 127.3 MiB/s | 1.5 MiB | 00m00s [ 98/156] Installing patch-0:2.7.6-25.f 100% | 131.0 MiB/s | 268.2 KiB | 00m00s [ 99/156] Installing tar-2:1.35-4.fc41. 100% | 211.3 MiB/s | 3.0 MiB | 00m00s [100/156] Installing libsemanage-0:3.8- 100% | 100.0 MiB/s | 307.1 KiB | 00m00s [101/156] Installing shadow-utils-2:4.1 100% | 119.1 MiB/s | 4.0 MiB | 00m00s [102/156] Installing pkgconf-m4-0:2.3.0 100% | 0.0 B/s | 14.8 KiB | 00m00s [103/156] Installing pkgconf-pkg-config 100% | 1.7 MiB/s | 1.8 KiB | 00m00s [104/156] Installing rust-srpm-macros-0 100% | 0.0 B/s | 5.6 KiB | 00m00s [105/156] Installing qt5-srpm-macros-0: 100% | 0.0 B/s | 776.0 B | 00m00s [106/156] Installing perl-srpm-macros-0 100% | 0.0 B/s | 1.1 KiB | 00m00s [107/156] Installing package-notes-srpm 100% | 0.0 B/s | 2.0 KiB | 00m00s [108/156] Installing openblas-srpm-macr 100% | 0.0 B/s | 392.0 B | 00m00s [109/156] Installing ocaml-srpm-macros- 100% | 0.0 B/s | 2.2 KiB | 00m00s [110/156] Installing kernel-srpm-macros 100% | 0.0 B/s | 2.3 KiB | 00m00s [111/156] Installing gnat-srpm-macros-0 100% | 0.0 B/s | 1.3 KiB | 00m00s [112/156] Installing ghc-srpm-macros-0: 100% | 0.0 B/s | 1.0 KiB | 00m00s [113/156] Installing fpc-srpm-macros-0: 100% | 0.0 B/s | 420.0 B | 00m00s [114/156] Installing ansible-srpm-macro 100% | 0.0 B/s | 36.2 KiB | 00m00s [115/156] Installing qt6-srpm-macros-0: 100% | 714.8 KiB/s | 732.0 B | 00m00s [116/156] Installing coreutils-common-0 100% | 248.7 MiB/s | 11.2 MiB | 00m00s [117/156] Installing openssl-libs-1:3.2 100% | 313.2 MiB/s | 7.8 MiB | 00m00s [118/156] Installing coreutils-0:9.5-11 100% | 128.6 MiB/s | 5.4 MiB | 00m00s [119/156] Installing ca-certificates-0: 100% | 1.2 MiB/s | 2.4 MiB | 00m02s [120/156] Installing krb5-libs-0:1.21.3 100% | 177.3 MiB/s | 2.3 MiB | 00m00s [121/156] Installing libarchive-0:3.7.7 100% | 182.5 MiB/s | 934.2 KiB | 00m00s [122/156] Installing libtirpc-0:1.3.6-1 100% | 101.2 MiB/s | 207.3 KiB | 00m00s [123/156] Installing gzip-0:1.13-2.fc41 100% | 96.3 MiB/s | 394.6 KiB | 00m00s [124/156] Installing authselect-libs-0: 100% | 81.8 MiB/s | 837.2 KiB | 00m00s [125/156] Installing cracklib-0:2.9.11- 100% | 30.6 MiB/s | 250.3 KiB | 00m00s [126/156] Installing libpwquality-0:1.4 100% | 52.5 MiB/s | 430.1 KiB | 00m00s [127/156] Installing libnsl2-0:2.0.1-2. 100% | 57.7 MiB/s | 59.1 KiB | 00m00s [128/156] Installing pam-0:1.7.0-3.fc42 100% | 75.7 MiB/s | 1.9 MiB | 00m00s [129/156] Installing libssh-0:0.11.1-1. 100% | 186.1 MiB/s | 571.7 KiB | 00m00s [130/156] Installing rpm-sequoia-0:1.7. 100% | 258.2 MiB/s | 2.3 MiB | 00m00s [131/156] Installing rpm-libs-0:4.20.0- 100% | 173.8 MiB/s | 711.9 KiB | 00m00s [132/156] Installing rpm-build-libs-0:4 100% | 100.0 MiB/s | 204.9 KiB | 00m00s [133/156] Installing libevent-0:2.1.12- 100% | 175.7 MiB/s | 899.5 KiB | 00m00s [134/156] Installing openldap-0:2.6.8-6 100% | 159.0 MiB/s | 651.2 KiB | 00m00s [135/156] Installing libcurl-0:8.11.1-2 100% | 199.8 MiB/s | 818.4 KiB | 00m00s [136/156] Installing elfutils-debuginfo 100% | 40.9 MiB/s | 83.8 KiB | 00m00s [137/156] Installing elfutils-0:0.192-7 100% | 220.4 MiB/s | 2.6 MiB | 00m00s [138/156] Installing binutils-0:2.43.50 100% | 260.6 MiB/s | 25.8 MiB | 00m00s [139/156] Installing gdb-minimal-0:15.2 100% | 303.0 MiB/s | 12.7 MiB | 00m00s [140/156] Installing debugedit-0:5.1-2. 100% | 99.1 MiB/s | 203.0 KiB | 00m00s [141/156] Installing curl-0:8.11.1-2.fc 100% | 19.3 MiB/s | 454.5 KiB | 00m00s [142/156] Installing rpm-0:4.20.0-3.fc4 100% | 86.2 MiB/s | 2.5 MiB | 00m00s [143/156] Installing efi-srpm-macros-0: 100% | 40.2 MiB/s | 41.2 KiB | 00m00s [144/156] Installing lua-srpm-macros-0: 100% | 0.0 B/s | 1.9 KiB | 00m00s [145/156] Installing zig-srpm-macros-0: 100% | 0.0 B/s | 1.7 KiB | 00m00s [146/156] Installing forge-srpm-macros- 100% | 39.3 MiB/s | 40.3 KiB | 00m00s [147/156] Installing go-srpm-macros-0:3 100% | 60.5 MiB/s | 62.0 KiB | 00m00s [148/156] Installing fonts-srpm-macros- 100% | 55.7 MiB/s | 57.0 KiB | 00m00s [149/156] Installing python-srpm-macros 100% | 50.9 MiB/s | 52.2 KiB | 00m00s [150/156] Installing redhat-rpm-config- 100% | 62.9 MiB/s | 193.2 KiB | 00m00s [151/156] Installing rpm-build-0:4.20.0 100% | 38.0 MiB/s | 194.5 KiB | 00m00s [152/156] Installing pyproject-srpm-mac 100% | 1.2 MiB/s | 2.5 KiB | 00m00s [153/156] Installing util-linux-0:2.40. 100% | 79.0 MiB/s | 3.7 MiB | 00m00s [154/156] Installing authselect-0:1.5.0 100% | 39.5 MiB/s | 161.9 KiB | 00m00s [155/156] Installing which-0:2.21-42.fc 100% | 40.2 MiB/s | 82.4 KiB | 00m00s [156/156] Installing info-0:7.1.1-2.fc4 100% | 137.4 KiB/s | 362.2 KiB | 00m03s Warning: skipped OpenPGP checks for 153 packages from repositories: copr_base, http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch Complete! Finish: installing minimal buildroot with dnf5 Start: creating root cache Finish: creating root cache Finish: chroot init INFO: Installed packages: INFO: add-determinism-0.5.0-1.fc42.x86_64 alternatives-1.31-1.fc42.x86_64 ansible-srpm-macros-1-16.fc41.noarch audit-libs-4.0.2-1.fc42.x86_64 authselect-1.5.0-8.fc42.x86_64 authselect-libs-1.5.0-8.fc42.x86_64 basesystem-11-21.fc41.noarch bash-5.2.37-1.fc42.x86_64 binutils-2.43.50-9.fc42.x86_64 build-reproducibility-srpm-macros-0.5.0-1.fc42.noarch bzip2-1.0.8-19.fc41.x86_64 bzip2-libs-1.0.8-19.fc41.x86_64 ca-certificates-2024.2.69_v8.0.401-4.fc42.noarch coreutils-9.5-11.fc42.x86_64 coreutils-common-9.5-11.fc42.x86_64 cpio-2.15-2.fc41.x86_64 cracklib-2.9.11-6.fc41.x86_64 crypto-policies-20241128-1.gitbb7b0b0.fc42.noarch curl-8.11.1-2.fc42.x86_64 cyrus-sasl-lib-2.1.28-27.fc41.x86_64 debugedit-5.1-2.fc42.x86_64 diffutils-3.10-8.fc41.x86_64 dwz-0.15-8.fc42.x86_64 ed-1.20.2-2.fc41.x86_64 efi-srpm-macros-5-13.fc42.noarch elfutils-0.192-7.fc42.x86_64 elfutils-debuginfod-client-0.192-7.fc42.x86_64 elfutils-default-yama-scope-0.192-7.fc42.noarch elfutils-libelf-0.192-7.fc42.x86_64 elfutils-libs-0.192-7.fc42.x86_64 fedora-gpg-keys-42-0.3.noarch fedora-release-42-0.11.noarch fedora-release-common-42-0.11.noarch fedora-release-identity-basic-42-0.11.noarch fedora-repos-42-0.3.noarch fedora-repos-rawhide-42-0.3.noarch file-5.45-8.fc42.x86_64 file-libs-5.45-8.fc42.x86_64 filesystem-3.18-29.fc42.x86_64 findutils-4.10.0-4.fc41.x86_64 fonts-srpm-macros-2.0.5-17.fc41.noarch forge-srpm-macros-0.4.0-1.fc42.noarch fpc-srpm-macros-1.3-13.fc41.noarch gawk-5.3.0-4.fc41.x86_64 gdb-minimal-15.2-6.fc42.x86_64 gdbm-1.23-7.fc41.x86_64 gdbm-libs-1.23-7.fc41.x86_64 ghc-srpm-macros-1.9.2-1.fc42.noarch glibc-2.40.9000-24.fc42.x86_64 glibc-common-2.40.9000-24.fc42.x86_64 glibc-gconv-extra-2.40.9000-24.fc42.x86_64 glibc-minimal-langpack-2.40.9000-24.fc42.x86_64 gmp-6.3.0-2.fc41.x86_64 gnat-srpm-macros-6-6.fc41.noarch go-srpm-macros-3.6.0-5.fc42.noarch gpg-pubkey-e99d6ad1-64d2612c grep-3.11-9.fc41.x86_64 gzip-1.13-2.fc41.x86_64 info-7.1.1-2.fc42.x86_64 jansson-2.14-1.fc42.x86_64 json-c-0.18-1.fc42.x86_64 kernel-srpm-macros-1.0-24.fc41.noarch keyutils-libs-1.6.3-4.fc41.x86_64 krb5-libs-1.21.3-3.fc42.x86_64 libacl-2.3.2-2.fc41.x86_64 libarchive-3.7.7-1.fc42.x86_64 libattr-2.5.2-4.fc41.x86_64 libblkid-2.40.2-8.fc42.x86_64 libbrotli-1.1.0-5.fc41.x86_64 libcap-2.71-1.fc42.x86_64 libcap-ng-0.8.5-3.fc41.x86_64 libcom_err-1.47.1-6.fc42.x86_64 libcurl-8.11.1-2.fc42.x86_64 libeconf-0.7.5-1.fc42.x86_64 libevent-2.1.12-14.fc41.x86_64 libfdisk-2.40.2-8.fc42.x86_64 libffi-3.4.6-3.fc42.x86_64 libgcc-14.2.1-6.fc42.x86_64 libgomp-14.2.1-6.fc42.x86_64 libidn2-2.3.7-2.fc41.x86_64 libmount-2.40.2-8.fc42.x86_64 libnghttp2-1.64.0-1.fc42.x86_64 libnsl2-2.0.1-2.fc41.x86_64 libpkgconf-2.3.0-1.fc42.x86_64 libpsl-0.21.5-4.fc41.x86_64 libpwquality-1.4.5-11.fc41.x86_64 libselinux-3.8-0.rc3.1.fc42.x86_64 libsemanage-3.8-0.rc3.1.fc42.x86_64 libsepol-3.8-0.rc3.1.fc42.x86_64 libsmartcols-2.40.2-8.fc42.x86_64 libssh-0.11.1-1.fc42.x86_64 libssh-config-0.11.1-1.fc42.noarch libstdc++-14.2.1-6.fc42.x86_64 libtasn1-4.19.0-9.fc41.x86_64 libtirpc-1.3.6-1.fc42.x86_64 libtool-ltdl-2.5.4-1.fc42.x86_64 libunistring-1.1-8.fc41.x86_64 libuuid-2.40.2-8.fc42.x86_64 libverto-0.3.2-9.fc41.x86_64 libxcrypt-4.4.37-1.fc42.x86_64 libxml2-2.12.9-1.fc42.x86_64 libzstd-1.5.6-2.fc41.x86_64 lua-libs-5.4.7-1.fc42.x86_64 lua-srpm-macros-1-14.fc41.noarch lz4-libs-1.10.0-1.fc41.x86_64 mpfr-4.2.1-5.fc41.x86_64 ncurses-base-6.5-2.20240629.fc41.noarch ncurses-libs-6.5-2.20240629.fc41.x86_64 ocaml-srpm-macros-10-3.fc41.noarch openblas-srpm-macros-2-18.fc41.noarch openldap-2.6.8-6.fc42.x86_64 openssl-libs-3.2.2-9.fc41.x86_64 p11-kit-0.25.5-4.fc42.x86_64 p11-kit-trust-0.25.5-4.fc42.x86_64 package-notes-srpm-macros-0.5-12.fc41.noarch pam-1.7.0-3.fc42.x86_64 pam-libs-1.7.0-3.fc42.x86_64 patch-2.7.6-25.fc41.x86_64 pcre2-10.44-1.fc41.1.x86_64 pcre2-syntax-10.44-1.fc41.1.noarch perl-srpm-macros-1-56.fc41.noarch pkgconf-2.3.0-1.fc42.x86_64 pkgconf-m4-2.3.0-1.fc42.noarch pkgconf-pkg-config-2.3.0-1.fc42.x86_64 popt-1.19-7.fc41.x86_64 publicsuffix-list-dafsa-20240107-4.fc41.noarch pyproject-srpm-macros-1.16.3-1.fc42.noarch python-srpm-macros-3.13-3.fc41.noarch qt5-srpm-macros-5.15.15-1.fc42.noarch qt6-srpm-macros-6.8.1-4.fc42.noarch readline-8.2-11.fc42.x86_64 redhat-rpm-config-296-1.fc42.noarch rpm-4.20.0-3.fc42.x86_64 rpm-build-4.20.0-3.fc42.x86_64 rpm-build-libs-4.20.0-3.fc42.x86_64 rpm-libs-4.20.0-3.fc42.x86_64 rpm-sequoia-1.7.0-3.fc42.x86_64 rust-srpm-macros-26.3-3.fc42.noarch sed-4.9-3.fc41.x86_64 setup-2.15.0-9.fc42.noarch shadow-utils-4.17.0-2.fc42.x86_64 sqlite-libs-3.47.2-1.fc42.x86_64 systemd-libs-257.1-1.fc42.x86_64 tar-1.35-4.fc41.x86_64 unzip-6.0-65.fc42.x86_64 util-linux-2.40.2-8.fc42.x86_64 util-linux-core-2.40.2-8.fc42.x86_64 which-2.21-42.fc41.x86_64 xxhash-libs-0.8.2-4.fc42.x86_64 xz-5.6.3-2.fc42.x86_64 xz-libs-5.6.3-2.fc42.x86_64 zig-srpm-macros-1-3.fc41.noarch zip-3.0-42.fc42.x86_64 zlib-ng-compat-2.2.2-1.fc42.x86_64 zstd-1.5.6-2.fc41.x86_64 Start: buildsrpm Start: rpmbuild -bs Building target platforms: x86_64 Building for target x86_64 Reading /var/tmp/rpm-tmp.0gjKKy setting SOURCE_DATE_EPOCH=1735603200 Wrote: /builddir/build/SRPMS/python-starlette-0.45.1-1.fc42.src.rpm Finish: rpmbuild -bs INFO: chroot_scan: 1 files copied to /var/lib/copr-rpmbuild/results/chroot_scan INFO: /var/lib/mock/fedora-41-x86_64-1735650614.938785/root/var/log/dnf5.log INFO: chroot_scan: creating tarball /var/lib/copr-rpmbuild/results/chroot_scan.tar.gz /bin/tar: Removing leading `/' from member names Finish: buildsrpm INFO: Done(/var/lib/copr-rpmbuild/workspace/workdir-rccg_dvk/python-starlette/python-starlette.spec) Config(child) 0 minutes 26 seconds INFO: Results and/or logs in: /var/lib/copr-rpmbuild/results INFO: Cleaning up build root ('cleanup_on_success=True') Start: clean chroot INFO: unmounting tmpfs. Finish: clean chroot INFO: Start(/var/lib/copr-rpmbuild/results/python-starlette-0.45.1-1.fc42.src.rpm) Config(fedora-41-x86_64) Start: chroot init INFO: mounting tmpfs at /var/lib/mock/fedora-41-x86_64-1735650614.938785/root. INFO: calling preinit hooks INFO: enabled root cache Start: unpacking root cache Finish: unpacking root cache INFO: enabled package manager cache Start: cleaning package manager metadata Finish: cleaning package manager metadata INFO: enabled HW Info plugin INFO: Buildroot is handled by package management from host and used with --installroot: rpm-4.20.0-1.fc41.x86_64 rpm-sequoia-1.7.0-2.fc41.x86_64 python3-dnf-4.22.0-1.fc41.noarch python3-dnf-plugins-core-4.10.0-1.fc41.noarch dnf5-5.2.8.1-2.fc41.x86_64 dnf5-plugins-5.2.8.1-2.fc41.x86_64 Finish: chroot init Start: build phase for python-starlette-0.45.1-1.fc42.src.rpm Start: build setup for python-starlette-0.45.1-1.fc42.src.rpm Building target platforms: x86_64 Building for target x86_64 Reading /var/tmp/rpm-tmp.uffaZn setting SOURCE_DATE_EPOCH=1735603200 Wrote: /builddir/build/SRPMS/python-starlette-0.45.1-1.fc42.src.rpm Updating and loading repositories: updates 100% | 1.1 MiB/s | 30.7 KiB | 00m00s fedora 100% | 1.2 MiB/s | 30.8 KiB | 00m00s Copr repository 100% | 53.0 KiB/s | 1.5 KiB | 00m00s Additional repo http_kojipkgs_fedorapr 100% | 72.2 KiB/s | 3.8 KiB | 00m00s Repositories loaded. Package Arch Version Repository Size Installing: python3-pytest noarch 8.3.4-1.fc42 copr_base 20.8 MiB python3-trio noarch 0.23.1-6.fc41 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 4.9 MiB python3-typing-extensions noarch 4.12.2-3.fc41 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 464.5 KiB Installing dependencies: expat x86_64 2.6.4-1.fc42 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 285.5 KiB libb2 x86_64 0.98.1-12.fc41 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 42.2 KiB mpdecimal x86_64 2.5.1-16.fc41 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 204.9 KiB python-pip-wheel noarch 24.3.1-1.fc42 copr_base 1.2 MiB python3 x86_64 3.13.1-2.fc42 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 30.6 KiB python3-attrs noarch 24.3.0-2.fc42 copr_base 396.8 KiB python3-idna noarch 3.10-1.fc42 copr_base 628.0 KiB python3-iniconfig noarch 1.1.1-24.fc41 copr_base 20.6 KiB python3-libs x86_64 3.13.1-2.fc42 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 39.8 MiB python3-outcome noarch 1.2.0-6.fc41 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 30.1 KiB python3-packaging noarch 24.2-2.fc42 copr_base 555.7 KiB python3-pluggy noarch 1.5.0-1.fc42 copr_base 193.2 KiB python3-sniffio noarch 1.3.1-3.fc41 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 35.0 KiB python3-sortedcontainers noarch 2.4.0-18.fc41 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 391.2 KiB tzdata noarch 2024b-1.fc42 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 1.6 MiB Transaction Summary: Installing: 18 packages Total size of inbound packages is 14 MiB. Need to download 14 MiB. After this operation, 72 MiB extra will be used (install 72 MiB, remove 0 B). [ 1/18] python3-typing-extensions-0:4.1 100% | 1.2 MiB/s | 93.8 KiB | 00m00s [ 2/18] python3-pytest-0:8.3.4-1.fc42.n 100% | 23.8 MiB/s | 2.0 MiB | 00m00s [ 3/18] python3-0:3.13.1-2.fc42.x86_64 100% | 1.5 MiB/s | 26.9 KiB | 00m00s [ 4/18] python3-attrs-0:24.3.0-2.fc42.n 100% | 8.3 MiB/s | 119.2 KiB | 00m00s [ 5/18] python3-trio-0:0.23.1-6.fc41.no 100% | 8.8 MiB/s | 992.8 KiB | 00m00s [ 6/18] python3-outcome-0:1.2.0-6.fc41. 100% | 1.3 MiB/s | 21.9 KiB | 00m00s [ 7/18] python3-idna-0:3.10-1.fc42.noar 100% | 2.9 MiB/s | 112.3 KiB | 00m00s [ 8/18] python3-sniffio-0:1.3.1-3.fc41. 100% | 990.0 KiB/s | 22.8 KiB | 00m00s [ 9/18] python3-sortedcontainers-0:2.4. 100% | 2.7 MiB/s | 63.2 KiB | 00m00s [10/18] tzdata-0:2024b-1.fc42.noarch 100% | 16.7 MiB/s | 428.6 KiB | 00m00s [11/18] python3-libs-0:3.13.1-2.fc42.x8 100% | 67.5 MiB/s | 8.6 MiB | 00m00s [12/18] libb2-0:0.98.1-12.fc41.x86_64 100% | 1.0 MiB/s | 25.7 KiB | 00m00s [13/18] expat-0:2.6.4-1.fc42.x86_64 100% | 1.4 MiB/s | 114.5 KiB | 00m00s [14/18] mpdecimal-0:2.5.1-16.fc41.x86_6 100% | 5.1 MiB/s | 89.0 KiB | 00m00s [15/18] python3-iniconfig-0:1.1.1-24.fc 100% | 1.2 MiB/s | 18.6 KiB | 00m00s [16/18] python-pip-wheel-0:24.3.1-1.fc4 100% | 46.3 MiB/s | 1.2 MiB | 00m00s [17/18] python3-packaging-0:24.2-2.fc42 100% | 7.8 MiB/s | 144.2 KiB | 00m00s [18/18] python3-pluggy-0:1.5.0-1.fc42.n 100% | 5.8 MiB/s | 53.7 KiB | 00m00s -------------------------------------------------------------------------------- [18/18] Total 100% | 55.0 MiB/s | 14.1 MiB | 00m00s Running transaction [ 1/20] Verify package files 100% | 346.0 B/s | 18.0 B | 00m00s [ 2/20] Prepare transaction 100% | 375.0 B/s | 18.0 B | 00m00s [ 3/20] Installing python-pip-wheel-0:2 100% | 311.0 MiB/s | 1.2 MiB | 00m00s [ 4/20] Installing mpdecimal-0:2.5.1-16 100% | 201.2 MiB/s | 206.0 KiB | 00m00s [ 5/20] Installing libb2-0:0.98.1-12.fc 100% | 14.1 MiB/s | 43.3 KiB | 00m00s [ 6/20] Installing tzdata-0:2024b-1.fc4 100% | 25.5 MiB/s | 1.9 MiB | 00m00s [ 7/20] Installing expat-0:2.6.4-1.fc42 100% | 46.8 MiB/s | 287.6 KiB | 00m00s [ 8/20] Installing python3-libs-0:3.13. 100% | 206.2 MiB/s | 40.2 MiB | 00m00s [ 9/20] Installing python3-0:3.13.1-2.f 100% | 15.8 MiB/s | 32.4 KiB | 00m00s [10/20] Installing python3-attrs-0:24.3 100% | 80.3 MiB/s | 411.1 KiB | 00m00s [11/20] Installing python3-outcome-0:1. 100% | 16.8 MiB/s | 34.4 KiB | 00m00s [12/20] Installing python3-idna-0:3.10- 100% | 154.9 MiB/s | 634.3 KiB | 00m00s [13/20] Installing python3-sniffio-0:1. 100% | 19.7 MiB/s | 40.4 KiB | 00m00s [14/20] Installing python3-sortedcontai 100% | 128.8 MiB/s | 395.6 KiB | 00m00s [15/20] Installing python3-iniconfig-0: 100% | 11.5 MiB/s | 23.6 KiB | 00m00s [16/20] Installing python3-packaging-0: 100% | 110.9 MiB/s | 568.0 KiB | 00m00s [17/20] Installing python3-pluggy-0:1.5 100% | 48.7 MiB/s | 199.4 KiB | 00m00s [18/20] Installing python3-pytest-0:8.3 100% | 262.6 MiB/s | 21.0 MiB | 00m00s [19/20] Installing python3-trio-0:0.23. 100% | 167.5 MiB/s | 5.0 MiB | 00m00s [20/20] Installing python3-typing-exten 100% | 9.9 MiB/s | 466.9 KiB | 00m00s Warning: skipped OpenPGP checks for 18 packages from repositories: copr_base, http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch Complete! Finish: build setup for python-starlette-0.45.1-1.fc42.src.rpm Start: rpmbuild python-starlette-0.45.1-1.fc42.src.rpm Building target platforms: x86_64 Building for target x86_64 Reading /var/tmp/rpm-tmp.9ngTZk setting SOURCE_DATE_EPOCH=1735603200 Executing(%mkbuilddir): /bin/sh -e /var/tmp/rpm-tmp.gDNerp + umask 022 + cd /builddir/build/BUILD/python-starlette-0.45.1-build + test -d /builddir/build/BUILD/python-starlette-0.45.1-build + /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w /builddir/build/BUILD/python-starlette-0.45.1-build + /usr/bin/rm -rf /builddir/build/BUILD/python-starlette-0.45.1-build + /usr/bin/mkdir -p /builddir/build/BUILD/python-starlette-0.45.1-build + /usr/bin/mkdir -p /builddir/build/BUILD/python-starlette-0.45.1-build/SPECPARTS + RPM_EC=0 ++ jobs -p + exit 0 Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.exLfCx + umask 022 + cd /builddir/build/BUILD/python-starlette-0.45.1-build + cd /builddir/build/BUILD/python-starlette-0.45.1-build + rm -rf python-starlette-0.45.1 + /usr/lib/rpm/rpmuncompress -x -C python-starlette-0.45.1 /builddir/build/SOURCES/starlette-0.45.1.tar.gz + STATUS=0 + '[' 0 -ne 0 ']' + cd python-starlette-0.45.1 + /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w . + /usr/lib/rpm/rpmuncompress /builddir/build/SOURCES/0001-Revert-test-adjustments-from-5ccbc62175eece867b49811.patch + /usr/bin/patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f + RPM_EC=0 ++ jobs -p + exit 0 Executing(%generate_buildrequires): /bin/sh -e /var/tmp/rpm-tmp.FzzqE5 + umask 022 + cd /builddir/build/BUILD/python-starlette-0.45.1-build + cd python-starlette-0.45.1 + echo pyproject-rpm-macros + exit 0 Wrote: /builddir/build/SRPMS/python-starlette-0.45.1-1.fc42.buildreqs.nosrc.rpm INFO: Going to install missing dynamic buildrequires Updating and loading repositories: fedora 100% | 1.2 MiB/s | 30.8 KiB | 00m00s updates 100% | 1.2 MiB/s | 30.7 KiB | 00m00s Copr repository 100% | 53.0 KiB/s | 1.5 KiB | 00m00s Additional repo http_kojipkgs_fedorapr 100% | 68.4 KiB/s | 3.8 KiB | 00m00s Repositories loaded. Package "python3-pytest-8.3.4-1.fc42.noarch" is already installed. Package "python3-trio-0.23.1-6.fc41.noarch" is already installed. Package "python3-typing-extensions-4.12.2-3.fc41.noarch" is already installed. Package Arch Version Repository Size Installing: pyproject-rpm-macros noarch 1.16.3-1.fc42 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 113.7 KiB Installing dependencies: python-rpm-macros noarch 3.13-3.fc41 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 22.1 KiB python3-rpm-macros noarch 3.13-3.fc41 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 6.4 KiB Transaction Summary: Installing: 3 packages Total size of inbound packages is 75 KiB. Need to download 75 KiB. After this operation, 142 KiB extra will be used (install 142 KiB, remove 0 B). [1/3] python-rpm-macros-0:3.13-3.fc41.n 100% | 289.6 KiB/s | 17.7 KiB | 00m00s [2/3] python3-rpm-macros-0:3.13-3.fc41. 100% | 183.0 KiB/s | 12.4 KiB | 00m00s [3/3] pyproject-rpm-macros-0:1.16.3-1.f 100% | 595.3 KiB/s | 44.6 KiB | 00m00s -------------------------------------------------------------------------------- [3/3] Total 100% | 983.6 KiB/s | 74.8 KiB | 00m00s Running transaction [1/5] Verify package files 100% | 2.9 KiB/s | 3.0 B | 00m00s [2/5] Prepare transaction 100% | 750.0 B/s | 3.0 B | 00m00s [3/5] Installing python-rpm-macros-0:3. 100% | 22.3 MiB/s | 22.8 KiB | 00m00s [4/5] Installing python3-rpm-macros-0:3 100% | 0.0 B/s | 6.7 KiB | 00m00s [5/5] Installing pyproject-rpm-macros-0 100% | 5.4 MiB/s | 115.7 KiB | 00m00s Warning: skipped OpenPGP checks for 3 packages from repository: http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch Complete! Building target platforms: x86_64 Building for target x86_64 Reading /var/tmp/rpm-tmp.Z1skLG setting SOURCE_DATE_EPOCH=1735603200 Executing(%generate_buildrequires): /bin/sh -e /var/tmp/rpm-tmp.C1xkqn + umask 022 + cd /builddir/build/BUILD/python-starlette-0.45.1-build + cd python-starlette-0.45.1 + echo pyproject-rpm-macros + echo python3-devel + echo 'python3dist(packaging)' + echo 'python3dist(pip) >= 19' + '[' -f pyproject.toml ']' + echo '(python3dist(tomli) if python3-devel < 3.11)' + rm -rfv '*.dist-info/' + '[' -f /usr/bin/python3 ']' + mkdir -p /builddir/build/BUILD/python-starlette-0.45.1-build/python-starlette-0.45.1/.pyproject-builddir + echo -n + CFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer ' + CXXFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer ' + FFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -I/usr/lib64/gfortran/modules ' + FCFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -I/usr/lib64/gfortran/modules ' + VALAFLAGS=-g + RUSTFLAGS='-Copt-level=3 -Cdebuginfo=2 -Ccodegen-units=1 -Cstrip=none -Cforce-frame-pointers=yes --cap-lints=warn' + LDFLAGS='-Wl,-z,relro -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 ' + LT_SYS_LIBRARY_PATH=/usr/lib64: + CC=gcc + CXX=g++ + TMPDIR=/builddir/build/BUILD/python-starlette-0.45.1-build/python-starlette-0.45.1/.pyproject-builddir + RPM_TOXENV=py313 + HOSTNAME=rpmbuild + /usr/bin/python3 -Bs /usr/lib/rpm/redhat/pyproject_buildrequires.py --generate-extras --python3_pkgversion 3 --wheeldir /builddir/build/BUILD/python-starlette-0.45.1-build/python-starlette-0.45.1/pyproject-wheeldir --output /builddir/build/BUILD/python-starlette-0.45.1-build/python-starlette-0.45.1-1.fc42.x86_64-pyproject-buildrequires -x full Handling hatchling from build-system.requires Requirement not satisfied: hatchling Exiting dependency generation pass: build backend + cat /builddir/build/BUILD/python-starlette-0.45.1-build/python-starlette-0.45.1-1.fc42.x86_64-pyproject-buildrequires + rm -rfv '*.dist-info/' + RPM_EC=0 ++ jobs -p + exit 0 Wrote: /builddir/build/SRPMS/python-starlette-0.45.1-1.fc42.buildreqs.nosrc.rpm INFO: Going to install missing dynamic buildrequires Updating and loading repositories: updates 100% | 1.1 MiB/s | 30.7 KiB | 00m00s fedora 100% | 1.1 MiB/s | 30.8 KiB | 00m00s Copr repository 100% | 49.6 KiB/s | 1.5 KiB | 00m00s Additional repo http_kojipkgs_fedorapr 100% | 72.2 KiB/s | 3.8 KiB | 00m00s Repositories loaded. Package "pyproject-rpm-macros-1.16.3-1.fc42.noarch" is already installed. Package "python3-packaging-24.2-2.fc42.noarch" is already installed. Package "python3-pytest-8.3.4-1.fc42.noarch" is already installed. Package "python3-trio-0.23.1-6.fc41.noarch" is already installed. Package "python3-typing-extensions-4.12.2-3.fc41.noarch" is already installed. Package Arch Version Repository Size Installing: python3-devel x86_64 3.13.1-2.fc42 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 1.8 MiB python3-hatchling noarch 1.27.0-1.fc42 copr_base 604.2 KiB python3-pip noarch 24.3.1-1.fc42 copr_base 11.3 MiB Installing dependencies: python3-pathspec noarch 0.12.1-7.fc42 copr_base 195.2 KiB python3-rpm-generators noarch 14-11.fc41 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 81.7 KiB python3-trove-classifiers noarch 2024.10.21.16-2.fc42 copr_base 92.1 KiB Transaction Summary: Installing: 6 packages Total size of inbound packages is 3 MiB. Need to download 3 MiB. After this operation, 14 MiB extra will be used (install 14 MiB, remove 0 B). [1/6] python3-hatchling-0:1.27.0-1.fc42 100% | 2.3 MiB/s | 187.0 KiB | 00m00s [2/6] python3-pip-0:24.3.1-1.fc42.noarc 100% | 28.3 MiB/s | 2.5 MiB | 00m00s [3/6] python3-devel-0:3.13.1-2.fc42.x86 100% | 3.8 MiB/s | 357.9 KiB | 00m00s [4/6] python3-pathspec-0:0.12.1-7.fc42. 100% | 4.6 MiB/s | 56.8 KiB | 00m00s [5/6] python3-rpm-generators-0:14-11.fc 100% | 1.3 MiB/s | 29.3 KiB | 00m00s [6/6] python3-trove-classifiers-0:2024. 100% | 953.3 KiB/s | 27.6 KiB | 00m00s -------------------------------------------------------------------------------- [6/6] Total 100% | 26.3 MiB/s | 3.2 MiB | 00m00s Running transaction [1/8] Verify package files 100% | 428.0 B/s | 6.0 B | 00m00s [2/8] Prepare transaction 100% | 222.0 B/s | 6.0 B | 00m00s [3/8] Installing python3-rpm-generators 100% | 81.0 MiB/s | 82.9 KiB | 00m00s [4/8] Installing python3-trove-classifi 100% | 46.5 MiB/s | 95.3 KiB | 00m00s [5/8] Installing python3-pathspec-0:0.1 100% | 65.8 MiB/s | 202.0 KiB | 00m00s [6/8] Installing python3-hatchling-0:1. 100% | 39.9 MiB/s | 653.4 KiB | 00m00s [7/8] Installing python3-devel-0:3.13.1 100% | 95.6 MiB/s | 1.8 MiB | 00m00s [8/8] Installing python3-pip-0:24.3.1-1 100% | 96.8 MiB/s | 11.6 MiB | 00m00s Warning: skipped OpenPGP checks for 6 packages from repositories: copr_base, http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch Complete! Building target platforms: x86_64 Building for target x86_64 Reading /var/tmp/rpm-tmp.C0xZAy setting SOURCE_DATE_EPOCH=1735603200 Executing(%generate_buildrequires): /bin/sh -e /var/tmp/rpm-tmp.p0SLAi + umask 022 + cd /builddir/build/BUILD/python-starlette-0.45.1-build + cd python-starlette-0.45.1 + echo pyproject-rpm-macros + echo python3-devel + echo 'python3dist(packaging)' + echo 'python3dist(pip) >= 19' + '[' -f pyproject.toml ']' + echo '(python3dist(tomli) if python3-devel < 3.11)' + rm -rfv '*.dist-info/' + '[' -f /usr/bin/python3 ']' + mkdir -p /builddir/build/BUILD/python-starlette-0.45.1-build/python-starlette-0.45.1/.pyproject-builddir + echo -n + CFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer ' + CXXFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer ' + FFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -I/usr/lib64/gfortran/modules ' + FCFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -I/usr/lib64/gfortran/modules ' + VALAFLAGS=-g + RUSTFLAGS='-Copt-level=3 -Cdebuginfo=2 -Ccodegen-units=1 -Cstrip=none -Cforce-frame-pointers=yes --cap-lints=warn' + LDFLAGS='-Wl,-z,relro -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 ' + LT_SYS_LIBRARY_PATH=/usr/lib64: + CC=gcc + CXX=g++ + TMPDIR=/builddir/build/BUILD/python-starlette-0.45.1-build/python-starlette-0.45.1/.pyproject-builddir + RPM_TOXENV=py313 + HOSTNAME=rpmbuild + /usr/bin/python3 -Bs /usr/lib/rpm/redhat/pyproject_buildrequires.py --generate-extras --python3_pkgversion 3 --wheeldir /builddir/build/BUILD/python-starlette-0.45.1-build/python-starlette-0.45.1/pyproject-wheeldir --output /builddir/build/BUILD/python-starlette-0.45.1-build/python-starlette-0.45.1-1.fc42.x86_64-pyproject-buildrequires -x full Handling hatchling from build-system.requires Requirement satisfied: hatchling (installed: hatchling 1.27.0) Handling anyio<5,>=3.4.0 from hook generated metadata: Requires-Dist (starlette) Requirement not satisfied: anyio<5,>=3.4.0 Handling typing-extensions>=3.10.0; python_version < '3.10' from hook generated metadata: Requires-Dist (starlette) Ignoring alien requirement: typing-extensions>=3.10.0; python_version < '3.10' Handling httpx<0.29.0,>=0.27.0; extra == 'full' from hook generated metadata: Requires-Dist (starlette) Requirement not satisfied: httpx<0.29.0,>=0.27.0; extra == 'full' Handling itsdangerous; extra == 'full' from hook generated metadata: Requires-Dist (starlette) Requirement not satisfied: itsdangerous; extra == 'full' Handling jinja2; extra == 'full' from hook generated metadata: Requires-Dist (starlette) Requirement not satisfied: jinja2; extra == 'full' Handling python-multipart>=0.0.18; extra == 'full' from hook generated metadata: Requires-Dist (starlette) Requirement not satisfied: python-multipart>=0.0.18; extra == 'full' Handling pyyaml; extra == 'full' from hook generated metadata: Requires-Dist (starlette) Requirement not satisfied: pyyaml; extra == 'full' + cat /builddir/build/BUILD/python-starlette-0.45.1-build/python-starlette-0.45.1-1.fc42.x86_64-pyproject-buildrequires + rm -rfv starlette-0.45.1.dist-info/ removed 'starlette-0.45.1.dist-info/METADATA' removed directory 'starlette-0.45.1.dist-info/' + RPM_EC=0 ++ jobs -p + exit 0 Wrote: /builddir/build/SRPMS/python-starlette-0.45.1-1.fc42.buildreqs.nosrc.rpm INFO: Going to install missing dynamic buildrequires Updating and loading repositories: fedora 100% | 1.1 MiB/s | 30.8 KiB | 00m00s updates 100% | 1.1 MiB/s | 30.7 KiB | 00m00s Additional repo http_kojipkgs_fedorapr 100% | 73.6 KiB/s | 3.8 KiB | 00m00s Copr repository 100% | 53.0 KiB/s | 1.5 KiB | 00m00s Repositories loaded. Package "pyproject-rpm-macros-1.16.3-1.fc42.noarch" is already installed. Package "python3-devel-3.13.1-2.fc42.x86_64" is already installed. Package "python3-hatchling-1.27.0-1.fc42.noarch" is already installed. Package "python3-packaging-24.2-2.fc42.noarch" is already installed. Package "python3-pip-24.3.1-1.fc42.noarch" is already installed. Package "python3-pytest-8.3.4-1.fc42.noarch" is already installed. Package "python3-trio-0.23.1-6.fc41.noarch" is already installed. Package "python3-typing-extensions-4.12.2-3.fc41.noarch" is already installed. Package Arch Version Repository Size Installing: python3-anyio noarch 3.7.1-5.fc41 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 851.7 KiB python3-httpx noarch 0.27.2-1.fc42 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 932.8 KiB python3-itsdangerous noarch 2.2.0-1.fc42 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 101.6 KiB python3-jinja2 noarch 3.1.4-5.fc41 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 2.9 MiB python3-python-multipart noarch 0.0.20-1.fc42 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 228.4 KiB python3-pyyaml x86_64 6.0.1-18.fc41 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 791.1 KiB Installing dependencies: libyaml x86_64 0.2.5-15.fc41 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 134.4 KiB python3-certifi noarch 2024.08.30-1.fc42 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 6.8 KiB python3-h11 noarch 0.14.0-5.fc41 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 550.6 KiB python3-httpcore noarch 1.0.7-1.fc42 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 779.0 KiB python3-markupsafe x86_64 3.0.2-1.fc42 http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch 56.1 KiB Transaction Summary: Installing: 11 packages Total size of inbound packages is 2 MiB. Need to download 2 MiB. After this operation, 7 MiB extra will be used (install 7 MiB, remove 0 B). [ 1/11] python3-itsdangerous-0:2.2.0-1. 100% | 564.6 KiB/s | 41.2 KiB | 00m00s [ 2/11] python3-anyio-0:3.7.1-5.fc41.no 100% | 2.4 MiB/s | 198.6 KiB | 00m00s [ 3/11] python3-httpx-0:0.27.2-1.fc42.n 100% | 2.1 MiB/s | 194.1 KiB | 00m00s [ 4/11] python3-jinja2-0:3.1.4-5.fc41.n 100% | 17.0 MiB/s | 471.3 KiB | 00m00s [ 5/11] python3-python-multipart-0:0.0. 100% | 2.2 MiB/s | 57.0 KiB | 00m00s [ 6/11] python3-pyyaml-0:6.0.1-18.fc41. 100% | 10.8 MiB/s | 220.6 KiB | 00m00s [ 7/11] libyaml-0:0.2.5-15.fc41.x86_64 100% | 3.4 MiB/s | 59.4 KiB | 00m00s [ 8/11] python3-markupsafe-0:3.0.2-1.fc 100% | 1.7 MiB/s | 30.0 KiB | 00m00s [ 9/11] python3-certifi-0:2024.08.30-1. 100% | 897.2 KiB/s | 14.4 KiB | 00m00s [10/11] python3-httpcore-0:1.0.7-1.fc42 100% | 7.3 MiB/s | 133.6 KiB | 00m00s [11/11] python3-h11-0:0.14.0-5.fc41.noa 100% | 5.0 MiB/s | 127.3 KiB | 00m00s -------------------------------------------------------------------------------- [11/11] Total 100% | 10.1 MiB/s | 1.5 MiB | 00m00s Running transaction [ 1/13] Verify package files 100% | 1.5 KiB/s | 11.0 B | 00m00s [ 2/13] Prepare transaction 100% | 523.0 B/s | 11.0 B | 00m00s [ 3/13] Installing python3-certifi-0:20 100% | 5.1 MiB/s | 10.4 KiB | 00m00s [ 4/13] Installing python3-h11-0:0.14.0 100% | 92.0 MiB/s | 565.3 KiB | 00m00s [ 5/13] Installing python3-httpcore-0:1 100% | 97.6 MiB/s | 799.8 KiB | 00m00s [ 6/13] Installing python3-markupsafe-0 100% | 29.4 MiB/s | 60.2 KiB | 00m00s [ 7/13] Installing libyaml-0:0.2.5-15.f 100% | 132.6 MiB/s | 135.8 KiB | 00m00s [ 8/13] Installing python3-anyio-0:3.7. 100% | 106.9 MiB/s | 875.6 KiB | 00m00s [ 9/13] Installing python3-httpx-0:0.27 100% | 132.4 MiB/s | 948.8 KiB | 00m00s [10/13] Installing python3-pyyaml-0:6.0 100% | 112.3 MiB/s | 804.9 KiB | 00m00s [11/13] Installing python3-jinja2-0:3.1 100% | 193.7 MiB/s | 2.9 MiB | 00m00s [12/13] Installing python3-python-multi 100% | 76.6 MiB/s | 235.2 KiB | 00m00s [13/13] Installing python3-itsdangerous 100% | 3.6 MiB/s | 108.4 KiB | 00m00s Warning: skipped OpenPGP checks for 11 packages from repository: http_kojipkgs_fedoraproject_org_repos_rawhide_latest_basearch Complete! Building target platforms: x86_64 Building for target x86_64 Reading /var/tmp/rpm-tmp.M17W5u setting SOURCE_DATE_EPOCH=1735603200 Executing(%generate_buildrequires): /bin/sh -e /var/tmp/rpm-tmp.BVaiyU + umask 022 + cd /builddir/build/BUILD/python-starlette-0.45.1-build + cd python-starlette-0.45.1 + echo pyproject-rpm-macros + echo python3-devel + echo 'python3dist(packaging)' + echo 'python3dist(pip) >= 19' + '[' -f pyproject.toml ']' + echo '(python3dist(tomli) if python3-devel < 3.11)' + rm -rfv '*.dist-info/' + '[' -f /usr/bin/python3 ']' + mkdir -p /builddir/build/BUILD/python-starlette-0.45.1-build/python-starlette-0.45.1/.pyproject-builddir + echo -n + CFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer ' + CXXFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer ' + FFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -I/usr/lib64/gfortran/modules ' + FCFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -I/usr/lib64/gfortran/modules ' + VALAFLAGS=-g + RUSTFLAGS='-Copt-level=3 -Cdebuginfo=2 -Ccodegen-units=1 -Cstrip=none -Cforce-frame-pointers=yes --cap-lints=warn' + LDFLAGS='-Wl,-z,relro -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 ' + LT_SYS_LIBRARY_PATH=/usr/lib64: + CC=gcc + CXX=g++ + TMPDIR=/builddir/build/BUILD/python-starlette-0.45.1-build/python-starlette-0.45.1/.pyproject-builddir + RPM_TOXENV=py313 + HOSTNAME=rpmbuild + /usr/bin/python3 -Bs /usr/lib/rpm/redhat/pyproject_buildrequires.py --generate-extras --python3_pkgversion 3 --wheeldir /builddir/build/BUILD/python-starlette-0.45.1-build/python-starlette-0.45.1/pyproject-wheeldir --output /builddir/build/BUILD/python-starlette-0.45.1-build/python-starlette-0.45.1-1.fc42.x86_64-pyproject-buildrequires -x full Handling hatchling from build-system.requires Requirement satisfied: hatchling (installed: hatchling 1.27.0) Handling anyio<5,>=3.4.0 from hook generated metadata: Requires-Dist (starlette) Requirement satisfied: anyio<5,>=3.4.0 (installed: anyio 3.7.1) Handling typing-extensions>=3.10.0; python_version < '3.10' from hook generated metadata: Requires-Dist (starlette) Ignoring alien requirement: typing-extensions>=3.10.0; python_version < '3.10' Handling httpx<0.29.0,>=0.27.0; extra == 'full' from hook generated metadata: Requires-Dist (starlette) Requirement satisfied: httpx<0.29.0,>=0.27.0; extra == 'full' (installed: httpx 0.27.2) Handling itsdangerous; extra == 'full' from hook generated metadata: Requires-Dist (starlette) Requirement satisfied: itsdangerous; extra == 'full' (installed: itsdangerous 2.2.0) Handling jinja2; extra == 'full' from hook generated metadata: Requires-Dist (starlette) Requirement satisfied: jinja2; extra == 'full' (installed: jinja2 3.1.4) Handling python-multipart>=0.0.18; extra == 'full' from hook generated metadata: Requires-Dist (starlette) Requirement satisfied: python-multipart>=0.0.18; extra == 'full' (installed: python-multipart 0.0.20) Handling pyyaml; extra == 'full' from hook generated metadata: Requires-Dist (starlette) Requirement satisfied: pyyaml; extra == 'full' (installed: pyyaml 6.0.1) + cat /builddir/build/BUILD/python-starlette-0.45.1-build/python-starlette-0.45.1-1.fc42.x86_64-pyproject-buildrequires + rm -rfv starlette-0.45.1.dist-info/ removed 'starlette-0.45.1.dist-info/METADATA' removed directory 'starlette-0.45.1.dist-info/' + RPM_EC=0 ++ jobs -p + exit 0 Wrote: /builddir/build/SRPMS/python-starlette-0.45.1-1.fc42.buildreqs.nosrc.rpm INFO: Going to install missing dynamic buildrequires Updating and loading repositories: updates 100% | 1.1 MiB/s | 30.7 KiB | 00m00s fedora 100% | 1.1 MiB/s | 30.8 KiB | 00m00s Copr repository 100% | 53.0 KiB/s | 1.5 KiB | 00m00s Additional repo http_kojipkgs_fedorapr 100% | 72.2 KiB/s | 3.8 KiB | 00m00s Repositories loaded. Package "pyproject-rpm-macros-1.16.3-1.fc42.noarch" is already installed. Package "python3-devel-3.13.1-2.fc42.x86_64" is already installed. Package "python3-hatchling-1.27.0-1.fc42.noarch" is already installed. Package "python3-itsdangerous-2.2.0-1.fc42.noarch" is already installed. Package "python3-jinja2-3.1.4-5.fc41.noarch" is already installed. Package "python3-packaging-24.2-2.fc42.noarch" is already installed. Package "python3-pip-24.3.1-1.fc42.noarch" is already installed. Package "python3-pytest-8.3.4-1.fc42.noarch" is already installed. Package "python3-python-multipart-0.0.20-1.fc42.noarch" is already installed. Package "python3-pyyaml-6.0.1-18.fc41.x86_64" is already installed. Package "python3-trio-0.23.1-6.fc41.noarch" is already installed. Package "python3-typing-extensions-4.12.2-3.fc41.noarch" is already installed. Nothing to do. Building target platforms: x86_64 Building for target x86_64 Reading /var/tmp/rpm-tmp.bbMAz6 setting SOURCE_DATE_EPOCH=1735603200 Executing(%generate_buildrequires): /bin/sh -e /var/tmp/rpm-tmp.7Y3s88 + umask 022 + cd /builddir/build/BUILD/python-starlette-0.45.1-build + cd python-starlette-0.45.1 + echo pyproject-rpm-macros + echo python3-devel + echo 'python3dist(packaging)' + echo 'python3dist(pip) >= 19' + '[' -f pyproject.toml ']' + echo '(python3dist(tomli) if python3-devel < 3.11)' + rm -rfv '*.dist-info/' + '[' -f /usr/bin/python3 ']' + mkdir -p /builddir/build/BUILD/python-starlette-0.45.1-build/python-starlette-0.45.1/.pyproject-builddir + echo -n + CFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer ' + CXXFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer ' + FFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -I/usr/lib64/gfortran/modules ' + FCFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -I/usr/lib64/gfortran/modules ' + VALAFLAGS=-g + RUSTFLAGS='-Copt-level=3 -Cdebuginfo=2 -Ccodegen-units=1 -Cstrip=none -Cforce-frame-pointers=yes --cap-lints=warn' + LDFLAGS='-Wl,-z,relro -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 ' + LT_SYS_LIBRARY_PATH=/usr/lib64: + CC=gcc + CXX=g++ + TMPDIR=/builddir/build/BUILD/python-starlette-0.45.1-build/python-starlette-0.45.1/.pyproject-builddir + RPM_TOXENV=py313 + HOSTNAME=rpmbuild + /usr/bin/python3 -Bs /usr/lib/rpm/redhat/pyproject_buildrequires.py --generate-extras --python3_pkgversion 3 --wheeldir /builddir/build/BUILD/python-starlette-0.45.1-build/python-starlette-0.45.1/pyproject-wheeldir --output /builddir/build/BUILD/python-starlette-0.45.1-build/python-starlette-0.45.1-1.fc42.x86_64-pyproject-buildrequires -x full Handling hatchling from build-system.requires Requirement satisfied: hatchling (installed: hatchling 1.27.0) Handling anyio<5,>=3.4.0 from hook generated metadata: Requires-Dist (starlette) Requirement satisfied: anyio<5,>=3.4.0 (installed: anyio 3.7.1) Handling typing-extensions>=3.10.0; python_version < '3.10' from hook generated metadata: Requires-Dist (starlette) Ignoring alien requirement: typing-extensions>=3.10.0; python_version < '3.10' Handling httpx<0.29.0,>=0.27.0; extra == 'full' from hook generated metadata: Requires-Dist (starlette) Requirement satisfied: httpx<0.29.0,>=0.27.0; extra == 'full' (installed: httpx 0.27.2) Handling itsdangerous; extra == 'full' from hook generated metadata: Requires-Dist (starlette) Requirement satisfied: itsdangerous; extra == 'full' (installed: itsdangerous 2.2.0) Handling jinja2; extra == 'full' from hook generated metadata: Requires-Dist (starlette) Requirement satisfied: jinja2; extra == 'full' (installed: jinja2 3.1.4) Handling python-multipart>=0.0.18; extra == 'full' from hook generated metadata: Requires-Dist (starlette) Requirement satisfied: python-multipart>=0.0.18; extra == 'full' (installed: python-multipart 0.0.20) Handling pyyaml; extra == 'full' from hook generated metadata: Requires-Dist (starlette) Requirement satisfied: pyyaml; extra == 'full' (installed: pyyaml 6.0.1) + cat /builddir/build/BUILD/python-starlette-0.45.1-build/python-starlette-0.45.1-1.fc42.x86_64-pyproject-buildrequires + rm -rfv starlette-0.45.1.dist-info/ removed 'starlette-0.45.1.dist-info/METADATA' removed directory 'starlette-0.45.1.dist-info/' + RPM_EC=0 ++ jobs -p + exit 0 Executing(%conf): /bin/sh -e /var/tmp/rpm-tmp.IUaZuP + umask 022 + cd /builddir/build/BUILD/python-starlette-0.45.1-build + CFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer ' + export CFLAGS + CXXFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer ' + export CXXFLAGS + FFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -I/usr/lib64/gfortran/modules ' + export FFLAGS + FCFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -I/usr/lib64/gfortran/modules ' + export FCFLAGS + VALAFLAGS=-g + export VALAFLAGS + RUSTFLAGS='-Copt-level=3 -Cdebuginfo=2 -Ccodegen-units=1 -Cstrip=none -Cforce-frame-pointers=yes -Clink-arg=-specs=/usr/lib/rpm/redhat/redhat-package-notes --cap-lints=warn' + export RUSTFLAGS + LDFLAGS='-Wl,-z,relro -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes ' + export LDFLAGS + LT_SYS_LIBRARY_PATH=/usr/lib64: + export LT_SYS_LIBRARY_PATH + CC=gcc + export CC + CXX=g++ + export CXX + cd python-starlette-0.45.1 + RPM_EC=0 ++ jobs -p + exit 0 Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.026ULF + umask 022 + cd /builddir/build/BUILD/python-starlette-0.45.1-build + CFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer ' + export CFLAGS + CXXFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer ' + export CXXFLAGS + FFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -I/usr/lib64/gfortran/modules ' + export FFLAGS + FCFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -I/usr/lib64/gfortran/modules ' + export FCFLAGS + VALAFLAGS=-g + export VALAFLAGS + RUSTFLAGS='-Copt-level=3 -Cdebuginfo=2 -Ccodegen-units=1 -Cstrip=none -Cforce-frame-pointers=yes -Clink-arg=-specs=/usr/lib/rpm/redhat/redhat-package-notes --cap-lints=warn' + export RUSTFLAGS + LDFLAGS='-Wl,-z,relro -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes ' + export LDFLAGS + LT_SYS_LIBRARY_PATH=/usr/lib64: + export LT_SYS_LIBRARY_PATH + CC=gcc + export CC + CXX=g++ + export CXX + cd python-starlette-0.45.1 + mkdir -p /builddir/build/BUILD/python-starlette-0.45.1-build/python-starlette-0.45.1/.pyproject-builddir + CFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer ' + CXXFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer ' + FFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -I/usr/lib64/gfortran/modules ' + FCFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -I/usr/lib64/gfortran/modules ' + VALAFLAGS=-g + RUSTFLAGS='-Copt-level=3 -Cdebuginfo=2 -Ccodegen-units=1 -Cstrip=none -Cforce-frame-pointers=yes -Clink-arg=-specs=/usr/lib/rpm/redhat/redhat-package-notes --cap-lints=warn' + LDFLAGS='-Wl,-z,relro -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes ' + LT_SYS_LIBRARY_PATH=/usr/lib64: + CC=gcc + CXX=g++ + TMPDIR=/builddir/build/BUILD/python-starlette-0.45.1-build/python-starlette-0.45.1/.pyproject-builddir + /usr/bin/python3 -Bs /usr/lib/rpm/redhat/pyproject_wheel.py /builddir/build/BUILD/python-starlette-0.45.1-build/python-starlette-0.45.1/pyproject-wheeldir Processing /builddir/build/BUILD/python-starlette-0.45.1-build/python-starlette-0.45.1 Preparing metadata (pyproject.toml): started Running command Preparing metadata (pyproject.toml) Preparing metadata (pyproject.toml): finished with status 'done' Building wheels for collected packages: starlette Building wheel for starlette (pyproject.toml): started Running command Building wheel for starlette (pyproject.toml) Building wheel for starlette (pyproject.toml): finished with status 'done' Created wheel for starlette: filename=starlette-0.45.1-py3-none-any.whl size=71257 sha256=d0bbf5b8edb8b51aab28df9e0befb59a642ec12c77c15a348ca3fe6ecce1e5b0 Stored in directory: /builddir/.cache/pip/wheels/66/3c/79/83bb529496f93240329ff0a70fae7305e1691146cea0d281ef Successfully built starlette + RPM_EC=0 ++ jobs -p + exit 0 Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.6UY2hy + umask 022 + cd /builddir/build/BUILD/python-starlette-0.45.1-build + '[' /builddir/build/BUILD/python-starlette-0.45.1-build/BUILDROOT '!=' / ']' + rm -rf /builddir/build/BUILD/python-starlette-0.45.1-build/BUILDROOT ++ dirname /builddir/build/BUILD/python-starlette-0.45.1-build/BUILDROOT + mkdir -p /builddir/build/BUILD/python-starlette-0.45.1-build + mkdir /builddir/build/BUILD/python-starlette-0.45.1-build/BUILDROOT + CFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer ' + export CFLAGS + CXXFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer ' + export CXXFLAGS + FFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -I/usr/lib64/gfortran/modules ' + export FFLAGS + FCFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -I/usr/lib64/gfortran/modules ' + export FCFLAGS + VALAFLAGS=-g + export VALAFLAGS + RUSTFLAGS='-Copt-level=3 -Cdebuginfo=2 -Ccodegen-units=1 -Cstrip=none -Cforce-frame-pointers=yes -Clink-arg=-specs=/usr/lib/rpm/redhat/redhat-package-notes --cap-lints=warn' + export RUSTFLAGS + LDFLAGS='-Wl,-z,relro -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes ' + export LDFLAGS + LT_SYS_LIBRARY_PATH=/usr/lib64: + export LT_SYS_LIBRARY_PATH + CC=gcc + export CC + CXX=g++ + export CXX + cd python-starlette-0.45.1 ++ ls /builddir/build/BUILD/python-starlette-0.45.1-build/python-starlette-0.45.1/pyproject-wheeldir/starlette-0.45.1-py3-none-any.whl ++ xargs basename --multiple ++ sed -E 's/([^-]+)-([^-]+)-.+\.whl/\1==\2/' + specifier=starlette==0.45.1 + '[' -z starlette==0.45.1 ']' + TMPDIR=/builddir/build/BUILD/python-starlette-0.45.1-build/python-starlette-0.45.1/.pyproject-builddir + /usr/bin/python3 -m pip install --root /builddir/build/BUILD/python-starlette-0.45.1-build/BUILDROOT --prefix /usr --no-deps --disable-pip-version-check --progress-bar off --verbose --ignore-installed --no-warn-script-location --no-index --no-cache-dir --find-links /builddir/build/BUILD/python-starlette-0.45.1-build/python-starlette-0.45.1/pyproject-wheeldir starlette==0.45.1 Using pip 24.3.1 from /usr/lib/python3.13/site-packages/pip (python 3.13) Looking in links: /builddir/build/BUILD/python-starlette-0.45.1-build/python-starlette-0.45.1/pyproject-wheeldir Processing ./pyproject-wheeldir/starlette-0.45.1-py3-none-any.whl Installing collected packages: starlette Successfully installed starlette-0.45.1 + '[' -d /builddir/build/BUILD/python-starlette-0.45.1-build/BUILDROOT/usr/bin ']' + rm -f /builddir/build/BUILD/python-starlette-0.45.1-build/python-starlette-0.45.1-1.fc42.x86_64-pyproject-ghost-distinfo + site_dirs=() + '[' -d /builddir/build/BUILD/python-starlette-0.45.1-build/BUILDROOT/usr/lib/python3.13/site-packages ']' + site_dirs+=("/usr/lib/python3.13/site-packages") + '[' /builddir/build/BUILD/python-starlette-0.45.1-build/BUILDROOT/usr/lib64/python3.13/site-packages '!=' /builddir/build/BUILD/python-starlette-0.45.1-build/BUILDROOT/usr/lib/python3.13/site-packages ']' + '[' -d /builddir/build/BUILD/python-starlette-0.45.1-build/BUILDROOT/usr/lib64/python3.13/site-packages ']' + for site_dir in ${site_dirs[@]} + for distinfo in /builddir/build/BUILD/python-starlette-0.45.1-build/BUILDROOT$site_dir/*.dist-info + echo '%ghost /usr/lib/python3.13/site-packages/starlette-0.45.1.dist-info' + sed -i s/pip/rpm/ /builddir/build/BUILD/python-starlette-0.45.1-build/BUILDROOT/usr/lib/python3.13/site-packages/starlette-0.45.1.dist-info/INSTALLER + PYTHONPATH=/usr/lib/rpm/redhat + /usr/bin/python3 -B /usr/lib/rpm/redhat/pyproject_preprocess_record.py --buildroot /builddir/build/BUILD/python-starlette-0.45.1-build/BUILDROOT --record /builddir/build/BUILD/python-starlette-0.45.1-build/BUILDROOT/usr/lib/python3.13/site-packages/starlette-0.45.1.dist-info/RECORD --output /builddir/build/BUILD/python-starlette-0.45.1-build/python-starlette-0.45.1-1.fc42.x86_64-pyproject-record + rm -fv /builddir/build/BUILD/python-starlette-0.45.1-build/BUILDROOT/usr/lib/python3.13/site-packages/starlette-0.45.1.dist-info/RECORD removed '/builddir/build/BUILD/python-starlette-0.45.1-build/BUILDROOT/usr/lib/python3.13/site-packages/starlette-0.45.1.dist-info/RECORD' + rm -fv /builddir/build/BUILD/python-starlette-0.45.1-build/BUILDROOT/usr/lib/python3.13/site-packages/starlette-0.45.1.dist-info/REQUESTED removed '/builddir/build/BUILD/python-starlette-0.45.1-build/BUILDROOT/usr/lib/python3.13/site-packages/starlette-0.45.1.dist-info/REQUESTED' ++ wc -l /builddir/build/BUILD/python-starlette-0.45.1-build/python-starlette-0.45.1-1.fc42.x86_64-pyproject-ghost-distinfo ++ cut -f1 '-d ' + lines=1 + '[' 1 -ne 1 ']' + RPM_FILES_ESCAPE=4.19 + /usr/bin/python3 /usr/lib/rpm/redhat/pyproject_save_files.py --output-files /builddir/build/BUILD/python-starlette-0.45.1-build/python-starlette-0.45.1-1.fc42.x86_64-pyproject-files --output-modules /builddir/build/BUILD/python-starlette-0.45.1-build/python-starlette-0.45.1-1.fc42.x86_64-pyproject-modules --buildroot /builddir/build/BUILD/python-starlette-0.45.1-build/BUILDROOT --sitelib /usr/lib/python3.13/site-packages --sitearch /usr/lib64/python3.13/site-packages --python-version 3.13 --pyproject-record /builddir/build/BUILD/python-starlette-0.45.1-build/python-starlette-0.45.1-1.fc42.x86_64-pyproject-record --prefix /usr -l starlette + /usr/lib/rpm/check-buildroot + /usr/lib/rpm/redhat/brp-ldconfig + /usr/lib/rpm/brp-compress + /usr/lib/rpm/brp-strip /usr/bin/strip + /usr/lib/rpm/brp-strip-comment-note /usr/bin/strip /usr/bin/objdump + /usr/lib/rpm/redhat/brp-strip-lto /usr/bin/strip + /usr/lib/rpm/brp-strip-static-archive /usr/bin/strip + /usr/lib/rpm/check-rpaths + /usr/lib/rpm/redhat/brp-mangle-shebangs + /usr/lib/rpm/brp-remove-la-files + env /usr/lib/rpm/redhat/brp-python-bytecompile '' 1 0 -j2 Bytecompiling .py files below /builddir/build/BUILD/python-starlette-0.45.1-build/BUILDROOT/usr/lib/python3.13 using python3.13 + /usr/lib/rpm/redhat/brp-python-hardlink + /usr/bin/add-determinism --brp -j2 /builddir/build/BUILD/python-starlette-0.45.1-build/BUILDROOT /builddir/build/BUILD/python-starlette-0.45.1-build/BUILDROOT/usr/lib/python3.13/site-packages/starlette/middleware/__pycache__/__init__.cpython-313.pyc: rewriting with normalized contents /builddir/build/BUILD/python-starlette-0.45.1-build/BUILDROOT/usr/lib/python3.13/site-packages/starlette/middleware/__pycache__/authentication.cpython-313.pyc: rewriting with normalized contents /builddir/build/BUILD/python-starlette-0.45.1-build/BUILDROOT/usr/lib/python3.13/site-packages/starlette/middleware/__pycache__/cors.cpython-313.pyc: rewriting with normalized contents /builddir/build/BUILD/python-starlette-0.45.1-build/BUILDROOT/usr/lib/python3.13/site-packages/starlette/middleware/__pycache__/base.cpython-313.pyc: replacing with normalized version /builddir/build/BUILD/python-starlette-0.45.1-build/BUILDROOT/usr/lib/python3.13/site-packages/starlette/middleware/__pycache__/errors.cpython-313.pyc: rewriting with normalized contents /builddir/build/BUILD/python-starlette-0.45.1-build/BUILDROOT/usr/lib/python3.13/site-packages/starlette/middleware/__pycache__/exceptions.cpython-313.pyc: replacing with normalized version /builddir/build/BUILD/python-starlette-0.45.1-build/BUILDROOT/usr/lib/python3.13/site-packages/starlette/middleware/__pycache__/gzip.cpython-313.pyc: rewriting with normalized contents /builddir/build/BUILD/python-starlette-0.45.1-build/BUILDROOT/usr/lib/python3.13/site-packages/starlette/middleware/__pycache__/httpsredirect.cpython-313.pyc: rewriting with normalized contents /builddir/build/BUILD/python-starlette-0.45.1-build/BUILDROOT/usr/lib/python3.13/site-packages/starlette/middleware/__pycache__/trustedhost.cpython-313.pyc: replacing with normalized version /builddir/build/BUILD/python-starlette-0.45.1-build/BUILDROOT/usr/lib/python3.13/site-packages/starlette/middleware/__pycache__/sessions.cpython-313.pyc: rewriting with normalized contents /builddir/build/BUILD/python-starlette-0.45.1-build/BUILDROOT/usr/lib/python3.13/site-packages/starlette/middleware/__pycache__/wsgi.cpython-313.pyc: replacing with normalized version /builddir/build/BUILD/python-starlette-0.45.1-build/BUILDROOT/usr/lib/python3.13/site-packages/starlette/middleware/__pycache__/base.cpython-313.opt-1.pyc: replacing with normalized version /builddir/build/BUILD/python-starlette-0.45.1-build/BUILDROOT/usr/lib/python3.13/site-packages/starlette/middleware/__pycache__/exceptions.cpython-313.opt-1.pyc: replacing with normalized version /builddir/build/BUILD/python-starlette-0.45.1-build/BUILDROOT/usr/lib/python3.13/site-packages/starlette/middleware/__pycache__/trustedhost.cpython-313.opt-1.pyc: replacing with normalized version /builddir/build/BUILD/python-starlette-0.45.1-build/BUILDROOT/usr/lib/python3.13/site-packages/starlette/__pycache__/__init__.cpython-313.pyc: rewriting with normalized contents /builddir/build/BUILD/python-starlette-0.45.1-build/BUILDROOT/usr/lib/python3.13/site-packages/starlette/__pycache__/_exception_handler.cpython-313.pyc: rewriting with normalized contents /builddir/build/BUILD/python-starlette-0.45.1-build/BUILDROOT/usr/lib/python3.13/site-packages/starlette/__pycache__/_utils.cpython-313.pyc: rewriting with normalized contents /builddir/build/BUILD/python-starlette-0.45.1-build/BUILDROOT/usr/lib/python3.13/site-packages/starlette/middleware/__pycache__/wsgi.cpython-313.opt-1.pyc: replacing with normalized version /builddir/build/BUILD/python-starlette-0.45.1-build/BUILDROOT/usr/lib/python3.13/site-packages/starlette/__pycache__/applications.cpython-313.pyc: replacing with normalized version /builddir/build/BUILD/python-starlette-0.45.1-build/BUILDROOT/usr/lib/python3.13/site-packages/starlette/__pycache__/authentication.cpython-313.pyc: replacing with normalized version /builddir/build/BUILD/python-starlette-0.45.1-build/BUILDROOT/usr/lib/python3.13/site-packages/starlette/__pycache__/background.cpython-313.pyc: rewriting with normalized contents /builddir/build/BUILD/python-starlette-0.45.1-build/BUILDROOT/usr/lib/python3.13/site-packages/starlette/__pycache__/concurrency.cpython-313.pyc: rewriting with normalized contents /builddir/build/BUILD/python-starlette-0.45.1-build/BUILDROOT/usr/lib/python3.13/site-packages/starlette/__pycache__/convertors.cpython-313.pyc: replacing with normalized version /builddir/build/BUILD/python-starlette-0.45.1-build/BUILDROOT/usr/lib/python3.13/site-packages/starlette/__pycache__/config.cpython-313.pyc: rewriting with normalized contents /builddir/build/BUILD/python-starlette-0.45.1-build/BUILDROOT/usr/lib/python3.13/site-packages/starlette/__pycache__/endpoints.cpython-313.pyc: replacing with normalized version /builddir/build/BUILD/python-starlette-0.45.1-build/BUILDROOT/usr/lib/python3.13/site-packages/starlette/__pycache__/exceptions.cpython-313.pyc: rewriting with normalized contents /builddir/build/BUILD/python-starlette-0.45.1-build/BUILDROOT/usr/lib/python3.13/site-packages/starlette/__pycache__/formparsers.cpython-313.pyc: replacing with normalized version /builddir/build/BUILD/python-starlette-0.45.1-build/BUILDROOT/usr/lib/python3.13/site-packages/starlette/__pycache__/requests.cpython-313.pyc: replacing with normalized version /builddir/build/BUILD/python-starlette-0.45.1-build/BUILDROOT/usr/lib/python3.13/site-packages/starlette/__pycache__/datastructures.cpython-313.pyc: replacing with normalized version /builddir/build/BUILD/python-starlette-0.45.1-build/BUILDROOT/usr/lib/python3.13/site-packages/starlette/__pycache__/responses.cpython-313.pyc: replacing with normalized version /builddir/build/BUILD/python-starlette-0.45.1-build/BUILDROOT/usr/lib/python3.13/site-packages/starlette/__pycache__/schemas.cpython-313.pyc: replacing with normalized version /builddir/build/BUILD/python-starlette-0.45.1-build/BUILDROOT/usr/lib/python3.13/site-packages/starlette/__pycache__/staticfiles.cpython-313.pyc: replacing with normalized version /builddir/build/BUILD/python-starlette-0.45.1-build/BUILDROOT/usr/lib/python3.13/site-packages/starlette/__pycache__/status.cpython-313.pyc: rewriting with normalized contents /builddir/build/BUILD/python-starlette-0.45.1-build/BUILDROOT/usr/lib/python3.13/site-packages/starlette/__pycache__/routing.cpython-313.pyc: replacing with normalized version /builddir/build/BUILD/python-starlette-0.45.1-build/BUILDROOT/usr/lib/python3.13/site-packages/starlette/__pycache__/templating.cpython-313.pyc: replacing with normalized version /builddir/build/BUILD/python-starlette-0.45.1-build/BUILDROOT/usr/lib/python3.13/site-packages/starlette/__pycache__/types.cpython-313.pyc: rewriting with normalized contents /builddir/build/BUILD/python-starlette-0.45.1-build/BUILDROOT/usr/lib/python3.13/site-packages/starlette/__pycache__/websockets.cpython-313.pyc: replacing with normalized version /builddir/build/BUILD/python-starlette-0.45.1-build/BUILDROOT/usr/lib/python3.13/site-packages/starlette/__pycache__/authentication.cpython-313.opt-1.pyc: replacing with normalized version /builddir/build/BUILD/python-starlette-0.45.1-build/BUILDROOT/usr/lib/python3.13/site-packages/starlette/__pycache__/applications.cpython-313.opt-1.pyc: replacing with normalized version /builddir/build/BUILD/python-starlette-0.45.1-build/BUILDROOT/usr/lib/python3.13/site-packages/starlette/__pycache__/testclient.cpython-313.pyc: replacing with normalized version /builddir/build/BUILD/python-starlette-0.45.1-build/BUILDROOT/usr/lib/python3.13/site-packages/starlette/__pycache__/convertors.cpython-313.opt-1.pyc: replacing with normalized version /builddir/build/BUILD/python-starlette-0.45.1-build/BUILDROOT/usr/lib/python3.13/site-packages/starlette/__pycache__/formparsers.cpython-313.opt-1.pyc: replacing with normalized version /builddir/build/BUILD/python-starlette-0.45.1-build/BUILDROOT/usr/lib/python3.13/site-packages/starlette/__pycache__/endpoints.cpython-313.opt-1.pyc: replacing with normalized version /builddir/build/BUILD/python-starlette-0.45.1-build/BUILDROOT/usr/lib/python3.13/site-packages/starlette/__pycache__/schemas.cpython-313.opt-1.pyc: replacing with normalized version /builddir/build/BUILD/python-starlette-0.45.1-build/BUILDROOT/usr/lib/python3.13/site-packages/starlette/__pycache__/requests.cpython-313.opt-1.pyc: replacing with normalized version /builddir/build/BUILD/python-starlette-0.45.1-build/BUILDROOT/usr/lib/python3.13/site-packages/starlette/__pycache__/staticfiles.cpython-313.opt-1.pyc: replacing with normalized version /builddir/build/BUILD/python-starlette-0.45.1-build/BUILDROOT/usr/lib/python3.13/site-packages/starlette/__pycache__/datastructures.cpython-313.opt-1.pyc: replacing with normalized version /builddir/build/BUILD/python-starlette-0.45.1-build/BUILDROOT/usr/lib/python3.13/site-packages/starlette/__pycache__/templating.cpython-313.opt-1.pyc: replacing with normalized version /builddir/build/BUILD/python-starlette-0.45.1-build/BUILDROOT/usr/lib/python3.13/site-packages/starlette/__pycache__/responses.cpython-313.opt-1.pyc: replacing with normalized version /builddir/build/BUILD/python-starlette-0.45.1-build/BUILDROOT/usr/lib/python3.13/site-packages/starlette/__pycache__/testclient.cpython-313.opt-1.pyc: replacing with normalized version /builddir/build/BUILD/python-starlette-0.45.1-build/BUILDROOT/usr/lib/python3.13/site-packages/starlette/__pycache__/websockets.cpython-313.opt-1.pyc: replacing with normalized version /builddir/build/BUILD/python-starlette-0.45.1-build/BUILDROOT/usr/lib/python3.13/site-packages/starlette/__pycache__/routing.cpython-313.opt-1.pyc: replacing with normalized version Scanned 11 directories and 107 files, processed 52 inodes, 52 modified (36 replaced + 16 rewritten), 0 unsupported format, 0 errors Executing(%check): /bin/sh -e /var/tmp/rpm-tmp.1dE1Dg + umask 022 + cd /builddir/build/BUILD/python-starlette-0.45.1-build + CFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer ' + export CFLAGS + CXXFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer ' + export CXXFLAGS + FFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -I/usr/lib64/gfortran/modules ' + export FFLAGS + FCFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -I/usr/lib64/gfortran/modules ' + export FCFLAGS + VALAFLAGS=-g + export VALAFLAGS + RUSTFLAGS='-Copt-level=3 -Cdebuginfo=2 -Ccodegen-units=1 -Cstrip=none -Cforce-frame-pointers=yes -Clink-arg=-specs=/usr/lib/rpm/redhat/redhat-package-notes --cap-lints=warn' + export RUSTFLAGS + LDFLAGS='-Wl,-z,relro -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes ' + export LDFLAGS + LT_SYS_LIBRARY_PATH=/usr/lib64: + export LT_SYS_LIBRARY_PATH + CC=gcc + export CC + CXX=g++ + export CXX + cd python-starlette-0.45.1 + '[' '!' -f /builddir/build/BUILD/python-starlette-0.45.1-build/python-starlette-0.45.1-1.fc42.x86_64-pyproject-modules ']' + PATH=/builddir/build/BUILD/python-starlette-0.45.1-build/BUILDROOT/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin + PYTHONPATH=/builddir/build/BUILD/python-starlette-0.45.1-build/BUILDROOT/usr/lib64/python3.13/site-packages:/builddir/build/BUILD/python-starlette-0.45.1-build/BUILDROOT/usr/lib/python3.13/site-packages + _PYTHONSITE=/builddir/build/BUILD/python-starlette-0.45.1-build/BUILDROOT/usr/lib64/python3.13/site-packages:/builddir/build/BUILD/python-starlette-0.45.1-build/BUILDROOT/usr/lib/python3.13/site-packages + PYTHONDONTWRITEBYTECODE=1 + /usr/bin/python3 -sP /usr/lib/rpm/redhat/import_all_modules.py -f /builddir/build/BUILD/python-starlette-0.45.1-build/python-starlette-0.45.1-1.fc42.x86_64-pyproject-modules Check import: starlette Check import: starlette.applications Check import: starlette.authentication Check import: starlette.background Check import: starlette.concurrency Check import: starlette.config Check import: starlette.convertors Check import: starlette.datastructures Check import: starlette.endpoints Check import: starlette.exceptions Check import: starlette.formparsers Check import: starlette.middleware Check import: starlette.middleware.authentication Check import: starlette.middleware.base Check import: starlette.middleware.cors Check import: starlette.middleware.errors Check import: starlette.middleware.exceptions Check import: starlette.middleware.gzip Check import: starlette.middleware.httpsredirect Check import: starlette.middleware.sessions Check import: starlette.middleware.trustedhost Check import: starlette.middleware.wsgi Check import: starlette.requests Check import: starlette.responses Check import: starlette.routing Check import: starlette.schemas Check import: starlette.staticfiles Check import: starlette.status Check import: starlette.templating Check import: starlette.testclient Check import: starlette.types Check import: starlette.websockets + warningsfilter=' -W ignore::trio.TrioDeprecationWarning' + k='not test_lifespan_with_on_events' + CFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer ' + LDFLAGS='-Wl,-z,relro -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes ' + PATH=/builddir/build/BUILD/python-starlette-0.45.1-build/BUILDROOT/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin + PYTHONPATH=/builddir/build/BUILD/python-starlette-0.45.1-build/BUILDROOT/usr/lib64/python3.13/site-packages:/builddir/build/BUILD/python-starlette-0.45.1-build/BUILDROOT/usr/lib/python3.13/site-packages + PYTHONDONTWRITEBYTECODE=1 + PYTEST_XDIST_AUTO_NUM_WORKERS=2 + /usr/bin/pytest -W ignore::trio.TrioDeprecationWarning -k 'not test_lifespan_with_on_events' -v ============================= test session starts ============================== platform linux -- Python 3.13.1, pytest-8.3.4, pluggy-1.5.0 -- /usr/bin/python3 cachedir: .pytest_cache rootdir: /builddir/build/BUILD/python-starlette-0.45.1-build/python-starlette-0.45.1 configfile: pyproject.toml plugins: anyio-3.7.1 collecting ... collected 888 items / 2 deselected / 886 selected tests/middleware/test_base.py::test_custom_middleware[asyncio] FAILED [ 0%] tests/middleware/test_base.py::test_custom_middleware[trio] FAILED [ 0%] tests/middleware/test_base.py::test_state_data_across_multiple_middlewares[asyncio] FAILED [ 0%] tests/middleware/test_base.py::test_state_data_across_multiple_middlewares[trio] FAILED [ 0%] tests/middleware/test_base.py::test_app_middleware_argument[asyncio] FAILED [ 0%] tests/middleware/test_base.py::test_app_middleware_argument[trio] FAILED [ 0%] tests/middleware/test_base.py::test_fully_evaluated_response[asyncio] FAILED [ 0%] tests/middleware/test_base.py::test_fully_evaluated_response[trio] FAILED [ 0%] tests/middleware/test_base.py::test_contextvars[asyncio-CustomMiddlewareWithoutBaseHTTPMiddleware] PASSED [ 1%] tests/middleware/test_base.py::test_contextvars[asyncio-CustomMiddlewareUsingBaseHTTPMiddleware] FAILED [ 1%] tests/middleware/test_base.py::test_contextvars[trio-CustomMiddlewareWithoutBaseHTTPMiddleware] PASSED [ 1%] tests/middleware/test_base.py::test_contextvars[trio-CustomMiddlewareUsingBaseHTTPMiddleware] FAILED [ 1%] tests/middleware/test_base.py::test_run_background_tasks_even_if_client_disconnects[asyncio] FAILED [ 1%] tests/middleware/test_base.py::test_run_background_tasks_even_if_client_disconnects[trio] FAILED [ 1%] tests/middleware/test_base.py::test_do_not_block_on_background_tasks[asyncio] FAILED [ 1%] tests/middleware/test_base.py::test_do_not_block_on_background_tasks[trio] FAILED [ 1%] tests/middleware/test_base.py::test_run_context_manager_exit_even_if_client_disconnects[asyncio] FAILED [ 1%] tests/middleware/test_base.py::test_run_context_manager_exit_even_if_client_disconnects[trio] FAILED [ 2%] tests/middleware/test_base.py::test_app_receives_http_disconnect_while_sending_if_discarded[asyncio] FAILED [ 2%] tests/middleware/test_base.py::test_app_receives_http_disconnect_while_sending_if_discarded[trio] FAILED [ 2%] tests/middleware/test_base.py::test_app_receives_http_disconnect_after_sending_if_discarded[asyncio] FAILED [ 2%] tests/middleware/test_base.py::test_app_receives_http_disconnect_after_sending_if_discarded[trio] FAILED [ 2%] tests/middleware/test_base.py::test_read_request_stream_in_app_after_middleware_calls_stream[asyncio] FAILED [ 2%] tests/middleware/test_base.py::test_read_request_stream_in_app_after_middleware_calls_stream[trio] FAILED [ 2%] tests/middleware/test_base.py::test_read_request_stream_in_app_after_middleware_calls_body[asyncio] FAILED [ 2%] tests/middleware/test_base.py::test_read_request_stream_in_app_after_middleware_calls_body[trio] FAILED [ 2%] tests/middleware/test_base.py::test_read_request_body_in_app_after_middleware_calls_stream[asyncio] FAILED [ 3%] tests/middleware/test_base.py::test_read_request_body_in_app_after_middleware_calls_stream[trio] FAILED [ 3%] tests/middleware/test_base.py::test_read_request_body_in_app_after_middleware_calls_body[asyncio] FAILED [ 3%] tests/middleware/test_base.py::test_read_request_body_in_app_after_middleware_calls_body[trio] FAILED [ 3%] tests/middleware/test_base.py::test_read_request_stream_in_dispatch_after_app_calls_stream[asyncio] FAILED [ 3%] tests/middleware/test_base.py::test_read_request_stream_in_dispatch_after_app_calls_stream[trio] FAILED [ 3%] tests/middleware/test_base.py::test_read_request_stream_in_dispatch_after_app_calls_body[asyncio] FAILED [ 3%] tests/middleware/test_base.py::test_read_request_stream_in_dispatch_after_app_calls_body[trio] FAILED [ 3%] tests/middleware/test_base.py::test_read_request_stream_in_dispatch_wrapping_app_calls_body[asyncio] FAILED [ 3%] tests/middleware/test_base.py::test_read_request_stream_in_dispatch_wrapping_app_calls_body[trio] FAILED [ 4%] tests/middleware/test_base.py::test_read_request_stream_in_dispatch_after_app_calls_body_with_middleware_calling_body_before_call_next[asyncio] FAILED [ 4%] tests/middleware/test_base.py::test_read_request_stream_in_dispatch_after_app_calls_body_with_middleware_calling_body_before_call_next[trio] FAILED [ 4%] tests/middleware/test_base.py::test_read_request_body_in_dispatch_after_app_calls_body_with_middleware_calling_body_before_call_next[asyncio] FAILED [ 4%] tests/middleware/test_base.py::test_read_request_body_in_dispatch_after_app_calls_body_with_middleware_calling_body_before_call_next[trio] FAILED [ 4%] tests/middleware/test_base.py::test_read_request_disconnected_client[asyncio] FAILED [ 4%] tests/middleware/test_base.py::test_read_request_disconnected_client[trio] FAILED [ 4%] tests/middleware/test_base.py::test_read_request_disconnected_after_consuming_steam[asyncio] FAILED [ 4%] tests/middleware/test_base.py::test_read_request_disconnected_after_consuming_steam[trio] FAILED [ 4%] tests/middleware/test_base.py::test_downstream_middleware_modifies_receive[asyncio] FAILED [ 5%] tests/middleware/test_base.py::test_downstream_middleware_modifies_receive[trio] FAILED [ 5%] tests/middleware/test_base.py::test_pr_1519_comment_1236166180_example FAILED [ 5%] tests/middleware/test_base.py::test_multiple_middlewares_stacked_client_disconnected[asyncio] FAILED [ 5%] tests/middleware/test_base.py::test_multiple_middlewares_stacked_client_disconnected[trio] FAILED [ 5%] tests/middleware/test_base.py::test_poll_for_disconnect_repeated[asyncio-True] FAILED [ 5%] tests/middleware/test_base.py::test_poll_for_disconnect_repeated[asyncio-False] FAILED [ 5%] tests/middleware/test_base.py::test_poll_for_disconnect_repeated[trio-True] FAILED [ 5%] tests/middleware/test_base.py::test_poll_for_disconnect_repeated[trio-False] FAILED [ 5%] tests/middleware/test_cors.py::test_cors_allow_all[asyncio] PASSED [ 6%] tests/middleware/test_cors.py::test_cors_allow_all[trio] PASSED [ 6%] tests/middleware/test_cors.py::test_cors_allow_all_except_credentials[asyncio] PASSED [ 6%] tests/middleware/test_cors.py::test_cors_allow_all_except_credentials[trio] PASSED [ 6%] tests/middleware/test_cors.py::test_cors_allow_specific_origin[asyncio] PASSED [ 6%] tests/middleware/test_cors.py::test_cors_allow_specific_origin[trio] PASSED [ 6%] tests/middleware/test_cors.py::test_cors_disallowed_preflight[asyncio] PASSED [ 6%] tests/middleware/test_cors.py::test_cors_disallowed_preflight[trio] PASSED [ 6%] tests/middleware/test_cors.py::test_preflight_allows_request_origin_if_origins_wildcard_and_credentials_allowed[asyncio] PASSED [ 6%] tests/middleware/test_cors.py::test_preflight_allows_request_origin_if_origins_wildcard_and_credentials_allowed[trio] PASSED [ 7%] tests/middleware/test_cors.py::test_cors_preflight_allow_all_methods[asyncio] PASSED [ 7%] tests/middleware/test_cors.py::test_cors_preflight_allow_all_methods[trio] PASSED [ 7%] tests/middleware/test_cors.py::test_cors_allow_all_methods[asyncio] PASSED [ 7%] tests/middleware/test_cors.py::test_cors_allow_all_methods[trio] PASSED [ 7%] tests/middleware/test_cors.py::test_cors_allow_origin_regex[asyncio] PASSED [ 7%] tests/middleware/test_cors.py::test_cors_allow_origin_regex[trio] PASSED [ 7%] tests/middleware/test_cors.py::test_cors_allow_origin_regex_fullmatch[asyncio] PASSED [ 7%] tests/middleware/test_cors.py::test_cors_allow_origin_regex_fullmatch[trio] PASSED [ 8%] tests/middleware/test_cors.py::test_cors_credentialed_requests_return_specific_origin[asyncio] PASSED [ 8%] tests/middleware/test_cors.py::test_cors_credentialed_requests_return_specific_origin[trio] PASSED [ 8%] tests/middleware/test_cors.py::test_cors_vary_header_defaults_to_origin[asyncio] PASSED [ 8%] tests/middleware/test_cors.py::test_cors_vary_header_defaults_to_origin[trio] PASSED [ 8%] tests/middleware/test_cors.py::test_cors_vary_header_is_not_set_for_non_credentialed_request[asyncio] PASSED [ 8%] tests/middleware/test_cors.py::test_cors_vary_header_is_not_set_for_non_credentialed_request[trio] PASSED [ 8%] tests/middleware/test_cors.py::test_cors_vary_header_is_properly_set_for_credentialed_request[asyncio] PASSED [ 8%] tests/middleware/test_cors.py::test_cors_vary_header_is_properly_set_for_credentialed_request[trio] PASSED [ 8%] tests/middleware/test_cors.py::test_cors_vary_header_is_properly_set_when_allow_origins_is_not_wildcard[asyncio] PASSED [ 9%] tests/middleware/test_cors.py::test_cors_vary_header_is_properly_set_when_allow_origins_is_not_wildcard[trio] PASSED [ 9%] tests/middleware/test_cors.py::test_cors_allowed_origin_does_not_leak_between_credentialed_requests[asyncio] PASSED [ 9%] tests/middleware/test_cors.py::test_cors_allowed_origin_does_not_leak_between_credentialed_requests[trio] PASSED [ 9%] tests/middleware/test_errors.py::test_handler[asyncio] PASSED [ 9%] tests/middleware/test_errors.py::test_handler[trio] PASSED [ 9%] tests/middleware/test_errors.py::test_debug_text[asyncio] PASSED [ 9%] tests/middleware/test_errors.py::test_debug_text[trio] PASSED [ 9%] tests/middleware/test_errors.py::test_debug_html[asyncio] PASSED [ 9%] tests/middleware/test_errors.py::test_debug_html[trio] PASSED [ 10%] tests/middleware/test_errors.py::test_debug_after_response_sent[asyncio] PASSED [ 10%] tests/middleware/test_errors.py::test_debug_after_response_sent[trio] PASSED [ 10%] tests/middleware/test_errors.py::test_debug_not_http[asyncio] FAILED [ 10%] tests/middleware/test_errors.py::test_debug_not_http[trio] FAILED [ 10%] tests/middleware/test_errors.py::test_background_task[asyncio] PASSED [ 10%] tests/middleware/test_errors.py::test_background_task[trio] PASSED [ 10%] tests/middleware/test_gzip.py::test_gzip_responses[asyncio] PASSED [ 10%] tests/middleware/test_gzip.py::test_gzip_responses[trio] PASSED [ 10%] tests/middleware/test_gzip.py::test_gzip_not_in_accept_encoding[asyncio] PASSED [ 11%] tests/middleware/test_gzip.py::test_gzip_not_in_accept_encoding[trio] PASSED [ 11%] tests/middleware/test_gzip.py::test_gzip_ignored_for_small_responses[asyncio] PASSED [ 11%] tests/middleware/test_gzip.py::test_gzip_ignored_for_small_responses[trio] PASSED [ 11%] tests/middleware/test_gzip.py::test_gzip_streaming_response[asyncio] PASSED [ 11%] tests/middleware/test_gzip.py::test_gzip_streaming_response[trio] PASSED [ 11%] tests/middleware/test_gzip.py::test_gzip_ignored_for_responses_with_encoding_set[asyncio] PASSED [ 11%] tests/middleware/test_gzip.py::test_gzip_ignored_for_responses_with_encoding_set[trio] PASSED [ 11%] tests/middleware/test_https_redirect.py::test_https_redirect_middleware[asyncio] PASSED [ 11%] tests/middleware/test_https_redirect.py::test_https_redirect_middleware[trio] PASSED [ 12%] tests/middleware/test_middleware.py::test_middleware_repr PASSED [ 12%] tests/middleware/test_middleware.py::test_middleware_iter PASSED [ 12%] tests/middleware/test_session.py::test_session[asyncio] PASSED [ 12%] tests/middleware/test_session.py::test_session[trio] PASSED [ 12%] tests/middleware/test_session.py::test_session_expires[asyncio] PASSED [ 12%] tests/middleware/test_session.py::test_session_expires[trio] PASSED [ 12%] tests/middleware/test_session.py::test_secure_session[asyncio] PASSED [ 12%] tests/middleware/test_session.py::test_secure_session[trio] PASSED [ 12%] tests/middleware/test_session.py::test_session_cookie_subpath[asyncio] PASSED [ 13%] tests/middleware/test_session.py::test_session_cookie_subpath[trio] PASSED [ 13%] tests/middleware/test_session.py::test_invalid_session_cookie[asyncio] PASSED [ 13%] tests/middleware/test_session.py::test_invalid_session_cookie[trio] PASSED [ 13%] tests/middleware/test_session.py::test_session_cookie[asyncio] PASSED [ 13%] tests/middleware/test_session.py::test_session_cookie[trio] PASSED [ 13%] tests/middleware/test_session.py::test_domain_cookie[asyncio] PASSED [ 13%] tests/middleware/test_session.py::test_domain_cookie[trio] PASSED [ 13%] tests/middleware/test_trusted_host.py::test_trusted_host_middleware[asyncio] PASSED [ 13%] tests/middleware/test_trusted_host.py::test_trusted_host_middleware[trio] PASSED [ 14%] tests/middleware/test_trusted_host.py::test_default_allowed_hosts PASSED [ 14%] tests/middleware/test_trusted_host.py::test_www_redirect[asyncio] PASSED [ 14%] tests/middleware/test_trusted_host.py::test_www_redirect[trio] PASSED [ 14%] tests/middleware/test_wsgi.py::test_wsgi_get[asyncio] PASSED [ 14%] tests/middleware/test_wsgi.py::test_wsgi_get[trio] PASSED [ 14%] tests/middleware/test_wsgi.py::test_wsgi_post[asyncio] PASSED [ 14%] tests/middleware/test_wsgi.py::test_wsgi_post[trio] PASSED [ 14%] tests/middleware/test_wsgi.py::test_wsgi_exception[asyncio] PASSED [ 15%] tests/middleware/test_wsgi.py::test_wsgi_exception[trio] PASSED [ 15%] tests/middleware/test_wsgi.py::test_wsgi_exc_info[asyncio] PASSED [ 15%] tests/middleware/test_wsgi.py::test_wsgi_exc_info[trio] PASSED [ 15%] tests/middleware/test_wsgi.py::test_build_environ PASSED [ 15%] tests/middleware/test_wsgi.py::test_build_environ_encoding PASSED [ 15%] tests/test__utils.py::test_async_func PASSED [ 15%] tests/test__utils.py::test_async_partial PASSED [ 15%] tests/test__utils.py::test_async_method PASSED [ 15%] tests/test__utils.py::test_async_object_call PASSED [ 16%] tests/test__utils.py::test_async_partial_object_call PASSED [ 16%] tests/test__utils.py::test_async_nested_partial PASSED [ 16%] tests/test__utils.py::test_get_route_path[scope0-/foo-123/bar] PASSED [ 16%] tests/test__utils.py::test_get_route_path[scope1-/bar] PASSED [ 16%] tests/test__utils.py::test_get_route_path[scope2-] PASSED [ 16%] tests/test__utils.py::test_get_route_path[scope3-/foo/bar] PASSED [ 16%] tests/test_applications.py::test_url_path_for PASSED [ 16%] tests/test_applications.py::test_func_route[asyncio] ERROR [ 16%] tests/test_applications.py::test_func_route[trio] ERROR [ 17%] tests/test_applications.py::test_async_route[asyncio] ERROR [ 17%] tests/test_applications.py::test_async_route[trio] ERROR [ 17%] tests/test_applications.py::test_class_route[asyncio] ERROR [ 17%] tests/test_applications.py::test_class_route[trio] ERROR [ 17%] tests/test_applications.py::test_mounted_route[asyncio] ERROR [ 17%] tests/test_applications.py::test_mounted_route[trio] ERROR [ 17%] tests/test_applications.py::test_mounted_route_path_params[asyncio] ERROR [ 17%] tests/test_applications.py::test_mounted_route_path_params[trio] ERROR [ 17%] tests/test_applications.py::test_subdomain_route[asyncio] PASSED [ 18%] tests/test_applications.py::test_subdomain_route[trio] PASSED [ 18%] tests/test_applications.py::test_websocket_route[asyncio] ERROR [ 18%] tests/test_applications.py::test_websocket_route[trio] ERROR [ 18%] tests/test_applications.py::test_400[asyncio] ERROR [ 18%] tests/test_applications.py::test_400[trio] ERROR [ 18%] tests/test_applications.py::test_405[asyncio] ERROR [ 18%] tests/test_applications.py::test_405[trio] ERROR [ 18%] tests/test_applications.py::test_500[asyncio] PASSED [ 18%] tests/test_applications.py::test_500[trio] PASSED [ 19%] tests/test_applications.py::test_websocket_raise_websocket_exception[asyncio] ERROR [ 19%] tests/test_applications.py::test_websocket_raise_websocket_exception[trio] ERROR [ 19%] tests/test_applications.py::test_websocket_raise_http_exception[asyncio] ERROR [ 19%] tests/test_applications.py::test_websocket_raise_http_exception[trio] ERROR [ 19%] tests/test_applications.py::test_websocket_raise_custom_exception[asyncio] ERROR [ 19%] tests/test_applications.py::test_websocket_raise_custom_exception[trio] ERROR [ 19%] tests/test_applications.py::test_middleware[asyncio] PASSED [ 19%] tests/test_applications.py::test_middleware[trio] PASSED [ 19%] tests/test_applications.py::test_routes PASSED [ 20%] tests/test_applications.py::test_app_mount[asyncio] PASSED [ 20%] tests/test_applications.py::test_app_mount[trio] PASSED [ 20%] tests/test_applications.py::test_app_debug[asyncio] PASSED [ 20%] tests/test_applications.py::test_app_debug[trio] PASSED [ 20%] tests/test_applications.py::test_app_add_route[asyncio] PASSED [ 20%] tests/test_applications.py::test_app_add_route[trio] PASSED [ 20%] tests/test_applications.py::test_app_add_websocket_route[asyncio] FAILED [ 20%] tests/test_applications.py::test_app_add_websocket_route[trio] FAILED [ 20%] tests/test_applications.py::test_app_add_event_handler[asyncio] FAILED [ 21%] tests/test_applications.py::test_app_add_event_handler[trio] FAILED [ 21%] tests/test_applications.py::test_app_async_cm_lifespan[asyncio] FAILED [ 21%] tests/test_applications.py::test_app_async_cm_lifespan[trio] FAILED [ 21%] tests/test_applications.py::test_app_async_gen_lifespan[asyncio] FAILED [ 21%] tests/test_applications.py::test_app_async_gen_lifespan[trio] FAILED [ 21%] tests/test_applications.py::test_app_sync_gen_lifespan[asyncio] FAILED [ 21%] tests/test_applications.py::test_app_sync_gen_lifespan[trio] FAILED [ 21%] tests/test_applications.py::test_decorator_deprecations PASSED [ 22%] tests/test_applications.py::test_middleware_stack_init[asyncio] FAILED [ 22%] tests/test_applications.py::test_middleware_stack_init[trio] FAILED [ 22%] tests/test_applications.py::test_middleware_args[asyncio] FAILED [ 22%] tests/test_applications.py::test_middleware_args[trio] FAILED [ 22%] tests/test_applications.py::test_middleware_factory[asyncio] FAILED [ 22%] tests/test_applications.py::test_middleware_factory[trio] FAILED [ 22%] tests/test_applications.py::test_lifespan_app_subclass PASSED [ 22%] tests/test_authentication.py::test_invalid_decorator_usage PASSED [ 22%] tests/test_authentication.py::test_user_interface[asyncio] FAILED [ 23%] tests/test_authentication.py::test_user_interface[trio] FAILED [ 23%] tests/test_authentication.py::test_authentication_required[asyncio] FAILED [ 23%] tests/test_authentication.py::test_authentication_required[trio] FAILED [ 23%] tests/test_authentication.py::test_websocket_authentication_required[asyncio] FAILED [ 23%] tests/test_authentication.py::test_websocket_authentication_required[trio] FAILED [ 23%] tests/test_authentication.py::test_authentication_redirect[asyncio] FAILED [ 23%] tests/test_authentication.py::test_authentication_redirect[trio] FAILED [ 23%] tests/test_authentication.py::test_custom_on_error[asyncio] FAILED [ 23%] tests/test_authentication.py::test_custom_on_error[trio] FAILED [ 24%] tests/test_background.py::test_async_task[asyncio] PASSED [ 24%] tests/test_background.py::test_async_task[trio] PASSED [ 24%] tests/test_background.py::test_sync_task[asyncio] PASSED [ 24%] tests/test_background.py::test_sync_task[trio] PASSED [ 24%] tests/test_background.py::test_multiple_tasks[asyncio] PASSED [ 24%] tests/test_background.py::test_multiple_tasks[trio] PASSED [ 24%] tests/test_background.py::test_multi_tasks_failure_avoids_next_execution[asyncio] PASSED [ 24%] tests/test_background.py::test_multi_tasks_failure_avoids_next_execution[trio] PASSED [ 24%] tests/test_concurrency.py::test_run_until_first_complete[asyncio] PASSED [ 25%] tests/test_concurrency.py::test_run_until_first_complete[trio] PASSED [ 25%] tests/test_concurrency.py::test_accessing_context_from_threaded_sync_endpoint[asyncio] PASSED [ 25%] tests/test_concurrency.py::test_accessing_context_from_threaded_sync_endpoint[trio] PASSED [ 25%] tests/test_concurrency.py::test_iterate_in_threadpool[asyncio] PASSED [ 25%] tests/test_concurrency.py::test_iterate_in_threadpool[trio] PASSED [ 25%] tests/test_config.py::test_config_types PASSED [ 25%] tests/test_config.py::test_config PASSED [ 25%] tests/test_config.py::test_missing_env_file_raises PASSED [ 25%] tests/test_config.py::test_environ PASSED [ 26%] tests/test_config.py::test_config_with_env_prefix PASSED [ 26%] tests/test_convertors.py::test_datetime_convertor[asyncio] PASSED [ 26%] tests/test_convertors.py::test_datetime_convertor[trio] PASSED [ 26%] tests/test_convertors.py::test_default_float_convertor[asyncio-1.0-200] PASSED [ 26%] tests/test_convertors.py::test_default_float_convertor[asyncio-1-0-404] PASSED [ 26%] tests/test_convertors.py::test_default_float_convertor[trio-1.0-200] PASSED [ 26%] tests/test_convertors.py::test_default_float_convertor[trio-1-0-404] PASSED [ 26%] tests/test_convertors.py::test_default_uuid_convertor[asyncio-00000000-aaaa-ffff-9999-000000000000-200] PASSED [ 26%] tests/test_convertors.py::test_default_uuid_convertor[asyncio-00000000aaaaffff9999000000000000-200] PASSED [ 27%] tests/test_convertors.py::test_default_uuid_convertor[asyncio-00000000-AAAA-FFFF-9999-000000000000-200] PASSED [ 27%] tests/test_convertors.py::test_default_uuid_convertor[asyncio-00000000AAAAFFFF9999000000000000-200] PASSED [ 27%] tests/test_convertors.py::test_default_uuid_convertor[asyncio-not-a-uuid-404] PASSED [ 27%] tests/test_convertors.py::test_default_uuid_convertor[trio-00000000-aaaa-ffff-9999-000000000000-200] PASSED [ 27%] tests/test_convertors.py::test_default_uuid_convertor[trio-00000000aaaaffff9999000000000000-200] PASSED [ 27%] tests/test_convertors.py::test_default_uuid_convertor[trio-00000000-AAAA-FFFF-9999-000000000000-200] PASSED [ 27%] tests/test_convertors.py::test_default_uuid_convertor[trio-00000000AAAAFFFF9999000000000000-200] PASSED [ 27%] tests/test_convertors.py::test_default_uuid_convertor[trio-not-a-uuid-404] PASSED [ 27%] tests/test_datastructures.py::test_url PASSED [ 28%] tests/test_datastructures.py::test_url_query_params PASSED [ 28%] tests/test_datastructures.py::test_hidden_password PASSED [ 28%] tests/test_datastructures.py::test_csv PASSED [ 28%] tests/test_datastructures.py::test_url_from_scope PASSED [ 28%] tests/test_datastructures.py::test_headers PASSED [ 28%] tests/test_datastructures.py::test_mutable_headers PASSED [ 28%] tests/test_datastructures.py::test_mutable_headers_merge PASSED [ 28%] tests/test_datastructures.py::test_mutable_headers_merge_dict PASSED [ 29%] tests/test_datastructures.py::test_mutable_headers_update PASSED [ 29%] tests/test_datastructures.py::test_mutable_headers_update_dict PASSED [ 29%] tests/test_datastructures.py::test_mutable_headers_merge_not_mapping PASSED [ 29%] tests/test_datastructures.py::test_headers_mutablecopy PASSED [ 29%] tests/test_datastructures.py::test_mutable_headers_from_scope PASSED [ 29%] tests/test_datastructures.py::test_url_blank_params PASSED [ 29%] tests/test_datastructures.py::test_queryparams PASSED [ 29%] tests/test_datastructures.py::test_upload_file_file_input[asyncio] PASSED [ 29%] tests/test_datastructures.py::test_upload_file_file_input[trio] PASSED [ 30%] tests/test_datastructures.py::test_upload_file_without_size[asyncio] PASSED [ 30%] tests/test_datastructures.py::test_upload_file_without_size[trio] PASSED [ 30%] tests/test_datastructures.py::test_uploadfile_rolling[asyncio-rolled] PASSED [ 30%] tests/test_datastructures.py::test_uploadfile_rolling[asyncio-unrolled] PASSED [ 30%] tests/test_datastructures.py::test_uploadfile_rolling[trio-rolled] PASSED [ 30%] tests/test_datastructures.py::test_uploadfile_rolling[trio-unrolled] PASSED [ 30%] tests/test_datastructures.py::test_formdata PASSED [ 30%] tests/test_datastructures.py::test_upload_file_repr[asyncio] PASSED [ 30%] tests/test_datastructures.py::test_upload_file_repr[trio] PASSED [ 31%] tests/test_datastructures.py::test_upload_file_repr_headers[asyncio] PASSED [ 31%] tests/test_datastructures.py::test_upload_file_repr_headers[trio] PASSED [ 31%] tests/test_datastructures.py::test_multidict PASSED [ 31%] tests/test_endpoints.py::test_http_endpoint_route[asyncio] ERROR [ 31%] tests/test_endpoints.py::test_http_endpoint_route[trio] ERROR [ 31%] tests/test_endpoints.py::test_http_endpoint_route_path_params[asyncio] ERROR [ 31%] tests/test_endpoints.py::test_http_endpoint_route_path_params[trio] ERROR [ 31%] tests/test_endpoints.py::test_http_endpoint_route_method[asyncio] ERROR [ 31%] tests/test_endpoints.py::test_http_endpoint_route_method[trio] ERROR [ 32%] tests/test_endpoints.py::test_websocket_endpoint_on_connect[asyncio] FAILED [ 32%] tests/test_endpoints.py::test_websocket_endpoint_on_connect[trio] FAILED [ 32%] tests/test_endpoints.py::test_websocket_endpoint_on_receive_bytes[asyncio] FAILED [ 32%] tests/test_endpoints.py::test_websocket_endpoint_on_receive_bytes[trio] FAILED [ 32%] tests/test_endpoints.py::test_websocket_endpoint_on_receive_json[asyncio] FAILED [ 32%] tests/test_endpoints.py::test_websocket_endpoint_on_receive_json[trio] FAILED [ 32%] tests/test_endpoints.py::test_websocket_endpoint_on_receive_json_binary[asyncio] FAILED [ 32%] tests/test_endpoints.py::test_websocket_endpoint_on_receive_json_binary[trio] FAILED [ 32%] tests/test_endpoints.py::test_websocket_endpoint_on_receive_text[asyncio] FAILED [ 33%] tests/test_endpoints.py::test_websocket_endpoint_on_receive_text[trio] FAILED [ 33%] tests/test_endpoints.py::test_websocket_endpoint_on_default[asyncio] FAILED [ 33%] tests/test_endpoints.py::test_websocket_endpoint_on_default[trio] FAILED [ 33%] tests/test_endpoints.py::test_websocket_endpoint_on_disconnect[asyncio] FAILED [ 33%] tests/test_endpoints.py::test_websocket_endpoint_on_disconnect[trio] FAILED [ 33%] tests/test_exceptions.py::test_not_acceptable[asyncio] ERROR [ 33%] tests/test_exceptions.py::test_not_acceptable[trio] ERROR [ 33%] tests/test_exceptions.py::test_no_content[asyncio] ERROR [ 33%] tests/test_exceptions.py::test_no_content[trio] ERROR [ 34%] tests/test_exceptions.py::test_not_modified[asyncio] ERROR [ 34%] tests/test_exceptions.py::test_not_modified[trio] ERROR [ 34%] tests/test_exceptions.py::test_with_headers[asyncio] ERROR [ 34%] tests/test_exceptions.py::test_with_headers[trio] ERROR [ 34%] tests/test_exceptions.py::test_websockets_should_raise[asyncio] ERROR [ 34%] tests/test_exceptions.py::test_websockets_should_raise[trio] ERROR [ 34%] tests/test_exceptions.py::test_handled_exc_after_response[asyncio] ERROR [ 34%] tests/test_exceptions.py::test_handled_exc_after_response[trio] ERROR [ 34%] tests/test_exceptions.py::test_force_500_response[asyncio] PASSED [ 35%] tests/test_exceptions.py::test_force_500_response[trio] PASSED [ 35%] tests/test_exceptions.py::test_http_str PASSED [ 35%] tests/test_exceptions.py::test_http_repr PASSED [ 35%] tests/test_exceptions.py::test_websocket_str PASSED [ 35%] tests/test_exceptions.py::test_websocket_repr PASSED [ 35%] tests/test_exceptions.py::test_request_in_app_and_handler_is_the_same_object[asyncio] ERROR [ 35%] tests/test_exceptions.py::test_request_in_app_and_handler_is_the_same_object[trio] ERROR [ 35%] tests/test_formparsers.py::test_multipart_request_data[asyncio] PASSED [ 36%] tests/test_formparsers.py::test_multipart_request_data[trio] PASSED [ 36%] tests/test_formparsers.py::test_multipart_request_files[asyncio] PASSED [ 36%] tests/test_formparsers.py::test_multipart_request_files[trio] PASSED [ 36%] tests/test_formparsers.py::test_multipart_request_files_with_content_type[asyncio] PASSED [ 36%] tests/test_formparsers.py::test_multipart_request_files_with_content_type[trio] PASSED [ 36%] tests/test_formparsers.py::test_multipart_request_multiple_files[asyncio] PASSED [ 36%] tests/test_formparsers.py::test_multipart_request_multiple_files[trio] PASSED [ 36%] tests/test_formparsers.py::test_multipart_request_multiple_files_with_headers[asyncio] PASSED [ 36%] tests/test_formparsers.py::test_multipart_request_multiple_files_with_headers[trio] PASSED [ 37%] tests/test_formparsers.py::test_multi_items[asyncio] PASSED [ 37%] tests/test_formparsers.py::test_multi_items[trio] PASSED [ 37%] tests/test_formparsers.py::test_multipart_request_mixed_files_and_data[asyncio] PASSED [ 37%] tests/test_formparsers.py::test_multipart_request_mixed_files_and_data[trio] PASSED [ 37%] tests/test_formparsers.py::test_multipart_request_with_charset_for_filename[asyncio] PASSED [ 37%] tests/test_formparsers.py::test_multipart_request_with_charset_for_filename[trio] PASSED [ 37%] tests/test_formparsers.py::test_multipart_request_without_charset_for_filename[asyncio] PASSED [ 37%] tests/test_formparsers.py::test_multipart_request_without_charset_for_filename[trio] PASSED [ 37%] tests/test_formparsers.py::test_multipart_request_with_encoded_value[asyncio] PASSED [ 38%] tests/test_formparsers.py::test_multipart_request_with_encoded_value[trio] PASSED [ 38%] tests/test_formparsers.py::test_urlencoded_request_data[asyncio] PASSED [ 38%] tests/test_formparsers.py::test_urlencoded_request_data[trio] PASSED [ 38%] tests/test_formparsers.py::test_no_request_data[asyncio] PASSED [ 38%] tests/test_formparsers.py::test_no_request_data[trio] PASSED [ 38%] tests/test_formparsers.py::test_urlencoded_percent_encoding[asyncio] PASSED [ 38%] tests/test_formparsers.py::test_urlencoded_percent_encoding[trio] PASSED [ 38%] tests/test_formparsers.py::test_urlencoded_percent_encoding_keys[asyncio] PASSED [ 38%] tests/test_formparsers.py::test_urlencoded_percent_encoding_keys[trio] PASSED [ 39%] tests/test_formparsers.py::test_urlencoded_multi_field_app_reads_body[asyncio] PASSED [ 39%] tests/test_formparsers.py::test_urlencoded_multi_field_app_reads_body[trio] PASSED [ 39%] tests/test_formparsers.py::test_multipart_multi_field_app_reads_body[asyncio] PASSED [ 39%] tests/test_formparsers.py::test_multipart_multi_field_app_reads_body[trio] PASSED [ 39%] tests/test_formparsers.py::test_user_safe_decode_helper PASSED [ 39%] tests/test_formparsers.py::test_user_safe_decode_ignores_wrong_charset PASSED [ 39%] tests/test_formparsers.py::test_missing_boundary_parameter[asyncio-app-expectation0] PASSED [ 39%] tests/test_formparsers.py::test_missing_boundary_parameter[asyncio-app1-expectation1] PASSED [ 39%] tests/test_formparsers.py::test_missing_boundary_parameter[trio-app-expectation0] PASSED [ 40%] tests/test_formparsers.py::test_missing_boundary_parameter[trio-app1-expectation1] PASSED [ 40%] tests/test_formparsers.py::test_missing_name_parameter_on_content_disposition[asyncio-app-expectation0] PASSED [ 40%] tests/test_formparsers.py::test_missing_name_parameter_on_content_disposition[asyncio-app1-expectation1] PASSED [ 40%] tests/test_formparsers.py::test_missing_name_parameter_on_content_disposition[trio-app-expectation0] PASSED [ 40%] tests/test_formparsers.py::test_missing_name_parameter_on_content_disposition[trio-app1-expectation1] PASSED [ 40%] tests/test_formparsers.py::test_too_many_fields_raise[asyncio-app-expectation0] PASSED [ 40%] tests/test_formparsers.py::test_too_many_fields_raise[asyncio-app1-expectation1] PASSED [ 40%] tests/test_formparsers.py::test_too_many_fields_raise[trio-app-expectation0] PASSED [ 40%] tests/test_formparsers.py::test_too_many_fields_raise[trio-app1-expectation1] PASSED [ 41%] tests/test_formparsers.py::test_too_many_files_raise[asyncio-app-expectation0] PASSED [ 41%] tests/test_formparsers.py::test_too_many_files_raise[asyncio-app1-expectation1] PASSED [ 41%] tests/test_formparsers.py::test_too_many_files_raise[trio-app-expectation0] PASSED [ 41%] tests/test_formparsers.py::test_too_many_files_raise[trio-app1-expectation1] PASSED [ 41%] tests/test_formparsers.py::test_too_many_files_single_field_raise[asyncio-app-expectation0] PASSED [ 41%] tests/test_formparsers.py::test_too_many_files_single_field_raise[asyncio-app1-expectation1] PASSED [ 41%] tests/test_formparsers.py::test_too_many_files_single_field_raise[trio-app-expectation0] PASSED [ 41%] tests/test_formparsers.py::test_too_many_files_single_field_raise[trio-app1-expectation1] PASSED [ 41%] tests/test_formparsers.py::test_too_many_files_and_fields_raise[asyncio-app-expectation0] PASSED [ 42%] tests/test_formparsers.py::test_too_many_files_and_fields_raise[asyncio-app1-expectation1] PASSED [ 42%] tests/test_formparsers.py::test_too_many_files_and_fields_raise[trio-app-expectation0] PASSED [ 42%] tests/test_formparsers.py::test_too_many_files_and_fields_raise[trio-app1-expectation1] PASSED [ 42%] tests/test_formparsers.py::test_max_fields_is_customizable_low_raises[asyncio-app-expectation0] PASSED [ 42%] tests/test_formparsers.py::test_max_fields_is_customizable_low_raises[asyncio-app1-expectation1] PASSED [ 42%] tests/test_formparsers.py::test_max_fields_is_customizable_low_raises[trio-app-expectation0] PASSED [ 42%] tests/test_formparsers.py::test_max_fields_is_customizable_low_raises[trio-app1-expectation1] PASSED [ 42%] tests/test_formparsers.py::test_max_files_is_customizable_low_raises[asyncio-app-expectation0] PASSED [ 43%] tests/test_formparsers.py::test_max_files_is_customizable_low_raises[asyncio-app1-expectation1] PASSED [ 43%] tests/test_formparsers.py::test_max_files_is_customizable_low_raises[trio-app-expectation0] PASSED [ 43%] tests/test_formparsers.py::test_max_files_is_customizable_low_raises[trio-app1-expectation1] PASSED [ 43%] tests/test_formparsers.py::test_max_fields_is_customizable_high[asyncio] PASSED [ 43%] tests/test_formparsers.py::test_max_fields_is_customizable_high[trio] PASSED [ 43%] tests/test_formparsers.py::test_max_part_size_exceeds_limit[asyncio-app-expectation0] PASSED [ 43%] tests/test_formparsers.py::test_max_part_size_exceeds_limit[asyncio-app1-expectation1] PASSED [ 43%] tests/test_formparsers.py::test_max_part_size_exceeds_limit[trio-app-expectation0] PASSED [ 43%] tests/test_formparsers.py::test_max_part_size_exceeds_limit[trio-app1-expectation1] PASSED [ 44%] tests/test_formparsers.py::test_max_part_size_exceeds_custom_limit[asyncio-app-expectation0] PASSED [ 44%] tests/test_formparsers.py::test_max_part_size_exceeds_custom_limit[asyncio-app1-expectation1] PASSED [ 44%] tests/test_formparsers.py::test_max_part_size_exceeds_custom_limit[trio-app-expectation0] PASSED [ 44%] tests/test_formparsers.py::test_max_part_size_exceeds_custom_limit[trio-app1-expectation1] PASSED [ 44%] tests/test_requests.py::test_request_url[asyncio] PASSED [ 44%] tests/test_requests.py::test_request_url[trio] PASSED [ 44%] tests/test_requests.py::test_request_query_params[asyncio] PASSED [ 44%] tests/test_requests.py::test_request_query_params[trio] PASSED [ 44%] tests/test_requests.py::test_request_headers[asyncio] PASSED [ 45%] tests/test_requests.py::test_request_headers[trio] PASSED [ 45%] tests/test_requests.py::test_request_client[scope0-expected_client0] PASSED [ 45%] tests/test_requests.py::test_request_client[scope1-None] PASSED [ 45%] tests/test_requests.py::test_request_client[scope2-None] PASSED [ 45%] tests/test_requests.py::test_request_body[asyncio] PASSED [ 45%] tests/test_requests.py::test_request_body[trio] PASSED [ 45%] tests/test_requests.py::test_request_stream[asyncio] PASSED [ 45%] tests/test_requests.py::test_request_stream[trio] PASSED [ 45%] tests/test_requests.py::test_request_form_urlencoded[asyncio] PASSED [ 46%] tests/test_requests.py::test_request_form_urlencoded[trio] PASSED [ 46%] tests/test_requests.py::test_request_form_context_manager[asyncio] PASSED [ 46%] tests/test_requests.py::test_request_form_context_manager[trio] PASSED [ 46%] tests/test_requests.py::test_request_body_then_stream[asyncio] PASSED [ 46%] tests/test_requests.py::test_request_body_then_stream[trio] PASSED [ 46%] tests/test_requests.py::test_request_stream_then_body[asyncio] PASSED [ 46%] tests/test_requests.py::test_request_stream_then_body[trio] PASSED [ 46%] tests/test_requests.py::test_request_json[asyncio] PASSED [ 46%] tests/test_requests.py::test_request_json[trio] PASSED [ 47%] tests/test_requests.py::test_request_scope_interface PASSED [ 47%] tests/test_requests.py::test_request_raw_path[asyncio] PASSED [ 47%] tests/test_requests.py::test_request_raw_path[trio] PASSED [ 47%] tests/test_requests.py::test_request_without_setting_receive[asyncio] PASSED [ 47%] tests/test_requests.py::test_request_without_setting_receive[trio] PASSED [ 47%] tests/test_requests.py::test_request_disconnect[asyncio] PASSED [ 47%] tests/test_requests.py::test_request_disconnect[trio] PASSED [ 47%] tests/test_requests.py::test_request_is_disconnected[asyncio] PASSED [ 47%] tests/test_requests.py::test_request_is_disconnected[trio] PASSED [ 48%] tests/test_requests.py::test_request_state_object PASSED [ 48%] tests/test_requests.py::test_request_state[asyncio] PASSED [ 48%] tests/test_requests.py::test_request_state[trio] PASSED [ 48%] tests/test_requests.py::test_request_cookies[asyncio] PASSED [ 48%] tests/test_requests.py::test_request_cookies[trio] PASSED [ 48%] tests/test_requests.py::test_cookie_lenient_parsing[asyncio] PASSED [ 48%] tests/test_requests.py::test_cookie_lenient_parsing[trio] PASSED [ 48%] tests/test_requests.py::test_cookies_edge_cases[asyncio-chips=ahoy; vienna=finger-expected0] PASSED [ 48%] tests/test_requests.py::test_cookies_edge_cases[asyncio-keebler="E=mc2; L=\\"Loves\\"; fudge=\\012;"-expected1] PASSED [ 49%] tests/test_requests.py::test_cookies_edge_cases[asyncio-keebler=E=mc2-expected2] PASSED [ 49%] tests/test_requests.py::test_cookies_edge_cases[asyncio-key:term=value:term-expected3] PASSED [ 49%] tests/test_requests.py::test_cookies_edge_cases[asyncio-a=b; c=[; d=r; f=h-expected4] PASSED [ 49%] tests/test_requests.py::test_cookies_edge_cases[asyncio-a=b; Domain=example.com-expected5] PASSED [ 49%] tests/test_requests.py::test_cookies_edge_cases[asyncio-a=b; h=i; a=c-expected6] PASSED [ 49%] tests/test_requests.py::test_cookies_edge_cases[trio-chips=ahoy; vienna=finger-expected0] PASSED [ 49%] tests/test_requests.py::test_cookies_edge_cases[trio-keebler="E=mc2; L=\\"Loves\\"; fudge=\\012;"-expected1] PASSED [ 49%] tests/test_requests.py::test_cookies_edge_cases[trio-keebler=E=mc2-expected2] PASSED [ 50%] tests/test_requests.py::test_cookies_edge_cases[trio-key:term=value:term-expected3] PASSED [ 50%] tests/test_requests.py::test_cookies_edge_cases[trio-a=b; c=[; d=r; f=h-expected4] PASSED [ 50%] tests/test_requests.py::test_cookies_edge_cases[trio-a=b; Domain=example.com-expected5] PASSED [ 50%] tests/test_requests.py::test_cookies_edge_cases[trio-a=b; h=i; a=c-expected6] PASSED [ 50%] tests/test_requests.py::test_cookies_invalid[asyncio-abc=def; unnamed; django_language=en-expected0] PASSED [ 50%] tests/test_requests.py::test_cookies_invalid[asyncio-a=b; "; c=d-expected1] PASSED [ 50%] tests/test_requests.py::test_cookies_invalid[asyncio-a b c=d e = f; gh=i-expected2] PASSED [ 50%] tests/test_requests.py::test_cookies_invalid[asyncio-a b,c<>@:/[]?{}=d " =e,f g-expected3] PASSED [ 50%] tests/test_requests.py::test_cookies_invalid[asyncio- = b ; ; = ; c = ; -expected4] PASSED [ 51%] tests/test_requests.py::test_cookies_invalid[trio-abc=def; unnamed; django_language=en-expected0] PASSED [ 51%] tests/test_requests.py::test_cookies_invalid[trio-a=b; "; c=d-expected1] PASSED [ 51%] tests/test_requests.py::test_cookies_invalid[trio-a b c=d e = f; gh=i-expected2] PASSED [ 51%] tests/test_requests.py::test_cookies_invalid[trio-a b,c<>@:/[]?{}=d " =e,f g-expected3] PASSED [ 51%] tests/test_requests.py::test_cookies_invalid[trio- = b ; ; = ; c = ; -expected4] PASSED [ 51%] tests/test_requests.py::test_chunked_encoding[asyncio] PASSED [ 51%] tests/test_requests.py::test_chunked_encoding[trio] PASSED [ 51%] tests/test_requests.py::test_request_send_push_promise[asyncio] PASSED [ 51%] tests/test_requests.py::test_request_send_push_promise[trio] PASSED [ 52%] tests/test_requests.py::test_request_send_push_promise_without_push_extension[asyncio] PASSED [ 52%] tests/test_requests.py::test_request_send_push_promise_without_push_extension[trio] PASSED [ 52%] tests/test_requests.py::test_request_send_push_promise_without_setting_send[asyncio] PASSED [ 52%] tests/test_requests.py::test_request_send_push_promise_without_setting_send[trio] PASSED [ 52%] tests/test_requests.py::test_request_rcv[asyncio-messages0] PASSED [ 52%] tests/test_requests.py::test_request_rcv[asyncio-messages1] PASSED [ 52%] tests/test_requests.py::test_request_rcv[asyncio-messages2] PASSED [ 52%] tests/test_requests.py::test_request_rcv[asyncio-messages3] PASSED [ 52%] tests/test_requests.py::test_request_rcv[trio-messages0] PASSED [ 53%] tests/test_requests.py::test_request_rcv[trio-messages1] PASSED [ 53%] tests/test_requests.py::test_request_rcv[trio-messages2] PASSED [ 53%] tests/test_requests.py::test_request_rcv[trio-messages3] PASSED [ 53%] tests/test_requests.py::test_request_stream_called_twice[asyncio] PASSED [ 53%] tests/test_requests.py::test_request_stream_called_twice[trio] PASSED [ 53%] tests/test_requests.py::test_request_url_outside_starlette_context[asyncio] PASSED [ 53%] tests/test_requests.py::test_request_url_outside_starlette_context[trio] PASSED [ 53%] tests/test_requests.py::test_request_url_starlette_context[asyncio] PASSED [ 53%] tests/test_requests.py::test_request_url_starlette_context[trio] PASSED [ 54%] tests/test_responses.py::test_text_response[asyncio] PASSED [ 54%] tests/test_responses.py::test_text_response[trio] PASSED [ 54%] tests/test_responses.py::test_bytes_response[asyncio] PASSED [ 54%] tests/test_responses.py::test_bytes_response[trio] PASSED [ 54%] tests/test_responses.py::test_json_none_response[asyncio] PASSED [ 54%] tests/test_responses.py::test_json_none_response[trio] PASSED [ 54%] tests/test_responses.py::test_redirect_response[asyncio] PASSED [ 54%] tests/test_responses.py::test_redirect_response[trio] PASSED [ 54%] tests/test_responses.py::test_quoting_redirect_response[asyncio] PASSED [ 55%] tests/test_responses.py::test_quoting_redirect_response[trio] PASSED [ 55%] tests/test_responses.py::test_redirect_response_content_length_header[asyncio] PASSED [ 55%] tests/test_responses.py::test_redirect_response_content_length_header[trio] PASSED [ 55%] tests/test_responses.py::test_streaming_response[asyncio] PASSED [ 55%] tests/test_responses.py::test_streaming_response[trio] PASSED [ 55%] tests/test_responses.py::test_streaming_response_custom_iterator[asyncio] PASSED [ 55%] tests/test_responses.py::test_streaming_response_custom_iterator[trio] PASSED [ 55%] tests/test_responses.py::test_streaming_response_custom_iterable[asyncio] PASSED [ 55%] tests/test_responses.py::test_streaming_response_custom_iterable[trio] PASSED [ 56%] tests/test_responses.py::test_sync_streaming_response[asyncio] PASSED [ 56%] tests/test_responses.py::test_sync_streaming_response[trio] PASSED [ 56%] tests/test_responses.py::test_response_headers[asyncio] PASSED [ 56%] tests/test_responses.py::test_response_headers[trio] PASSED [ 56%] tests/test_responses.py::test_response_phrase[asyncio] PASSED [ 56%] tests/test_responses.py::test_response_phrase[trio] PASSED [ 56%] tests/test_responses.py::test_file_response[asyncio] PASSED [ 56%] tests/test_responses.py::test_file_response[trio] PASSED [ 56%] tests/test_responses.py::test_file_response_on_head_method[asyncio] PASSED [ 57%] tests/test_responses.py::test_file_response_on_head_method[trio] PASSED [ 57%] tests/test_responses.py::test_file_response_set_media_type[asyncio] PASSED [ 57%] tests/test_responses.py::test_file_response_set_media_type[trio] PASSED [ 57%] tests/test_responses.py::test_file_response_with_directory_raises_error[asyncio] PASSED [ 57%] tests/test_responses.py::test_file_response_with_directory_raises_error[trio] PASSED [ 57%] tests/test_responses.py::test_file_response_with_missing_file_raises_error[asyncio] PASSED [ 57%] tests/test_responses.py::test_file_response_with_missing_file_raises_error[trio] PASSED [ 57%] tests/test_responses.py::test_file_response_with_chinese_filename[asyncio] PASSED [ 58%] tests/test_responses.py::test_file_response_with_chinese_filename[trio] PASSED [ 58%] tests/test_responses.py::test_file_response_with_inline_disposition[asyncio] PASSED [ 58%] tests/test_responses.py::test_file_response_with_inline_disposition[trio] PASSED [ 58%] tests/test_responses.py::test_file_response_with_method_warns PASSED [ 58%] tests/test_responses.py::test_file_response_with_range_header[asyncio] PASSED [ 58%] tests/test_responses.py::test_file_response_with_range_header[trio] PASSED [ 58%] tests/test_responses.py::test_set_cookie[asyncio] PASSED [ 58%] tests/test_responses.py::test_set_cookie[trio] PASSED [ 58%] tests/test_responses.py::test_set_cookie_path_none[asyncio] PASSED [ 59%] tests/test_responses.py::test_set_cookie_path_none[trio] PASSED [ 59%] tests/test_responses.py::test_set_cookie_samesite_none[asyncio] PASSED [ 59%] tests/test_responses.py::test_set_cookie_samesite_none[trio] PASSED [ 59%] tests/test_responses.py::test_expires_on_set_cookie[asyncio-datetime] PASSED [ 59%] tests/test_responses.py::test_expires_on_set_cookie[asyncio-str] PASSED [ 59%] tests/test_responses.py::test_expires_on_set_cookie[asyncio-int] PASSED [ 59%] tests/test_responses.py::test_expires_on_set_cookie[trio-datetime] PASSED [ 59%] tests/test_responses.py::test_expires_on_set_cookie[trio-str] PASSED [ 59%] tests/test_responses.py::test_expires_on_set_cookie[trio-int] PASSED [ 60%] tests/test_responses.py::test_delete_cookie[asyncio] PASSED [ 60%] tests/test_responses.py::test_delete_cookie[trio] PASSED [ 60%] tests/test_responses.py::test_populate_headers[asyncio] PASSED [ 60%] tests/test_responses.py::test_populate_headers[trio] PASSED [ 60%] tests/test_responses.py::test_head_method[asyncio] PASSED [ 60%] tests/test_responses.py::test_head_method[trio] PASSED [ 60%] tests/test_responses.py::test_empty_response[asyncio] PASSED [ 60%] tests/test_responses.py::test_empty_response[trio] PASSED [ 60%] tests/test_responses.py::test_empty_204_response[asyncio] PASSED [ 61%] tests/test_responses.py::test_empty_204_response[trio] PASSED [ 61%] tests/test_responses.py::test_non_empty_response[asyncio] PASSED [ 61%] tests/test_responses.py::test_non_empty_response[trio] PASSED [ 61%] tests/test_responses.py::test_response_do_not_add_redundant_charset[asyncio] PASSED [ 61%] tests/test_responses.py::test_response_do_not_add_redundant_charset[trio] PASSED [ 61%] tests/test_responses.py::test_file_response_known_size[asyncio] PASSED [ 61%] tests/test_responses.py::test_file_response_known_size[trio] PASSED [ 61%] tests/test_responses.py::test_streaming_response_unknown_size[asyncio] PASSED [ 61%] tests/test_responses.py::test_streaming_response_unknown_size[trio] PASSED [ 62%] tests/test_responses.py::test_streaming_response_known_size[asyncio] PASSED [ 62%] tests/test_responses.py::test_streaming_response_known_size[trio] PASSED [ 62%] tests/test_responses.py::test_response_memoryview[asyncio] PASSED [ 62%] tests/test_responses.py::test_response_memoryview[trio] PASSED [ 62%] tests/test_responses.py::test_streaming_response_memoryview[asyncio] PASSED [ 62%] tests/test_responses.py::test_streaming_response_memoryview[trio] PASSED [ 62%] tests/test_responses.py::test_streaming_response_stops_if_receiving_http_disconnect[asyncio] PASSED [ 62%] tests/test_responses.py::test_streaming_response_stops_if_receiving_http_disconnect[trio] PASSED [ 62%] tests/test_responses.py::test_streaming_response_on_client_disconnects[asyncio] PASSED [ 63%] tests/test_responses.py::test_streaming_response_on_client_disconnects[trio] PASSED [ 63%] tests/test_responses.py::test_file_response_without_range[asyncio] PASSED [ 63%] tests/test_responses.py::test_file_response_without_range[trio] PASSED [ 63%] tests/test_responses.py::test_file_response_head[asyncio] PASSED [ 63%] tests/test_responses.py::test_file_response_head[trio] PASSED [ 63%] tests/test_responses.py::test_file_response_range[asyncio] PASSED [ 63%] tests/test_responses.py::test_file_response_range[trio] PASSED [ 63%] tests/test_responses.py::test_file_response_range_head[asyncio] PASSED [ 63%] tests/test_responses.py::test_file_response_range_head[trio] PASSED [ 64%] tests/test_responses.py::test_file_response_range_multi[asyncio] PASSED [ 64%] tests/test_responses.py::test_file_response_range_multi[trio] PASSED [ 64%] tests/test_responses.py::test_file_response_range_multi_head[asyncio] PASSED [ 64%] tests/test_responses.py::test_file_response_range_multi_head[trio] PASSED [ 64%] tests/test_responses.py::test_file_response_range_invalid[asyncio] PASSED [ 64%] tests/test_responses.py::test_file_response_range_invalid[trio] PASSED [ 64%] tests/test_responses.py::test_file_response_range_head_max[asyncio] PASSED [ 64%] tests/test_responses.py::test_file_response_range_head_max[trio] PASSED [ 65%] tests/test_responses.py::test_file_response_range_416[asyncio] PASSED [ 65%] tests/test_responses.py::test_file_response_range_416[trio] PASSED [ 65%] tests/test_responses.py::test_file_response_only_support_bytes_range[asyncio] PASSED [ 65%] tests/test_responses.py::test_file_response_only_support_bytes_range[trio] PASSED [ 65%] tests/test_responses.py::test_file_response_range_must_be_requested[asyncio] PASSED [ 65%] tests/test_responses.py::test_file_response_range_must_be_requested[trio] PASSED [ 65%] tests/test_responses.py::test_file_response_start_must_be_less_than_end[asyncio] PASSED [ 65%] tests/test_responses.py::test_file_response_start_must_be_less_than_end[trio] PASSED [ 65%] tests/test_responses.py::test_file_response_merge_ranges[asyncio] PASSED [ 66%] tests/test_responses.py::test_file_response_merge_ranges[trio] PASSED [ 66%] tests/test_responses.py::test_file_response_insert_ranges[asyncio] PASSED [ 66%] tests/test_responses.py::test_file_response_insert_ranges[trio] PASSED [ 66%] tests/test_responses.py::test_file_response_multi_small_chunk_size[asyncio] PASSED [ 66%] tests/test_responses.py::test_file_response_multi_small_chunk_size[trio] PASSED [ 66%] tests/test_routing.py::test_router[asyncio] ERROR [ 66%] tests/test_routing.py::test_router[trio] ERROR [ 66%] tests/test_routing.py::test_route_converters[asyncio] ERROR [ 66%] tests/test_routing.py::test_route_converters[trio] ERROR [ 67%] tests/test_routing.py::test_url_path_for PASSED [ 67%] tests/test_routing.py::test_url_for PASSED [ 67%] tests/test_routing.py::test_router_add_route[asyncio] ERROR [ 67%] tests/test_routing.py::test_router_add_route[trio] ERROR [ 67%] tests/test_routing.py::test_router_duplicate_path[asyncio] ERROR [ 67%] tests/test_routing.py::test_router_duplicate_path[trio] ERROR [ 67%] tests/test_routing.py::test_router_add_websocket_route[asyncio] ERROR [ 67%] tests/test_routing.py::test_router_add_websocket_route[trio] ERROR [ 67%] tests/test_routing.py::test_router_middleware[asyncio] PASSED [ 68%] tests/test_routing.py::test_router_middleware[trio] PASSED [ 68%] tests/test_routing.py::test_protocol_switch[asyncio] FAILED [ 68%] tests/test_routing.py::test_protocol_switch[trio] FAILED [ 68%] tests/test_routing.py::test_mount_urls[asyncio] PASSED [ 68%] tests/test_routing.py::test_mount_urls[trio] PASSED [ 68%] tests/test_routing.py::test_reverse_mount_urls PASSED [ 68%] tests/test_routing.py::test_mount_at_root[asyncio] PASSED [ 68%] tests/test_routing.py::test_mount_at_root[trio] PASSED [ 68%] tests/test_routing.py::test_host_routing[asyncio] PASSED [ 69%] tests/test_routing.py::test_host_routing[trio] PASSED [ 69%] tests/test_routing.py::test_host_reverse_urls PASSED [ 69%] tests/test_routing.py::test_subdomain_routing[asyncio] PASSED [ 69%] tests/test_routing.py::test_subdomain_routing[trio] PASSED [ 69%] tests/test_routing.py::test_subdomain_reverse_urls PASSED [ 69%] tests/test_routing.py::test_url_for_with_root_path[asyncio] PASSED [ 69%] tests/test_routing.py::test_url_for_with_root_path[trio] PASSED [ 69%] tests/test_routing.py::test_url_for_with_double_mount PASSED [ 69%] tests/test_routing.py::test_url_for_with_root_path_ending_with_slash[asyncio] PASSED [ 70%] tests/test_routing.py::test_url_for_with_root_path_ending_with_slash[trio] PASSED [ 70%] tests/test_routing.py::test_standalone_route_matches[asyncio] PASSED [ 70%] tests/test_routing.py::test_standalone_route_matches[trio] PASSED [ 70%] tests/test_routing.py::test_standalone_route_does_not_match[asyncio] PASSED [ 70%] tests/test_routing.py::test_standalone_route_does_not_match[trio] PASSED [ 70%] tests/test_routing.py::test_standalone_ws_route_matches[asyncio] FAILED [ 70%] tests/test_routing.py::test_standalone_ws_route_matches[trio] FAILED [ 70%] tests/test_routing.py::test_standalone_ws_route_does_not_match[asyncio] FAILED [ 70%] tests/test_routing.py::test_standalone_ws_route_does_not_match[trio] FAILED [ 71%] tests/test_routing.py::test_lifespan_async[asyncio] FAILED [ 71%] tests/test_routing.py::test_lifespan_async[trio] FAILED [ 71%] tests/test_routing.py::test_lifespan_sync[asyncio] FAILED [ 71%] tests/test_routing.py::test_lifespan_sync[trio] FAILED [ 71%] tests/test_routing.py::test_lifespan_state_unsupported[asyncio] FAILED [ 71%] tests/test_routing.py::test_lifespan_state_unsupported[trio] FAILED [ 71%] tests/test_routing.py::test_lifespan_state_async_cm[asyncio] FAILED [ 71%] tests/test_routing.py::test_lifespan_state_async_cm[trio] FAILED [ 72%] tests/test_routing.py::test_raise_on_startup[asyncio] FAILED [ 72%] tests/test_routing.py::test_raise_on_startup[trio] FAILED [ 72%] tests/test_routing.py::test_raise_on_shutdown[asyncio] FAILED [ 72%] tests/test_routing.py::test_raise_on_shutdown[trio] FAILED [ 72%] tests/test_routing.py::test_partial_async_endpoint[asyncio] PASSED [ 72%] tests/test_routing.py::test_partial_async_endpoint[trio] PASSED [ 72%] tests/test_routing.py::test_partial_async_ws_endpoint[asyncio] FAILED [ 72%] tests/test_routing.py::test_partial_async_ws_endpoint[trio] FAILED [ 72%] tests/test_routing.py::test_duplicated_param_names PASSED [ 73%] tests/test_routing.py::test_route_name[function] PASSED [ 73%] tests/test_routing.py::test_route_name[method] PASSED [ 73%] tests/test_routing.py::test_route_name[classmethod] PASSED [ 73%] tests/test_routing.py::test_route_name[staticmethod] PASSED [ 73%] tests/test_routing.py::test_route_name[object] PASSED [ 73%] tests/test_routing.py::test_route_name[lambda] PASSED [ 73%] tests/test_routing.py::test_base_route_middleware[asyncio-app0] PASSED [ 73%] tests/test_routing.py::test_base_route_middleware[asyncio-app1] PASSED [ 73%] tests/test_routing.py::test_base_route_middleware[asyncio-app2] PASSED [ 74%] tests/test_routing.py::test_base_route_middleware[trio-app0] PASSED [ 74%] tests/test_routing.py::test_base_route_middleware[trio-app1] PASSED [ 74%] tests/test_routing.py::test_base_route_middleware[trio-app2] PASSED [ 74%] tests/test_routing.py::test_mount_routes_with_middleware_url_path_for PASSED [ 74%] tests/test_routing.py::test_mount_asgi_app_with_middleware_url_path_for PASSED [ 74%] tests/test_routing.py::test_add_route_to_app_after_mount[asyncio] PASSED [ 74%] tests/test_routing.py::test_add_route_to_app_after_mount[trio] PASSED [ 74%] tests/test_routing.py::test_exception_on_mounted_apps[asyncio] PASSED [ 74%] tests/test_routing.py::test_exception_on_mounted_apps[trio] PASSED [ 75%] tests/test_routing.py::test_mounted_middleware_does_not_catch_exception[asyncio] PASSED [ 75%] tests/test_routing.py::test_mounted_middleware_does_not_catch_exception[trio] PASSED [ 75%] tests/test_routing.py::test_websocket_route_middleware[asyncio] FAILED [ 75%] tests/test_routing.py::test_websocket_route_middleware[trio] FAILED [ 75%] tests/test_routing.py::test_route_repr PASSED [ 75%] tests/test_routing.py::test_route_repr_without_methods PASSED [ 75%] tests/test_routing.py::test_websocket_route_repr PASSED [ 75%] tests/test_routing.py::test_mount_repr PASSED [ 75%] tests/test_routing.py::test_mount_named_repr PASSED [ 76%] tests/test_routing.py::test_host_repr PASSED [ 76%] tests/test_routing.py::test_host_named_repr PASSED [ 76%] tests/test_routing.py::test_decorator_deprecations PASSED [ 76%] tests/test_routing.py::test_paths_with_root_path[asyncio] PASSED [ 76%] tests/test_routing.py::test_paths_with_root_path[trio] PASSED [ 76%] tests/test_schemas.py::test_schema_generation PASSED [ 76%] tests/test_schemas.py::test_schema_endpoint[asyncio] PASSED [ 76%] tests/test_schemas.py::test_schema_endpoint[trio] PASSED [ 76%] tests/test_staticfiles.py::test_staticfiles[asyncio] PASSED [ 77%] tests/test_staticfiles.py::test_staticfiles[trio] PASSED [ 77%] tests/test_staticfiles.py::test_staticfiles_with_pathlib[asyncio] PASSED [ 77%] tests/test_staticfiles.py::test_staticfiles_with_pathlib[trio] PASSED [ 77%] tests/test_staticfiles.py::test_staticfiles_head_with_middleware[asyncio] FAILED [ 77%] tests/test_staticfiles.py::test_staticfiles_head_with_middleware[trio] FAILED [ 77%] tests/test_staticfiles.py::test_staticfiles_with_package[asyncio] PASSED [ 77%] tests/test_staticfiles.py::test_staticfiles_with_package[trio] PASSED [ 77%] tests/test_staticfiles.py::test_staticfiles_post[asyncio] PASSED [ 77%] tests/test_staticfiles.py::test_staticfiles_post[trio] PASSED [ 78%] tests/test_staticfiles.py::test_staticfiles_with_directory_returns_404[asyncio] PASSED [ 78%] tests/test_staticfiles.py::test_staticfiles_with_directory_returns_404[trio] PASSED [ 78%] tests/test_staticfiles.py::test_staticfiles_with_missing_file_returns_404[asyncio] PASSED [ 78%] tests/test_staticfiles.py::test_staticfiles_with_missing_file_returns_404[trio] PASSED [ 78%] tests/test_staticfiles.py::test_staticfiles_instantiated_with_missing_directory PASSED [ 78%] tests/test_staticfiles.py::test_staticfiles_configured_with_missing_directory[asyncio] PASSED [ 78%] tests/test_staticfiles.py::test_staticfiles_configured_with_missing_directory[trio] PASSED [ 78%] tests/test_staticfiles.py::test_staticfiles_configured_with_file_instead_of_directory[asyncio] PASSED [ 79%] tests/test_staticfiles.py::test_staticfiles_configured_with_file_instead_of_directory[trio] PASSED [ 79%] tests/test_staticfiles.py::test_staticfiles_config_check_occurs_only_once[asyncio] PASSED [ 79%] tests/test_staticfiles.py::test_staticfiles_config_check_occurs_only_once[trio] PASSED [ 79%] tests/test_staticfiles.py::test_staticfiles_prevents_breaking_out_of_directory PASSED [ 79%] tests/test_staticfiles.py::test_staticfiles_never_read_file_for_head_method[asyncio] PASSED [ 79%] tests/test_staticfiles.py::test_staticfiles_never_read_file_for_head_method[trio] PASSED [ 79%] tests/test_staticfiles.py::test_staticfiles_304_with_etag_match[asyncio] PASSED [ 79%] tests/test_staticfiles.py::test_staticfiles_304_with_etag_match[trio] PASSED [ 79%] tests/test_staticfiles.py::test_staticfiles_200_with_etag_mismatch[asyncio] PASSED [ 80%] tests/test_staticfiles.py::test_staticfiles_200_with_etag_mismatch[trio] PASSED [ 80%] tests/test_staticfiles.py::test_staticfiles_304_with_last_modified_compare_last_req[asyncio] PASSED [ 80%] tests/test_staticfiles.py::test_staticfiles_304_with_last_modified_compare_last_req[trio] PASSED [ 80%] tests/test_staticfiles.py::test_staticfiles_html_normal[asyncio] PASSED [ 80%] tests/test_staticfiles.py::test_staticfiles_html_normal[trio] PASSED [ 80%] tests/test_staticfiles.py::test_staticfiles_html_without_index[asyncio] PASSED [ 80%] tests/test_staticfiles.py::test_staticfiles_html_without_index[trio] PASSED [ 80%] tests/test_staticfiles.py::test_staticfiles_html_without_404[asyncio] PASSED [ 80%] tests/test_staticfiles.py::test_staticfiles_html_without_404[trio] PASSED [ 81%] tests/test_staticfiles.py::test_staticfiles_html_only_files[asyncio] PASSED [ 81%] tests/test_staticfiles.py::test_staticfiles_html_only_files[trio] PASSED [ 81%] tests/test_staticfiles.py::test_staticfiles_cache_invalidation_for_deleted_file_html_mode[asyncio] PASSED [ 81%] tests/test_staticfiles.py::test_staticfiles_cache_invalidation_for_deleted_file_html_mode[trio] PASSED [ 81%] tests/test_staticfiles.py::test_staticfiles_with_invalid_dir_permissions_returns_401[asyncio] PASSED [ 81%] tests/test_staticfiles.py::test_staticfiles_with_invalid_dir_permissions_returns_401[trio] PASSED [ 81%] tests/test_staticfiles.py::test_staticfiles_with_missing_dir_returns_404[asyncio] PASSED [ 81%] tests/test_staticfiles.py::test_staticfiles_with_missing_dir_returns_404[trio] PASSED [ 81%] tests/test_staticfiles.py::test_staticfiles_access_file_as_dir_returns_404[asyncio] PASSED [ 82%] tests/test_staticfiles.py::test_staticfiles_access_file_as_dir_returns_404[trio] PASSED [ 82%] tests/test_staticfiles.py::test_staticfiles_filename_too_long[asyncio] PASSED [ 82%] tests/test_staticfiles.py::test_staticfiles_filename_too_long[trio] PASSED [ 82%] tests/test_staticfiles.py::test_staticfiles_unhandled_os_error_returns_500[asyncio] PASSED [ 82%] tests/test_staticfiles.py::test_staticfiles_unhandled_os_error_returns_500[trio] PASSED [ 82%] tests/test_staticfiles.py::test_staticfiles_follows_symlinks[asyncio] PASSED [ 82%] tests/test_staticfiles.py::test_staticfiles_follows_symlinks[trio] PASSED [ 82%] tests/test_staticfiles.py::test_staticfiles_follows_symlink_directories[asyncio] PASSED [ 82%] tests/test_staticfiles.py::test_staticfiles_follows_symlink_directories[trio] PASSED [ 83%] tests/test_staticfiles.py::test_staticfiles_disallows_path_traversal_with_symlinks PASSED [ 83%] tests/test_staticfiles.py::test_staticfiles_avoids_path_traversal PASSED [ 83%] tests/test_staticfiles.py::test_staticfiles_self_symlinks[asyncio] PASSED [ 83%] tests/test_staticfiles.py::test_staticfiles_self_symlinks[trio] PASSED [ 83%] tests/test_templates.py::test_templates[asyncio] PASSED [ 83%] tests/test_templates.py::test_templates[trio] PASSED [ 83%] tests/test_templates.py::test_calls_context_processors[asyncio] PASSED [ 83%] tests/test_templates.py::test_calls_context_processors[trio] PASSED [ 83%] tests/test_templates.py::test_template_with_middleware[asyncio] FAILED [ 84%] tests/test_templates.py::test_template_with_middleware[trio] FAILED [ 84%] tests/test_templates.py::test_templates_with_directories[asyncio] PASSED [ 84%] tests/test_templates.py::test_templates_with_directories[trio] PASSED [ 84%] tests/test_templates.py::test_templates_require_directory_or_environment PASSED [ 84%] tests/test_templates.py::test_templates_require_directory_or_enviroment_not_both PASSED [ 84%] tests/test_templates.py::test_templates_with_directory PASSED [ 84%] tests/test_templates.py::test_templates_with_environment[asyncio] PASSED [ 84%] tests/test_templates.py::test_templates_with_environment[trio] PASSED [ 84%] tests/test_templates.py::test_templates_with_environment_options_emit_warning PASSED [ 85%] tests/test_templates.py::test_templates_with_kwargs_only[asyncio] PASSED [ 85%] tests/test_templates.py::test_templates_with_kwargs_only[trio] PASSED [ 85%] tests/test_templates.py::test_templates_with_kwargs_only_requires_request_in_context PASSED [ 85%] tests/test_templates.py::test_templates_with_kwargs_only_warns_when_no_request_keyword[asyncio] PASSED [ 85%] tests/test_templates.py::test_templates_with_kwargs_only_warns_when_no_request_keyword[trio] PASSED [ 85%] tests/test_templates.py::test_templates_with_requires_request_in_context PASSED [ 85%] tests/test_templates.py::test_templates_warns_when_first_argument_isnot_request[asyncio] PASSED [ 85%] tests/test_templates.py::test_templates_warns_when_first_argument_isnot_request[trio] PASSED [ 86%] tests/test_templates.py::test_templates_when_first_argument_is_request[asyncio] PASSED [ 86%] tests/test_templates.py::test_templates_when_first_argument_is_request[trio] PASSED [ 86%] tests/test_testclient.py::test_use_testclient_in_endpoint[asyncio] PASSED [ 86%] tests/test_testclient.py::test_use_testclient_in_endpoint[trio] PASSED [ 86%] tests/test_testclient.py::test_testclient_headers_behavior PASSED [ 86%] tests/test_testclient.py::test_use_testclient_as_contextmanager[asyncio] FAILED [ 86%] tests/test_testclient.py::test_use_testclient_as_contextmanager[trio] FAILED [ 86%] tests/test_testclient.py::test_error_on_startup[asyncio] FAILED [ 86%] tests/test_testclient.py::test_error_on_startup[trio] FAILED [ 87%] tests/test_testclient.py::test_exception_in_middleware[asyncio] FAILED [ 87%] tests/test_testclient.py::test_exception_in_middleware[trio] FAILED [ 87%] tests/test_testclient.py::test_testclient_asgi2[asyncio] PASSED [ 87%] tests/test_testclient.py::test_testclient_asgi2[trio] PASSED [ 87%] tests/test_testclient.py::test_testclient_asgi3[asyncio] PASSED [ 87%] tests/test_testclient.py::test_testclient_asgi3[trio] PASSED [ 87%] tests/test_testclient.py::test_websocket_blocking_receive[asyncio] FAILED [ 87%] tests/test_testclient.py::test_websocket_blocking_receive[trio] FAILED [ 87%] tests/test_testclient.py::test_websocket_not_block_on_close[asyncio] FAILED [ 88%] tests/test_testclient.py::test_websocket_not_block_on_close[trio] FAILED [ 88%] tests/test_testclient.py::test_client[asyncio] PASSED [ 88%] tests/test_testclient.py::test_client[trio] PASSED [ 88%] tests/test_testclient.py::test_client_custom_client[asyncio] PASSED [ 88%] tests/test_testclient.py::test_client_custom_client[trio] PASSED [ 88%] tests/test_testclient.py::test_query_params[asyncio-2020-07-14T00:00:00+00:00] PASSED [ 88%] tests/test_testclient.py::test_query_params[asyncio-Espa\xf1a] PASSED [ 88%] tests/test_testclient.py::test_query_params[asyncio-voil\xe0] PASSED [ 88%] tests/test_testclient.py::test_query_params[trio-2020-07-14T00:00:00+00:00] PASSED [ 89%] tests/test_testclient.py::test_query_params[trio-Espa\xf1a] PASSED [ 89%] tests/test_testclient.py::test_query_params[trio-voil\xe0] PASSED [ 89%] tests/test_testclient.py::test_domain_restricted_cookies[asyncio-testserver-True] PASSED [ 89%] tests/test_testclient.py::test_domain_restricted_cookies[asyncio-testserver.local-True] PASSED [ 89%] tests/test_testclient.py::test_domain_restricted_cookies[asyncio-localhost-False] PASSED [ 89%] tests/test_testclient.py::test_domain_restricted_cookies[asyncio-example.com-False] PASSED [ 89%] tests/test_testclient.py::test_domain_restricted_cookies[trio-testserver-True] PASSED [ 89%] tests/test_testclient.py::test_domain_restricted_cookies[trio-testserver.local-True] PASSED [ 89%] tests/test_testclient.py::test_domain_restricted_cookies[trio-localhost-False] PASSED [ 90%] tests/test_testclient.py::test_domain_restricted_cookies[trio-example.com-False] PASSED [ 90%] tests/test_testclient.py::test_forward_follow_redirects[asyncio] PASSED [ 90%] tests/test_testclient.py::test_forward_follow_redirects[trio] PASSED [ 90%] tests/test_testclient.py::test_forward_nofollow_redirects[asyncio] PASSED [ 90%] tests/test_testclient.py::test_forward_nofollow_redirects[trio] PASSED [ 90%] tests/test_testclient.py::test_with_duplicate_headers[asyncio] PASSED [ 90%] tests/test_testclient.py::test_with_duplicate_headers[trio] PASSED [ 90%] tests/test_testclient.py::test_merge_url[asyncio] PASSED [ 90%] tests/test_testclient.py::test_merge_url[trio] PASSED [ 91%] tests/test_testclient.py::test_raw_path_with_querystring[asyncio] PASSED [ 91%] tests/test_testclient.py::test_raw_path_with_querystring[trio] PASSED [ 91%] tests/test_testclient.py::test_websocket_raw_path_without_params[asyncio] FAILED [ 91%] tests/test_testclient.py::test_websocket_raw_path_without_params[trio] FAILED [ 91%] tests/test_websockets.py::test_websocket_url[asyncio] FAILED [ 91%] tests/test_websockets.py::test_websocket_url[trio] FAILED [ 91%] tests/test_websockets.py::test_websocket_binary_json[asyncio] FAILED [ 91%] tests/test_websockets.py::test_websocket_binary_json[trio] FAILED [ 91%] tests/test_websockets.py::test_websocket_ensure_unicode_on_send_json[asyncio] FAILED [ 92%] tests/test_websockets.py::test_websocket_ensure_unicode_on_send_json[trio] FAILED [ 92%] tests/test_websockets.py::test_websocket_query_params[asyncio] FAILED [ 92%] tests/test_websockets.py::test_websocket_query_params[trio] FAILED [ 92%] tests/test_websockets.py::test_websocket_headers[asyncio] FAILED [ 92%] tests/test_websockets.py::test_websocket_headers[trio] FAILED [ 92%] tests/test_websockets.py::test_websocket_port[asyncio] FAILED [ 92%] tests/test_websockets.py::test_websocket_port[trio] FAILED [ 92%] tests/test_websockets.py::test_websocket_send_and_receive_text[asyncio] FAILED [ 93%] tests/test_websockets.py::test_websocket_send_and_receive_text[trio] FAILED [ 93%] tests/test_websockets.py::test_websocket_send_and_receive_bytes[asyncio] FAILED [ 93%] tests/test_websockets.py::test_websocket_send_and_receive_bytes[trio] FAILED [ 93%] tests/test_websockets.py::test_websocket_send_and_receive_json[asyncio] FAILED [ 93%] tests/test_websockets.py::test_websocket_send_and_receive_json[trio] FAILED [ 93%] tests/test_websockets.py::test_websocket_iter_text[asyncio] FAILED [ 93%] tests/test_websockets.py::test_websocket_iter_text[trio] FAILED [ 93%] tests/test_websockets.py::test_websocket_iter_bytes[asyncio] FAILED [ 93%] tests/test_websockets.py::test_websocket_iter_bytes[trio] FAILED [ 94%] tests/test_websockets.py::test_websocket_iter_json[asyncio] FAILED [ 94%] tests/test_websockets.py::test_websocket_iter_json[trio] FAILED [ 94%] tests/test_websockets.py::test_websocket_concurrency_pattern[asyncio] FAILED [ 94%] tests/test_websockets.py::test_websocket_concurrency_pattern[trio] FAILED [ 94%] tests/test_websockets.py::test_client_close[asyncio] FAILED [ 94%] tests/test_websockets.py::test_client_close[trio] FAILED [ 94%] tests/test_websockets.py::test_client_disconnect_on_send[asyncio] PASSED [ 94%] tests/test_websockets.py::test_client_disconnect_on_send[trio] PASSED [ 94%] tests/test_websockets.py::test_application_close[asyncio] FAILED [ 95%] tests/test_websockets.py::test_application_close[trio] FAILED [ 95%] tests/test_websockets.py::test_rejected_connection[asyncio] FAILED [ 95%] tests/test_websockets.py::test_rejected_connection[trio] FAILED [ 95%] tests/test_websockets.py::test_send_denial_response[asyncio] FAILED [ 95%] tests/test_websockets.py::test_send_denial_response[trio] FAILED [ 95%] tests/test_websockets.py::test_send_response_multi[asyncio] FAILED [ 95%] tests/test_websockets.py::test_send_response_multi[trio] FAILED [ 95%] tests/test_websockets.py::test_send_response_unsupported[asyncio] FAILED [ 95%] tests/test_websockets.py::test_send_response_unsupported[trio] FAILED [ 96%] tests/test_websockets.py::test_send_response_duplicate_start[asyncio] FAILED [ 96%] tests/test_websockets.py::test_send_response_duplicate_start[trio] FAILED [ 96%] tests/test_websockets.py::test_subprotocol[asyncio] FAILED [ 96%] tests/test_websockets.py::test_subprotocol[trio] FAILED [ 96%] tests/test_websockets.py::test_additional_headers[asyncio] FAILED [ 96%] tests/test_websockets.py::test_additional_headers[trio] FAILED [ 96%] tests/test_websockets.py::test_no_additional_headers[asyncio] FAILED [ 96%] tests/test_websockets.py::test_no_additional_headers[trio] FAILED [ 96%] tests/test_websockets.py::test_websocket_exception[asyncio] FAILED [ 97%] tests/test_websockets.py::test_websocket_exception[trio] FAILED [ 97%] tests/test_websockets.py::test_duplicate_close[asyncio] FAILED [ 97%] tests/test_websockets.py::test_duplicate_close[trio] FAILED [ 97%] tests/test_websockets.py::test_duplicate_disconnect[asyncio] FAILED [ 97%] tests/test_websockets.py::test_duplicate_disconnect[trio] FAILED [ 97%] tests/test_websockets.py::test_websocket_scope_interface PASSED [ 97%] tests/test_websockets.py::test_websocket_close_reason[asyncio] FAILED [ 97%] tests/test_websockets.py::test_websocket_close_reason[trio] FAILED [ 97%] tests/test_websockets.py::test_send_json_invalid_mode[asyncio] FAILED [ 98%] tests/test_websockets.py::test_send_json_invalid_mode[trio] FAILED [ 98%] tests/test_websockets.py::test_receive_json_invalid_mode[asyncio] FAILED [ 98%] tests/test_websockets.py::test_receive_json_invalid_mode[trio] FAILED [ 98%] tests/test_websockets.py::test_receive_text_before_accept[asyncio] FAILED [ 98%] tests/test_websockets.py::test_receive_text_before_accept[trio] FAILED [ 98%] tests/test_websockets.py::test_receive_bytes_before_accept[asyncio] FAILED [ 98%] tests/test_websockets.py::test_receive_bytes_before_accept[trio] FAILED [ 98%] tests/test_websockets.py::test_receive_json_before_accept[asyncio] FAILED [ 98%] tests/test_websockets.py::test_receive_json_before_accept[trio] FAILED [ 99%] tests/test_websockets.py::test_send_before_accept[asyncio] FAILED [ 99%] tests/test_websockets.py::test_send_before_accept[trio] FAILED [ 99%] tests/test_websockets.py::test_send_wrong_message_type[asyncio] FAILED [ 99%] tests/test_websockets.py::test_send_wrong_message_type[trio] FAILED [ 99%] tests/test_websockets.py::test_receive_before_accept[asyncio] FAILED [ 99%] tests/test_websockets.py::test_receive_before_accept[trio] FAILED [ 99%] tests/test_websockets.py::test_receive_wrong_message_type[asyncio] FAILED [ 99%] tests/test_websockets.py::test_receive_wrong_message_type[trio] FAILED [100%] ==================================== ERRORS ==================================== __________________ ERROR at setup of test_func_route[asyncio] __________________ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) @pytest.fixture def client(test_client_factory: TestClientFactory) -> Generator[TestClient, None, None]: > with test_client_factory(app) as client: tests/test_applications.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __enter__(self) -> TestClient: with contextlib.ExitStack() as stack: self.portal = portal = stack.enter_context(anyio.from_thread.start_blocking_portal(**self.async_backend)) @stack.callback def reset_portal() -> None: self.portal = None > send1, receive1 = anyio.create_memory_object_stream[ typing.Union[typing.MutableMapping[str, typing.Any], None] ](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:660: TypeError ___________________ ERROR at setup of test_func_route[trio] ____________________ test_client_factory = functools.partial(, backend='trio', backend_options={}) @pytest.fixture def client(test_client_factory: TestClientFactory) -> Generator[TestClient, None, None]: > with test_client_factory(app) as client: tests/test_applications.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __enter__(self) -> TestClient: with contextlib.ExitStack() as stack: self.portal = portal = stack.enter_context(anyio.from_thread.start_blocking_portal(**self.async_backend)) @stack.callback def reset_portal() -> None: self.portal = None > send1, receive1 = anyio.create_memory_object_stream[ typing.Union[typing.MutableMapping[str, typing.Any], None] ](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:660: TypeError _________________ ERROR at setup of test_async_route[asyncio] __________________ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) @pytest.fixture def client(test_client_factory: TestClientFactory) -> Generator[TestClient, None, None]: > with test_client_factory(app) as client: tests/test_applications.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __enter__(self) -> TestClient: with contextlib.ExitStack() as stack: self.portal = portal = stack.enter_context(anyio.from_thread.start_blocking_portal(**self.async_backend)) @stack.callback def reset_portal() -> None: self.portal = None > send1, receive1 = anyio.create_memory_object_stream[ typing.Union[typing.MutableMapping[str, typing.Any], None] ](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:660: TypeError ___________________ ERROR at setup of test_async_route[trio] ___________________ test_client_factory = functools.partial(, backend='trio', backend_options={}) @pytest.fixture def client(test_client_factory: TestClientFactory) -> Generator[TestClient, None, None]: > with test_client_factory(app) as client: tests/test_applications.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __enter__(self) -> TestClient: with contextlib.ExitStack() as stack: self.portal = portal = stack.enter_context(anyio.from_thread.start_blocking_portal(**self.async_backend)) @stack.callback def reset_portal() -> None: self.portal = None > send1, receive1 = anyio.create_memory_object_stream[ typing.Union[typing.MutableMapping[str, typing.Any], None] ](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:660: TypeError _________________ ERROR at setup of test_class_route[asyncio] __________________ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) @pytest.fixture def client(test_client_factory: TestClientFactory) -> Generator[TestClient, None, None]: > with test_client_factory(app) as client: tests/test_applications.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __enter__(self) -> TestClient: with contextlib.ExitStack() as stack: self.portal = portal = stack.enter_context(anyio.from_thread.start_blocking_portal(**self.async_backend)) @stack.callback def reset_portal() -> None: self.portal = None > send1, receive1 = anyio.create_memory_object_stream[ typing.Union[typing.MutableMapping[str, typing.Any], None] ](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:660: TypeError ___________________ ERROR at setup of test_class_route[trio] ___________________ test_client_factory = functools.partial(, backend='trio', backend_options={}) @pytest.fixture def client(test_client_factory: TestClientFactory) -> Generator[TestClient, None, None]: > with test_client_factory(app) as client: tests/test_applications.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __enter__(self) -> TestClient: with contextlib.ExitStack() as stack: self.portal = portal = stack.enter_context(anyio.from_thread.start_blocking_portal(**self.async_backend)) @stack.callback def reset_portal() -> None: self.portal = None > send1, receive1 = anyio.create_memory_object_stream[ typing.Union[typing.MutableMapping[str, typing.Any], None] ](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:660: TypeError ________________ ERROR at setup of test_mounted_route[asyncio] _________________ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) @pytest.fixture def client(test_client_factory: TestClientFactory) -> Generator[TestClient, None, None]: > with test_client_factory(app) as client: tests/test_applications.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __enter__(self) -> TestClient: with contextlib.ExitStack() as stack: self.portal = portal = stack.enter_context(anyio.from_thread.start_blocking_portal(**self.async_backend)) @stack.callback def reset_portal() -> None: self.portal = None > send1, receive1 = anyio.create_memory_object_stream[ typing.Union[typing.MutableMapping[str, typing.Any], None] ](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:660: TypeError __________________ ERROR at setup of test_mounted_route[trio] __________________ test_client_factory = functools.partial(, backend='trio', backend_options={}) @pytest.fixture def client(test_client_factory: TestClientFactory) -> Generator[TestClient, None, None]: > with test_client_factory(app) as client: tests/test_applications.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __enter__(self) -> TestClient: with contextlib.ExitStack() as stack: self.portal = portal = stack.enter_context(anyio.from_thread.start_blocking_portal(**self.async_backend)) @stack.callback def reset_portal() -> None: self.portal = None > send1, receive1 = anyio.create_memory_object_stream[ typing.Union[typing.MutableMapping[str, typing.Any], None] ](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:660: TypeError __________ ERROR at setup of test_mounted_route_path_params[asyncio] ___________ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) @pytest.fixture def client(test_client_factory: TestClientFactory) -> Generator[TestClient, None, None]: > with test_client_factory(app) as client: tests/test_applications.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __enter__(self) -> TestClient: with contextlib.ExitStack() as stack: self.portal = portal = stack.enter_context(anyio.from_thread.start_blocking_portal(**self.async_backend)) @stack.callback def reset_portal() -> None: self.portal = None > send1, receive1 = anyio.create_memory_object_stream[ typing.Union[typing.MutableMapping[str, typing.Any], None] ](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:660: TypeError ____________ ERROR at setup of test_mounted_route_path_params[trio] ____________ test_client_factory = functools.partial(, backend='trio', backend_options={}) @pytest.fixture def client(test_client_factory: TestClientFactory) -> Generator[TestClient, None, None]: > with test_client_factory(app) as client: tests/test_applications.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __enter__(self) -> TestClient: with contextlib.ExitStack() as stack: self.portal = portal = stack.enter_context(anyio.from_thread.start_blocking_portal(**self.async_backend)) @stack.callback def reset_portal() -> None: self.portal = None > send1, receive1 = anyio.create_memory_object_stream[ typing.Union[typing.MutableMapping[str, typing.Any], None] ](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:660: TypeError _______________ ERROR at setup of test_websocket_route[asyncio] ________________ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) @pytest.fixture def client(test_client_factory: TestClientFactory) -> Generator[TestClient, None, None]: > with test_client_factory(app) as client: tests/test_applications.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __enter__(self) -> TestClient: with contextlib.ExitStack() as stack: self.portal = portal = stack.enter_context(anyio.from_thread.start_blocking_portal(**self.async_backend)) @stack.callback def reset_portal() -> None: self.portal = None > send1, receive1 = anyio.create_memory_object_stream[ typing.Union[typing.MutableMapping[str, typing.Any], None] ](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:660: TypeError _________________ ERROR at setup of test_websocket_route[trio] _________________ test_client_factory = functools.partial(, backend='trio', backend_options={}) @pytest.fixture def client(test_client_factory: TestClientFactory) -> Generator[TestClient, None, None]: > with test_client_factory(app) as client: tests/test_applications.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __enter__(self) -> TestClient: with contextlib.ExitStack() as stack: self.portal = portal = stack.enter_context(anyio.from_thread.start_blocking_portal(**self.async_backend)) @stack.callback def reset_portal() -> None: self.portal = None > send1, receive1 = anyio.create_memory_object_stream[ typing.Union[typing.MutableMapping[str, typing.Any], None] ](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:660: TypeError _____________________ ERROR at setup of test_400[asyncio] ______________________ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) @pytest.fixture def client(test_client_factory: TestClientFactory) -> Generator[TestClient, None, None]: > with test_client_factory(app) as client: tests/test_applications.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __enter__(self) -> TestClient: with contextlib.ExitStack() as stack: self.portal = portal = stack.enter_context(anyio.from_thread.start_blocking_portal(**self.async_backend)) @stack.callback def reset_portal() -> None: self.portal = None > send1, receive1 = anyio.create_memory_object_stream[ typing.Union[typing.MutableMapping[str, typing.Any], None] ](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:660: TypeError _______________________ ERROR at setup of test_400[trio] _______________________ test_client_factory = functools.partial(, backend='trio', backend_options={}) @pytest.fixture def client(test_client_factory: TestClientFactory) -> Generator[TestClient, None, None]: > with test_client_factory(app) as client: tests/test_applications.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __enter__(self) -> TestClient: with contextlib.ExitStack() as stack: self.portal = portal = stack.enter_context(anyio.from_thread.start_blocking_portal(**self.async_backend)) @stack.callback def reset_portal() -> None: self.portal = None > send1, receive1 = anyio.create_memory_object_stream[ typing.Union[typing.MutableMapping[str, typing.Any], None] ](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:660: TypeError _____________________ ERROR at setup of test_405[asyncio] ______________________ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) @pytest.fixture def client(test_client_factory: TestClientFactory) -> Generator[TestClient, None, None]: > with test_client_factory(app) as client: tests/test_applications.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __enter__(self) -> TestClient: with contextlib.ExitStack() as stack: self.portal = portal = stack.enter_context(anyio.from_thread.start_blocking_portal(**self.async_backend)) @stack.callback def reset_portal() -> None: self.portal = None > send1, receive1 = anyio.create_memory_object_stream[ typing.Union[typing.MutableMapping[str, typing.Any], None] ](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:660: TypeError _______________________ ERROR at setup of test_405[trio] _______________________ test_client_factory = functools.partial(, backend='trio', backend_options={}) @pytest.fixture def client(test_client_factory: TestClientFactory) -> Generator[TestClient, None, None]: > with test_client_factory(app) as client: tests/test_applications.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __enter__(self) -> TestClient: with contextlib.ExitStack() as stack: self.portal = portal = stack.enter_context(anyio.from_thread.start_blocking_portal(**self.async_backend)) @stack.callback def reset_portal() -> None: self.portal = None > send1, receive1 = anyio.create_memory_object_stream[ typing.Union[typing.MutableMapping[str, typing.Any], None] ](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:660: TypeError _____ ERROR at setup of test_websocket_raise_websocket_exception[asyncio] ______ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) @pytest.fixture def client(test_client_factory: TestClientFactory) -> Generator[TestClient, None, None]: > with test_client_factory(app) as client: tests/test_applications.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __enter__(self) -> TestClient: with contextlib.ExitStack() as stack: self.portal = portal = stack.enter_context(anyio.from_thread.start_blocking_portal(**self.async_backend)) @stack.callback def reset_portal() -> None: self.portal = None > send1, receive1 = anyio.create_memory_object_stream[ typing.Union[typing.MutableMapping[str, typing.Any], None] ](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:660: TypeError _______ ERROR at setup of test_websocket_raise_websocket_exception[trio] _______ test_client_factory = functools.partial(, backend='trio', backend_options={}) @pytest.fixture def client(test_client_factory: TestClientFactory) -> Generator[TestClient, None, None]: > with test_client_factory(app) as client: tests/test_applications.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __enter__(self) -> TestClient: with contextlib.ExitStack() as stack: self.portal = portal = stack.enter_context(anyio.from_thread.start_blocking_portal(**self.async_backend)) @stack.callback def reset_portal() -> None: self.portal = None > send1, receive1 = anyio.create_memory_object_stream[ typing.Union[typing.MutableMapping[str, typing.Any], None] ](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:660: TypeError ________ ERROR at setup of test_websocket_raise_http_exception[asyncio] ________ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) @pytest.fixture def client(test_client_factory: TestClientFactory) -> Generator[TestClient, None, None]: > with test_client_factory(app) as client: tests/test_applications.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __enter__(self) -> TestClient: with contextlib.ExitStack() as stack: self.portal = portal = stack.enter_context(anyio.from_thread.start_blocking_portal(**self.async_backend)) @stack.callback def reset_portal() -> None: self.portal = None > send1, receive1 = anyio.create_memory_object_stream[ typing.Union[typing.MutableMapping[str, typing.Any], None] ](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:660: TypeError _________ ERROR at setup of test_websocket_raise_http_exception[trio] __________ test_client_factory = functools.partial(, backend='trio', backend_options={}) @pytest.fixture def client(test_client_factory: TestClientFactory) -> Generator[TestClient, None, None]: > with test_client_factory(app) as client: tests/test_applications.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __enter__(self) -> TestClient: with contextlib.ExitStack() as stack: self.portal = portal = stack.enter_context(anyio.from_thread.start_blocking_portal(**self.async_backend)) @stack.callback def reset_portal() -> None: self.portal = None > send1, receive1 = anyio.create_memory_object_stream[ typing.Union[typing.MutableMapping[str, typing.Any], None] ](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:660: TypeError _______ ERROR at setup of test_websocket_raise_custom_exception[asyncio] _______ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) @pytest.fixture def client(test_client_factory: TestClientFactory) -> Generator[TestClient, None, None]: > with test_client_factory(app) as client: tests/test_applications.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __enter__(self) -> TestClient: with contextlib.ExitStack() as stack: self.portal = portal = stack.enter_context(anyio.from_thread.start_blocking_portal(**self.async_backend)) @stack.callback def reset_portal() -> None: self.portal = None > send1, receive1 = anyio.create_memory_object_stream[ typing.Union[typing.MutableMapping[str, typing.Any], None] ](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:660: TypeError ________ ERROR at setup of test_websocket_raise_custom_exception[trio] _________ test_client_factory = functools.partial(, backend='trio', backend_options={}) @pytest.fixture def client(test_client_factory: TestClientFactory) -> Generator[TestClient, None, None]: > with test_client_factory(app) as client: tests/test_applications.py:141: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __enter__(self) -> TestClient: with contextlib.ExitStack() as stack: self.portal = portal = stack.enter_context(anyio.from_thread.start_blocking_portal(**self.async_backend)) @stack.callback def reset_portal() -> None: self.portal = None > send1, receive1 = anyio.create_memory_object_stream[ typing.Union[typing.MutableMapping[str, typing.Any], None] ](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:660: TypeError _____________ ERROR at setup of test_http_endpoint_route[asyncio] ______________ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) @pytest.fixture def client(test_client_factory: TestClientFactory) -> Iterator[TestClient]: > with test_client_factory(app) as client: tests/test_endpoints.py:27: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __enter__(self) -> TestClient: with contextlib.ExitStack() as stack: self.portal = portal = stack.enter_context(anyio.from_thread.start_blocking_portal(**self.async_backend)) @stack.callback def reset_portal() -> None: self.portal = None > send1, receive1 = anyio.create_memory_object_stream[ typing.Union[typing.MutableMapping[str, typing.Any], None] ](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:660: TypeError _______________ ERROR at setup of test_http_endpoint_route[trio] _______________ test_client_factory = functools.partial(, backend='trio', backend_options={}) @pytest.fixture def client(test_client_factory: TestClientFactory) -> Iterator[TestClient]: > with test_client_factory(app) as client: tests/test_endpoints.py:27: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __enter__(self) -> TestClient: with contextlib.ExitStack() as stack: self.portal = portal = stack.enter_context(anyio.from_thread.start_blocking_portal(**self.async_backend)) @stack.callback def reset_portal() -> None: self.portal = None > send1, receive1 = anyio.create_memory_object_stream[ typing.Union[typing.MutableMapping[str, typing.Any], None] ](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:660: TypeError _______ ERROR at setup of test_http_endpoint_route_path_params[asyncio] ________ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) @pytest.fixture def client(test_client_factory: TestClientFactory) -> Iterator[TestClient]: > with test_client_factory(app) as client: tests/test_endpoints.py:27: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __enter__(self) -> TestClient: with contextlib.ExitStack() as stack: self.portal = portal = stack.enter_context(anyio.from_thread.start_blocking_portal(**self.async_backend)) @stack.callback def reset_portal() -> None: self.portal = None > send1, receive1 = anyio.create_memory_object_stream[ typing.Union[typing.MutableMapping[str, typing.Any], None] ](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:660: TypeError _________ ERROR at setup of test_http_endpoint_route_path_params[trio] _________ test_client_factory = functools.partial(, backend='trio', backend_options={}) @pytest.fixture def client(test_client_factory: TestClientFactory) -> Iterator[TestClient]: > with test_client_factory(app) as client: tests/test_endpoints.py:27: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __enter__(self) -> TestClient: with contextlib.ExitStack() as stack: self.portal = portal = stack.enter_context(anyio.from_thread.start_blocking_portal(**self.async_backend)) @stack.callback def reset_portal() -> None: self.portal = None > send1, receive1 = anyio.create_memory_object_stream[ typing.Union[typing.MutableMapping[str, typing.Any], None] ](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:660: TypeError __________ ERROR at setup of test_http_endpoint_route_method[asyncio] __________ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) @pytest.fixture def client(test_client_factory: TestClientFactory) -> Iterator[TestClient]: > with test_client_factory(app) as client: tests/test_endpoints.py:27: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __enter__(self) -> TestClient: with contextlib.ExitStack() as stack: self.portal = portal = stack.enter_context(anyio.from_thread.start_blocking_portal(**self.async_backend)) @stack.callback def reset_portal() -> None: self.portal = None > send1, receive1 = anyio.create_memory_object_stream[ typing.Union[typing.MutableMapping[str, typing.Any], None] ](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:660: TypeError ___________ ERROR at setup of test_http_endpoint_route_method[trio] ____________ test_client_factory = functools.partial(, backend='trio', backend_options={}) @pytest.fixture def client(test_client_factory: TestClientFactory) -> Iterator[TestClient]: > with test_client_factory(app) as client: tests/test_endpoints.py:27: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __enter__(self) -> TestClient: with contextlib.ExitStack() as stack: self.portal = portal = stack.enter_context(anyio.from_thread.start_blocking_portal(**self.async_backend)) @stack.callback def reset_portal() -> None: self.portal = None > send1, receive1 = anyio.create_memory_object_stream[ typing.Union[typing.MutableMapping[str, typing.Any], None] ](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:660: TypeError ________________ ERROR at setup of test_not_acceptable[asyncio] ________________ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) @pytest.fixture def client(test_client_factory: TestClientFactory) -> Generator[TestClient, None, None]: > with test_client_factory(app) as client: tests/test_exceptions.py:78: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __enter__(self) -> TestClient: with contextlib.ExitStack() as stack: self.portal = portal = stack.enter_context(anyio.from_thread.start_blocking_portal(**self.async_backend)) @stack.callback def reset_portal() -> None: self.portal = None > send1, receive1 = anyio.create_memory_object_stream[ typing.Union[typing.MutableMapping[str, typing.Any], None] ](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:660: TypeError _________________ ERROR at setup of test_not_acceptable[trio] __________________ test_client_factory = functools.partial(, backend='trio', backend_options={}) @pytest.fixture def client(test_client_factory: TestClientFactory) -> Generator[TestClient, None, None]: > with test_client_factory(app) as client: tests/test_exceptions.py:78: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __enter__(self) -> TestClient: with contextlib.ExitStack() as stack: self.portal = portal = stack.enter_context(anyio.from_thread.start_blocking_portal(**self.async_backend)) @stack.callback def reset_portal() -> None: self.portal = None > send1, receive1 = anyio.create_memory_object_stream[ typing.Union[typing.MutableMapping[str, typing.Any], None] ](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:660: TypeError __________________ ERROR at setup of test_no_content[asyncio] __________________ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) @pytest.fixture def client(test_client_factory: TestClientFactory) -> Generator[TestClient, None, None]: > with test_client_factory(app) as client: tests/test_exceptions.py:78: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __enter__(self) -> TestClient: with contextlib.ExitStack() as stack: self.portal = portal = stack.enter_context(anyio.from_thread.start_blocking_portal(**self.async_backend)) @stack.callback def reset_portal() -> None: self.portal = None > send1, receive1 = anyio.create_memory_object_stream[ typing.Union[typing.MutableMapping[str, typing.Any], None] ](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:660: TypeError ___________________ ERROR at setup of test_no_content[trio] ____________________ test_client_factory = functools.partial(, backend='trio', backend_options={}) @pytest.fixture def client(test_client_factory: TestClientFactory) -> Generator[TestClient, None, None]: > with test_client_factory(app) as client: tests/test_exceptions.py:78: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __enter__(self) -> TestClient: with contextlib.ExitStack() as stack: self.portal = portal = stack.enter_context(anyio.from_thread.start_blocking_portal(**self.async_backend)) @stack.callback def reset_portal() -> None: self.portal = None > send1, receive1 = anyio.create_memory_object_stream[ typing.Union[typing.MutableMapping[str, typing.Any], None] ](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:660: TypeError _________________ ERROR at setup of test_not_modified[asyncio] _________________ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) @pytest.fixture def client(test_client_factory: TestClientFactory) -> Generator[TestClient, None, None]: > with test_client_factory(app) as client: tests/test_exceptions.py:78: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __enter__(self) -> TestClient: with contextlib.ExitStack() as stack: self.portal = portal = stack.enter_context(anyio.from_thread.start_blocking_portal(**self.async_backend)) @stack.callback def reset_portal() -> None: self.portal = None > send1, receive1 = anyio.create_memory_object_stream[ typing.Union[typing.MutableMapping[str, typing.Any], None] ](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:660: TypeError __________________ ERROR at setup of test_not_modified[trio] ___________________ test_client_factory = functools.partial(, backend='trio', backend_options={}) @pytest.fixture def client(test_client_factory: TestClientFactory) -> Generator[TestClient, None, None]: > with test_client_factory(app) as client: tests/test_exceptions.py:78: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __enter__(self) -> TestClient: with contextlib.ExitStack() as stack: self.portal = portal = stack.enter_context(anyio.from_thread.start_blocking_portal(**self.async_backend)) @stack.callback def reset_portal() -> None: self.portal = None > send1, receive1 = anyio.create_memory_object_stream[ typing.Union[typing.MutableMapping[str, typing.Any], None] ](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:660: TypeError _________________ ERROR at setup of test_with_headers[asyncio] _________________ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) @pytest.fixture def client(test_client_factory: TestClientFactory) -> Generator[TestClient, None, None]: > with test_client_factory(app) as client: tests/test_exceptions.py:78: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __enter__(self) -> TestClient: with contextlib.ExitStack() as stack: self.portal = portal = stack.enter_context(anyio.from_thread.start_blocking_portal(**self.async_backend)) @stack.callback def reset_portal() -> None: self.portal = None > send1, receive1 = anyio.create_memory_object_stream[ typing.Union[typing.MutableMapping[str, typing.Any], None] ](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:660: TypeError __________________ ERROR at setup of test_with_headers[trio] ___________________ test_client_factory = functools.partial(, backend='trio', backend_options={}) @pytest.fixture def client(test_client_factory: TestClientFactory) -> Generator[TestClient, None, None]: > with test_client_factory(app) as client: tests/test_exceptions.py:78: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __enter__(self) -> TestClient: with contextlib.ExitStack() as stack: self.portal = portal = stack.enter_context(anyio.from_thread.start_blocking_portal(**self.async_backend)) @stack.callback def reset_portal() -> None: self.portal = None > send1, receive1 = anyio.create_memory_object_stream[ typing.Union[typing.MutableMapping[str, typing.Any], None] ](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:660: TypeError ___________ ERROR at setup of test_websockets_should_raise[asyncio] ____________ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) @pytest.fixture def client(test_client_factory: TestClientFactory) -> Generator[TestClient, None, None]: > with test_client_factory(app) as client: tests/test_exceptions.py:78: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __enter__(self) -> TestClient: with contextlib.ExitStack() as stack: self.portal = portal = stack.enter_context(anyio.from_thread.start_blocking_portal(**self.async_backend)) @stack.callback def reset_portal() -> None: self.portal = None > send1, receive1 = anyio.create_memory_object_stream[ typing.Union[typing.MutableMapping[str, typing.Any], None] ](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:660: TypeError _____________ ERROR at setup of test_websockets_should_raise[trio] _____________ test_client_factory = functools.partial(, backend='trio', backend_options={}) @pytest.fixture def client(test_client_factory: TestClientFactory) -> Generator[TestClient, None, None]: > with test_client_factory(app) as client: tests/test_exceptions.py:78: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __enter__(self) -> TestClient: with contextlib.ExitStack() as stack: self.portal = portal = stack.enter_context(anyio.from_thread.start_blocking_portal(**self.async_backend)) @stack.callback def reset_portal() -> None: self.portal = None > send1, receive1 = anyio.create_memory_object_stream[ typing.Union[typing.MutableMapping[str, typing.Any], None] ](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:660: TypeError __________ ERROR at setup of test_handled_exc_after_response[asyncio] __________ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) @pytest.fixture def client(test_client_factory: TestClientFactory) -> Generator[TestClient, None, None]: > with test_client_factory(app) as client: tests/test_exceptions.py:78: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __enter__(self) -> TestClient: with contextlib.ExitStack() as stack: self.portal = portal = stack.enter_context(anyio.from_thread.start_blocking_portal(**self.async_backend)) @stack.callback def reset_portal() -> None: self.portal = None > send1, receive1 = anyio.create_memory_object_stream[ typing.Union[typing.MutableMapping[str, typing.Any], None] ](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:660: TypeError ___________ ERROR at setup of test_handled_exc_after_response[trio] ____________ test_client_factory = functools.partial(, backend='trio', backend_options={}) @pytest.fixture def client(test_client_factory: TestClientFactory) -> Generator[TestClient, None, None]: > with test_client_factory(app) as client: tests/test_exceptions.py:78: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __enter__(self) -> TestClient: with contextlib.ExitStack() as stack: self.portal = portal = stack.enter_context(anyio.from_thread.start_blocking_portal(**self.async_backend)) @stack.callback def reset_portal() -> None: self.portal = None > send1, receive1 = anyio.create_memory_object_stream[ typing.Union[typing.MutableMapping[str, typing.Any], None] ](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:660: TypeError _ ERROR at setup of test_request_in_app_and_handler_is_the_same_object[asyncio] _ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) @pytest.fixture def client(test_client_factory: TestClientFactory) -> Generator[TestClient, None, None]: > with test_client_factory(app) as client: tests/test_exceptions.py:78: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __enter__(self) -> TestClient: with contextlib.ExitStack() as stack: self.portal = portal = stack.enter_context(anyio.from_thread.start_blocking_portal(**self.async_backend)) @stack.callback def reset_portal() -> None: self.portal = None > send1, receive1 = anyio.create_memory_object_stream[ typing.Union[typing.MutableMapping[str, typing.Any], None] ](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:660: TypeError __ ERROR at setup of test_request_in_app_and_handler_is_the_same_object[trio] __ test_client_factory = functools.partial(, backend='trio', backend_options={}) @pytest.fixture def client(test_client_factory: TestClientFactory) -> Generator[TestClient, None, None]: > with test_client_factory(app) as client: tests/test_exceptions.py:78: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __enter__(self) -> TestClient: with contextlib.ExitStack() as stack: self.portal = portal = stack.enter_context(anyio.from_thread.start_blocking_portal(**self.async_backend)) @stack.callback def reset_portal() -> None: self.portal = None > send1, receive1 = anyio.create_memory_object_stream[ typing.Union[typing.MutableMapping[str, typing.Any], None] ](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:660: TypeError ____________________ ERROR at setup of test_router[asyncio] ____________________ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) @pytest.fixture def client( test_client_factory: TestClientFactory, ) -> typing.Generator[TestClient, None, None]: > with test_client_factory(app) as client: tests/test_routing.py:169: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __enter__(self) -> TestClient: with contextlib.ExitStack() as stack: self.portal = portal = stack.enter_context(anyio.from_thread.start_blocking_portal(**self.async_backend)) @stack.callback def reset_portal() -> None: self.portal = None > send1, receive1 = anyio.create_memory_object_stream[ typing.Union[typing.MutableMapping[str, typing.Any], None] ](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:660: TypeError _____________________ ERROR at setup of test_router[trio] ______________________ test_client_factory = functools.partial(, backend='trio', backend_options={}) @pytest.fixture def client( test_client_factory: TestClientFactory, ) -> typing.Generator[TestClient, None, None]: > with test_client_factory(app) as client: tests/test_routing.py:169: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __enter__(self) -> TestClient: with contextlib.ExitStack() as stack: self.portal = portal = stack.enter_context(anyio.from_thread.start_blocking_portal(**self.async_backend)) @stack.callback def reset_portal() -> None: self.portal = None > send1, receive1 = anyio.create_memory_object_stream[ typing.Union[typing.MutableMapping[str, typing.Any], None] ](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:660: TypeError _______________ ERROR at setup of test_route_converters[asyncio] _______________ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) @pytest.fixture def client( test_client_factory: TestClientFactory, ) -> typing.Generator[TestClient, None, None]: > with test_client_factory(app) as client: tests/test_routing.py:169: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __enter__(self) -> TestClient: with contextlib.ExitStack() as stack: self.portal = portal = stack.enter_context(anyio.from_thread.start_blocking_portal(**self.async_backend)) @stack.callback def reset_portal() -> None: self.portal = None > send1, receive1 = anyio.create_memory_object_stream[ typing.Union[typing.MutableMapping[str, typing.Any], None] ](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:660: TypeError ________________ ERROR at setup of test_route_converters[trio] _________________ test_client_factory = functools.partial(, backend='trio', backend_options={}) @pytest.fixture def client( test_client_factory: TestClientFactory, ) -> typing.Generator[TestClient, None, None]: > with test_client_factory(app) as client: tests/test_routing.py:169: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __enter__(self) -> TestClient: with contextlib.ExitStack() as stack: self.portal = portal = stack.enter_context(anyio.from_thread.start_blocking_portal(**self.async_backend)) @stack.callback def reset_portal() -> None: self.portal = None > send1, receive1 = anyio.create_memory_object_stream[ typing.Union[typing.MutableMapping[str, typing.Any], None] ](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:660: TypeError _______________ ERROR at setup of test_router_add_route[asyncio] _______________ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) @pytest.fixture def client( test_client_factory: TestClientFactory, ) -> typing.Generator[TestClient, None, None]: > with test_client_factory(app) as client: tests/test_routing.py:169: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __enter__(self) -> TestClient: with contextlib.ExitStack() as stack: self.portal = portal = stack.enter_context(anyio.from_thread.start_blocking_portal(**self.async_backend)) @stack.callback def reset_portal() -> None: self.portal = None > send1, receive1 = anyio.create_memory_object_stream[ typing.Union[typing.MutableMapping[str, typing.Any], None] ](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:660: TypeError ________________ ERROR at setup of test_router_add_route[trio] _________________ test_client_factory = functools.partial(, backend='trio', backend_options={}) @pytest.fixture def client( test_client_factory: TestClientFactory, ) -> typing.Generator[TestClient, None, None]: > with test_client_factory(app) as client: tests/test_routing.py:169: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __enter__(self) -> TestClient: with contextlib.ExitStack() as stack: self.portal = portal = stack.enter_context(anyio.from_thread.start_blocking_portal(**self.async_backend)) @stack.callback def reset_portal() -> None: self.portal = None > send1, receive1 = anyio.create_memory_object_stream[ typing.Union[typing.MutableMapping[str, typing.Any], None] ](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:660: TypeError ____________ ERROR at setup of test_router_duplicate_path[asyncio] _____________ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) @pytest.fixture def client( test_client_factory: TestClientFactory, ) -> typing.Generator[TestClient, None, None]: > with test_client_factory(app) as client: tests/test_routing.py:169: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __enter__(self) -> TestClient: with contextlib.ExitStack() as stack: self.portal = portal = stack.enter_context(anyio.from_thread.start_blocking_portal(**self.async_backend)) @stack.callback def reset_portal() -> None: self.portal = None > send1, receive1 = anyio.create_memory_object_stream[ typing.Union[typing.MutableMapping[str, typing.Any], None] ](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:660: TypeError ______________ ERROR at setup of test_router_duplicate_path[trio] ______________ test_client_factory = functools.partial(, backend='trio', backend_options={}) @pytest.fixture def client( test_client_factory: TestClientFactory, ) -> typing.Generator[TestClient, None, None]: > with test_client_factory(app) as client: tests/test_routing.py:169: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __enter__(self) -> TestClient: with contextlib.ExitStack() as stack: self.portal = portal = stack.enter_context(anyio.from_thread.start_blocking_portal(**self.async_backend)) @stack.callback def reset_portal() -> None: self.portal = None > send1, receive1 = anyio.create_memory_object_stream[ typing.Union[typing.MutableMapping[str, typing.Any], None] ](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:660: TypeError __________ ERROR at setup of test_router_add_websocket_route[asyncio] __________ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) @pytest.fixture def client( test_client_factory: TestClientFactory, ) -> typing.Generator[TestClient, None, None]: > with test_client_factory(app) as client: tests/test_routing.py:169: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __enter__(self) -> TestClient: with contextlib.ExitStack() as stack: self.portal = portal = stack.enter_context(anyio.from_thread.start_blocking_portal(**self.async_backend)) @stack.callback def reset_portal() -> None: self.portal = None > send1, receive1 = anyio.create_memory_object_stream[ typing.Union[typing.MutableMapping[str, typing.Any], None] ](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:660: TypeError ___________ ERROR at setup of test_router_add_websocket_route[trio] ____________ test_client_factory = functools.partial(, backend='trio', backend_options={}) @pytest.fixture def client( test_client_factory: TestClientFactory, ) -> typing.Generator[TestClient, None, None]: > with test_client_factory(app) as client: tests/test_routing.py:169: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __enter__(self) -> TestClient: with contextlib.ExitStack() as stack: self.portal = portal = stack.enter_context(anyio.from_thread.start_blocking_portal(**self.async_backend)) @stack.callback def reset_portal() -> None: self.portal = None > send1, receive1 = anyio.create_memory_object_stream[ typing.Union[typing.MutableMapping[str, typing.Any], None] ](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:660: TypeError =================================== FAILURES =================================== _______________________ test_custom_middleware[asyncio] ________________________ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) def test_custom_middleware(test_client_factory: TestClientFactory) -> None: client = test_client_factory(app) > response = client.get("/") tests/middleware/test_base.py:89: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:456: in get return super().get( /usr/lib/python3.13/site-packages/httpx/_client.py:1066: in get return self.request( starlette/testclient.py:428: in request return super().request( /usr/lib/python3.13/site-packages/httpx/_client.py:837: in request return self.send(request, auth=auth, follow_redirects=follow_redirects) /usr/lib/python3.13/site-packages/httpx/_client.py:926: in send response = self._send_handling_auth( /usr/lib/python3.13/site-packages/httpx/_client.py:954: in _send_handling_auth response = self._send_handling_redirects( /usr/lib/python3.13/site-packages/httpx/_client.py:991: in _send_handling_redirects response = self._send_single_request(request) /usr/lib/python3.13/site-packages/httpx/_client.py:1027: in _send_single_request response = transport.handle_request(request) starlette/testclient.py:337: in handle_request raise exc starlette/testclient.py:334: in handle_request portal.call(self.app, scope, receive, send) /usr/lib/python3.13/site-packages/anyio/from_thread.py:277: in call return cast(T_Retval, self.start_task_soon(func, *args).result()) /usr/lib64/python3.13/concurrent/futures/_base.py:449: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval starlette/applications.py:112: in __call__ await self.middleware_stack(scope, receive, send) starlette/middleware/errors.py:187: in __call__ raise exc starlette/middleware/errors.py:165: in __call__ await self.app(scope, receive, _send) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = scope = {'app': , 'client': ('testclient', 50000), 'extensions': {'... b'*/*'), (b'accept-encoding', b'gzip, deflate'), (b'connection', b'keep-alive'), (b'user-agent', b'testclient')], ...} receive = .receive at 0x7f870225d120> send = ._send at 0x7f8701e7d6c0> async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None: if scope["type"] != "http": await self.app(scope, receive, send) return request = _CachedRequest(scope, receive) wrapped_receive = request.wrapped_receive response_sent = anyio.Event() async def call_next(request: Request) -> Response: app_exc: Exception | None = None async def receive_or_disconnect() -> Message: if response_sent.is_set(): return {"type": "http.disconnect"} async with anyio.create_task_group() as task_group: async def wrap(func: typing.Callable[[], typing.Awaitable[T]]) -> T: result = await func() task_group.cancel_scope.cancel() return result task_group.start_soon(wrap, response_sent.wait) message = await wrap(wrapped_receive) if response_sent.is_set(): return {"type": "http.disconnect"} return message async def send_no_error(message: Message) -> None: try: await send_stream.send(message) except anyio.BrokenResourceError: # recv_stream has been closed, i.e. response_sent has been set. return async def coro() -> None: nonlocal app_exc with send_stream: try: await self.app(scope, receive_or_disconnect, send_no_error) except Exception as exc: app_exc = exc task_group.start_soon(coro) try: message = await recv_stream.receive() info = message.get("info", None) if message["type"] == "http.response.debug" and info is not None: message = await recv_stream.receive() except anyio.EndOfStream: if app_exc is not None: raise app_exc raise RuntimeError("No response returned.") assert message["type"] == "http.response.start" async def body_stream() -> typing.AsyncGenerator[bytes, None]: async for message in recv_stream: assert message["type"] == "http.response.body" body = message.get("body", b"") if body: yield body if not message.get("more_body", False): break if app_exc is not None: raise app_exc response = _StreamingResponse(status_code=message["status"], content=body_stream(), info=info) response.raw_headers = message["headers"] return response > send_stream, recv_stream = anyio.create_memory_object_stream[Message]() E TypeError: 'function' object is not subscriptable starlette/middleware/base.py:175: TypeError _________________________ test_custom_middleware[trio] _________________________ test_client_factory = functools.partial(, backend='trio', backend_options={}) def test_custom_middleware(test_client_factory: TestClientFactory) -> None: client = test_client_factory(app) > response = client.get("/") tests/middleware/test_base.py:89: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:456: in get return super().get( /usr/lib/python3.13/site-packages/httpx/_client.py:1066: in get return self.request( starlette/testclient.py:428: in request return super().request( /usr/lib/python3.13/site-packages/httpx/_client.py:837: in request return self.send(request, auth=auth, follow_redirects=follow_redirects) /usr/lib/python3.13/site-packages/httpx/_client.py:926: in send response = self._send_handling_auth( /usr/lib/python3.13/site-packages/httpx/_client.py:954: in _send_handling_auth response = self._send_handling_redirects( /usr/lib/python3.13/site-packages/httpx/_client.py:991: in _send_handling_redirects response = self._send_single_request(request) /usr/lib/python3.13/site-packages/httpx/_client.py:1027: in _send_single_request response = transport.handle_request(request) starlette/testclient.py:337: in handle_request raise exc starlette/testclient.py:334: in handle_request portal.call(self.app, scope, receive, send) /usr/lib/python3.13/site-packages/anyio/from_thread.py:277: in call return cast(T_Retval, self.start_task_soon(func, *args).result()) /usr/lib64/python3.13/concurrent/futures/_base.py:449: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval starlette/applications.py:112: in __call__ await self.middleware_stack(scope, receive, send) starlette/middleware/errors.py:187: in __call__ raise exc starlette/middleware/errors.py:165: in __call__ await self.app(scope, receive, _send) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = scope = {'app': , 'client': ('testclient', 50000), 'extensions': {'... b'*/*'), (b'accept-encoding', b'gzip, deflate'), (b'connection', b'keep-alive'), (b'user-agent', b'testclient')], ...} receive = .receive at 0x7f8701e7fb00> send = ._send at 0x7f8701fdd6c0> async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None: if scope["type"] != "http": await self.app(scope, receive, send) return request = _CachedRequest(scope, receive) wrapped_receive = request.wrapped_receive response_sent = anyio.Event() async def call_next(request: Request) -> Response: app_exc: Exception | None = None async def receive_or_disconnect() -> Message: if response_sent.is_set(): return {"type": "http.disconnect"} async with anyio.create_task_group() as task_group: async def wrap(func: typing.Callable[[], typing.Awaitable[T]]) -> T: result = await func() task_group.cancel_scope.cancel() return result task_group.start_soon(wrap, response_sent.wait) message = await wrap(wrapped_receive) if response_sent.is_set(): return {"type": "http.disconnect"} return message async def send_no_error(message: Message) -> None: try: await send_stream.send(message) except anyio.BrokenResourceError: # recv_stream has been closed, i.e. response_sent has been set. return async def coro() -> None: nonlocal app_exc with send_stream: try: await self.app(scope, receive_or_disconnect, send_no_error) except Exception as exc: app_exc = exc task_group.start_soon(coro) try: message = await recv_stream.receive() info = message.get("info", None) if message["type"] == "http.response.debug" and info is not None: message = await recv_stream.receive() except anyio.EndOfStream: if app_exc is not None: raise app_exc raise RuntimeError("No response returned.") assert message["type"] == "http.response.start" async def body_stream() -> typing.AsyncGenerator[bytes, None]: async for message in recv_stream: assert message["type"] == "http.response.body" body = message.get("body", b"") if body: yield body if not message.get("more_body", False): break if app_exc is not None: raise app_exc response = _StreamingResponse(status_code=message["status"], content=body_stream(), info=info) response.raw_headers = message["headers"] return response > send_stream, recv_stream = anyio.create_memory_object_stream[Message]() E TypeError: 'function' object is not subscriptable starlette/middleware/base.py:175: TypeError _____________ test_state_data_across_multiple_middlewares[asyncio] _____________ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) def test_state_data_across_multiple_middlewares( test_client_factory: TestClientFactory, ) -> None: expected_value1 = "foo" expected_value2 = "bar" class aMiddleware(BaseHTTPMiddleware): async def dispatch( self, request: Request, call_next: RequestResponseEndpoint, ) -> Response: request.state.foo = expected_value1 response = await call_next(request) return response class bMiddleware(BaseHTTPMiddleware): async def dispatch( self, request: Request, call_next: RequestResponseEndpoint, ) -> Response: request.state.bar = expected_value2 response = await call_next(request) response.headers["X-State-Foo"] = request.state.foo return response class cMiddleware(BaseHTTPMiddleware): async def dispatch( self, request: Request, call_next: RequestResponseEndpoint, ) -> Response: response = await call_next(request) response.headers["X-State-Bar"] = request.state.bar return response def homepage(request: Request) -> PlainTextResponse: return PlainTextResponse("OK") app = Starlette( routes=[Route("/", homepage)], middleware=[ Middleware(aMiddleware), Middleware(bMiddleware), Middleware(cMiddleware), ], ) client = test_client_factory(app) > response = client.get("/") tests/middleware/test_base.py:158: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:456: in get return super().get( /usr/lib/python3.13/site-packages/httpx/_client.py:1066: in get return self.request( starlette/testclient.py:428: in request return super().request( /usr/lib/python3.13/site-packages/httpx/_client.py:837: in request return self.send(request, auth=auth, follow_redirects=follow_redirects) /usr/lib/python3.13/site-packages/httpx/_client.py:926: in send response = self._send_handling_auth( /usr/lib/python3.13/site-packages/httpx/_client.py:954: in _send_handling_auth response = self._send_handling_redirects( /usr/lib/python3.13/site-packages/httpx/_client.py:991: in _send_handling_redirects response = self._send_single_request(request) /usr/lib/python3.13/site-packages/httpx/_client.py:1027: in _send_single_request response = transport.handle_request(request) starlette/testclient.py:337: in handle_request raise exc starlette/testclient.py:334: in handle_request portal.call(self.app, scope, receive, send) /usr/lib/python3.13/site-packages/anyio/from_thread.py:277: in call return cast(T_Retval, self.start_task_soon(func, *args).result()) /usr/lib64/python3.13/concurrent/futures/_base.py:456: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval starlette/applications.py:112: in __call__ await self.middleware_stack(scope, receive, send) starlette/middleware/errors.py:187: in __call__ raise exc starlette/middleware/errors.py:165: in __call__ await self.app(scope, receive, _send) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = .aMiddleware object at 0x7f8701f90050> scope = {'app': , 'client': ('testclient', 50000), 'extensions': {'... b'*/*'), (b'accept-encoding', b'gzip, deflate'), (b'connection', b'keep-alive'), (b'user-agent', b'testclient')], ...} receive = .receive at 0x7f8701fdd260> send = ._send at 0x7f8701fde480> async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None: if scope["type"] != "http": await self.app(scope, receive, send) return request = _CachedRequest(scope, receive) wrapped_receive = request.wrapped_receive response_sent = anyio.Event() async def call_next(request: Request) -> Response: app_exc: Exception | None = None async def receive_or_disconnect() -> Message: if response_sent.is_set(): return {"type": "http.disconnect"} async with anyio.create_task_group() as task_group: async def wrap(func: typing.Callable[[], typing.Awaitable[T]]) -> T: result = await func() task_group.cancel_scope.cancel() return result task_group.start_soon(wrap, response_sent.wait) message = await wrap(wrapped_receive) if response_sent.is_set(): return {"type": "http.disconnect"} return message async def send_no_error(message: Message) -> None: try: await send_stream.send(message) except anyio.BrokenResourceError: # recv_stream has been closed, i.e. response_sent has been set. return async def coro() -> None: nonlocal app_exc with send_stream: try: await self.app(scope, receive_or_disconnect, send_no_error) except Exception as exc: app_exc = exc task_group.start_soon(coro) try: message = await recv_stream.receive() info = message.get("info", None) if message["type"] == "http.response.debug" and info is not None: message = await recv_stream.receive() except anyio.EndOfStream: if app_exc is not None: raise app_exc raise RuntimeError("No response returned.") assert message["type"] == "http.response.start" async def body_stream() -> typing.AsyncGenerator[bytes, None]: async for message in recv_stream: assert message["type"] == "http.response.body" body = message.get("body", b"") if body: yield body if not message.get("more_body", False): break if app_exc is not None: raise app_exc response = _StreamingResponse(status_code=message["status"], content=body_stream(), info=info) response.raw_headers = message["headers"] return response > send_stream, recv_stream = anyio.create_memory_object_stream[Message]() E TypeError: 'function' object is not subscriptable starlette/middleware/base.py:175: TypeError ______________ test_state_data_across_multiple_middlewares[trio] _______________ test_client_factory = functools.partial(, backend='trio', backend_options={}) def test_state_data_across_multiple_middlewares( test_client_factory: TestClientFactory, ) -> None: expected_value1 = "foo" expected_value2 = "bar" class aMiddleware(BaseHTTPMiddleware): async def dispatch( self, request: Request, call_next: RequestResponseEndpoint, ) -> Response: request.state.foo = expected_value1 response = await call_next(request) return response class bMiddleware(BaseHTTPMiddleware): async def dispatch( self, request: Request, call_next: RequestResponseEndpoint, ) -> Response: request.state.bar = expected_value2 response = await call_next(request) response.headers["X-State-Foo"] = request.state.foo return response class cMiddleware(BaseHTTPMiddleware): async def dispatch( self, request: Request, call_next: RequestResponseEndpoint, ) -> Response: response = await call_next(request) response.headers["X-State-Bar"] = request.state.bar return response def homepage(request: Request) -> PlainTextResponse: return PlainTextResponse("OK") app = Starlette( routes=[Route("/", homepage)], middleware=[ Middleware(aMiddleware), Middleware(bMiddleware), Middleware(cMiddleware), ], ) client = test_client_factory(app) > response = client.get("/") tests/middleware/test_base.py:158: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:456: in get return super().get( /usr/lib/python3.13/site-packages/httpx/_client.py:1066: in get return self.request( starlette/testclient.py:428: in request return super().request( /usr/lib/python3.13/site-packages/httpx/_client.py:837: in request return self.send(request, auth=auth, follow_redirects=follow_redirects) /usr/lib/python3.13/site-packages/httpx/_client.py:926: in send response = self._send_handling_auth( /usr/lib/python3.13/site-packages/httpx/_client.py:954: in _send_handling_auth response = self._send_handling_redirects( /usr/lib/python3.13/site-packages/httpx/_client.py:991: in _send_handling_redirects response = self._send_single_request(request) /usr/lib/python3.13/site-packages/httpx/_client.py:1027: in _send_single_request response = transport.handle_request(request) starlette/testclient.py:337: in handle_request raise exc starlette/testclient.py:334: in handle_request portal.call(self.app, scope, receive, send) /usr/lib/python3.13/site-packages/anyio/from_thread.py:277: in call return cast(T_Retval, self.start_task_soon(func, *args).result()) /usr/lib64/python3.13/concurrent/futures/_base.py:456: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval starlette/applications.py:112: in __call__ await self.middleware_stack(scope, receive, send) starlette/middleware/errors.py:187: in __call__ raise exc starlette/middleware/errors.py:165: in __call__ await self.app(scope, receive, _send) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = .aMiddleware object at 0x7f870205fcb0> scope = {'app': , 'client': ('testclient', 50000), 'extensions': {'... b'*/*'), (b'accept-encoding', b'gzip, deflate'), (b'connection', b'keep-alive'), (b'user-agent', b'testclient')], ...} receive = .receive at 0x7f8701fdeca0> send = ._send at 0x7f8701fded40> async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None: if scope["type"] != "http": await self.app(scope, receive, send) return request = _CachedRequest(scope, receive) wrapped_receive = request.wrapped_receive response_sent = anyio.Event() async def call_next(request: Request) -> Response: app_exc: Exception | None = None async def receive_or_disconnect() -> Message: if response_sent.is_set(): return {"type": "http.disconnect"} async with anyio.create_task_group() as task_group: async def wrap(func: typing.Callable[[], typing.Awaitable[T]]) -> T: result = await func() task_group.cancel_scope.cancel() return result task_group.start_soon(wrap, response_sent.wait) message = await wrap(wrapped_receive) if response_sent.is_set(): return {"type": "http.disconnect"} return message async def send_no_error(message: Message) -> None: try: await send_stream.send(message) except anyio.BrokenResourceError: # recv_stream has been closed, i.e. response_sent has been set. return async def coro() -> None: nonlocal app_exc with send_stream: try: await self.app(scope, receive_or_disconnect, send_no_error) except Exception as exc: app_exc = exc task_group.start_soon(coro) try: message = await recv_stream.receive() info = message.get("info", None) if message["type"] == "http.response.debug" and info is not None: message = await recv_stream.receive() except anyio.EndOfStream: if app_exc is not None: raise app_exc raise RuntimeError("No response returned.") assert message["type"] == "http.response.start" async def body_stream() -> typing.AsyncGenerator[bytes, None]: async for message in recv_stream: assert message["type"] == "http.response.body" body = message.get("body", b"") if body: yield body if not message.get("more_body", False): break if app_exc is not None: raise app_exc response = _StreamingResponse(status_code=message["status"], content=body_stream(), info=info) response.raw_headers = message["headers"] return response > send_stream, recv_stream = anyio.create_memory_object_stream[Message]() E TypeError: 'function' object is not subscriptable starlette/middleware/base.py:175: TypeError ____________________ test_app_middleware_argument[asyncio] _____________________ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) def test_app_middleware_argument(test_client_factory: TestClientFactory) -> None: def homepage(request: Request) -> PlainTextResponse: return PlainTextResponse("Homepage") app = Starlette(routes=[Route("/", homepage)], middleware=[Middleware(CustomMiddleware)]) client = test_client_factory(app) > response = client.get("/") tests/middleware/test_base.py:171: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:456: in get return super().get( /usr/lib/python3.13/site-packages/httpx/_client.py:1066: in get return self.request( starlette/testclient.py:428: in request return super().request( /usr/lib/python3.13/site-packages/httpx/_client.py:837: in request return self.send(request, auth=auth, follow_redirects=follow_redirects) /usr/lib/python3.13/site-packages/httpx/_client.py:926: in send response = self._send_handling_auth( /usr/lib/python3.13/site-packages/httpx/_client.py:954: in _send_handling_auth response = self._send_handling_redirects( /usr/lib/python3.13/site-packages/httpx/_client.py:991: in _send_handling_redirects response = self._send_single_request(request) /usr/lib/python3.13/site-packages/httpx/_client.py:1027: in _send_single_request response = transport.handle_request(request) starlette/testclient.py:337: in handle_request raise exc starlette/testclient.py:334: in handle_request portal.call(self.app, scope, receive, send) /usr/lib/python3.13/site-packages/anyio/from_thread.py:277: in call return cast(T_Retval, self.start_task_soon(func, *args).result()) /usr/lib64/python3.13/concurrent/futures/_base.py:456: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval starlette/applications.py:112: in __call__ await self.middleware_stack(scope, receive, send) starlette/middleware/errors.py:187: in __call__ raise exc starlette/middleware/errors.py:165: in __call__ await self.app(scope, receive, _send) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = scope = {'app': , 'client': ('testclient', 50000), 'extensions': {'... b'*/*'), (b'accept-encoding', b'gzip, deflate'), (b'connection', b'keep-alive'), (b'user-agent', b'testclient')], ...} receive = .receive at 0x7f8701fdf2e0> send = ._send at 0x7f8701fdf920> async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None: if scope["type"] != "http": await self.app(scope, receive, send) return request = _CachedRequest(scope, receive) wrapped_receive = request.wrapped_receive response_sent = anyio.Event() async def call_next(request: Request) -> Response: app_exc: Exception | None = None async def receive_or_disconnect() -> Message: if response_sent.is_set(): return {"type": "http.disconnect"} async with anyio.create_task_group() as task_group: async def wrap(func: typing.Callable[[], typing.Awaitable[T]]) -> T: result = await func() task_group.cancel_scope.cancel() return result task_group.start_soon(wrap, response_sent.wait) message = await wrap(wrapped_receive) if response_sent.is_set(): return {"type": "http.disconnect"} return message async def send_no_error(message: Message) -> None: try: await send_stream.send(message) except anyio.BrokenResourceError: # recv_stream has been closed, i.e. response_sent has been set. return async def coro() -> None: nonlocal app_exc with send_stream: try: await self.app(scope, receive_or_disconnect, send_no_error) except Exception as exc: app_exc = exc task_group.start_soon(coro) try: message = await recv_stream.receive() info = message.get("info", None) if message["type"] == "http.response.debug" and info is not None: message = await recv_stream.receive() except anyio.EndOfStream: if app_exc is not None: raise app_exc raise RuntimeError("No response returned.") assert message["type"] == "http.response.start" async def body_stream() -> typing.AsyncGenerator[bytes, None]: async for message in recv_stream: assert message["type"] == "http.response.body" body = message.get("body", b"") if body: yield body if not message.get("more_body", False): break if app_exc is not None: raise app_exc response = _StreamingResponse(status_code=message["status"], content=body_stream(), info=info) response.raw_headers = message["headers"] return response > send_stream, recv_stream = anyio.create_memory_object_stream[Message]() E TypeError: 'function' object is not subscriptable starlette/middleware/base.py:175: TypeError ______________________ test_app_middleware_argument[trio] ______________________ test_client_factory = functools.partial(, backend='trio', backend_options={}) def test_app_middleware_argument(test_client_factory: TestClientFactory) -> None: def homepage(request: Request) -> PlainTextResponse: return PlainTextResponse("Homepage") app = Starlette(routes=[Route("/", homepage)], middleware=[Middleware(CustomMiddleware)]) client = test_client_factory(app) > response = client.get("/") tests/middleware/test_base.py:171: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:456: in get return super().get( /usr/lib/python3.13/site-packages/httpx/_client.py:1066: in get return self.request( starlette/testclient.py:428: in request return super().request( /usr/lib/python3.13/site-packages/httpx/_client.py:837: in request return self.send(request, auth=auth, follow_redirects=follow_redirects) /usr/lib/python3.13/site-packages/httpx/_client.py:926: in send response = self._send_handling_auth( /usr/lib/python3.13/site-packages/httpx/_client.py:954: in _send_handling_auth response = self._send_handling_redirects( /usr/lib/python3.13/site-packages/httpx/_client.py:991: in _send_handling_redirects response = self._send_single_request(request) /usr/lib/python3.13/site-packages/httpx/_client.py:1027: in _send_single_request response = transport.handle_request(request) starlette/testclient.py:337: in handle_request raise exc starlette/testclient.py:334: in handle_request portal.call(self.app, scope, receive, send) /usr/lib/python3.13/site-packages/anyio/from_thread.py:277: in call return cast(T_Retval, self.start_task_soon(func, *args).result()) /usr/lib64/python3.13/concurrent/futures/_base.py:449: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval starlette/applications.py:112: in __call__ await self.middleware_stack(scope, receive, send) starlette/middleware/errors.py:187: in __call__ raise exc starlette/middleware/errors.py:165: in __call__ await self.app(scope, receive, _send) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = scope = {'app': , 'client': ('testclient', 50000), 'extensions': {'... b'*/*'), (b'accept-encoding', b'gzip, deflate'), (b'connection', b'keep-alive'), (b'user-agent', b'testclient')], ...} receive = .receive at 0x7f8701fdfba0> send = ._send at 0x7f8701f9c040> async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None: if scope["type"] != "http": await self.app(scope, receive, send) return request = _CachedRequest(scope, receive) wrapped_receive = request.wrapped_receive response_sent = anyio.Event() async def call_next(request: Request) -> Response: app_exc: Exception | None = None async def receive_or_disconnect() -> Message: if response_sent.is_set(): return {"type": "http.disconnect"} async with anyio.create_task_group() as task_group: async def wrap(func: typing.Callable[[], typing.Awaitable[T]]) -> T: result = await func() task_group.cancel_scope.cancel() return result task_group.start_soon(wrap, response_sent.wait) message = await wrap(wrapped_receive) if response_sent.is_set(): return {"type": "http.disconnect"} return message async def send_no_error(message: Message) -> None: try: await send_stream.send(message) except anyio.BrokenResourceError: # recv_stream has been closed, i.e. response_sent has been set. return async def coro() -> None: nonlocal app_exc with send_stream: try: await self.app(scope, receive_or_disconnect, send_no_error) except Exception as exc: app_exc = exc task_group.start_soon(coro) try: message = await recv_stream.receive() info = message.get("info", None) if message["type"] == "http.response.debug" and info is not None: message = await recv_stream.receive() except anyio.EndOfStream: if app_exc is not None: raise app_exc raise RuntimeError("No response returned.") assert message["type"] == "http.response.start" async def body_stream() -> typing.AsyncGenerator[bytes, None]: async for message in recv_stream: assert message["type"] == "http.response.body" body = message.get("body", b"") if body: yield body if not message.get("more_body", False): break if app_exc is not None: raise app_exc response = _StreamingResponse(status_code=message["status"], content=body_stream(), info=info) response.raw_headers = message["headers"] return response > send_stream, recv_stream = anyio.create_memory_object_stream[Message]() E TypeError: 'function' object is not subscriptable starlette/middleware/base.py:175: TypeError ____________________ test_fully_evaluated_response[asyncio] ____________________ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) def test_fully_evaluated_response(test_client_factory: TestClientFactory) -> None: # Test for https://github.com/encode/starlette/issues/1022 class CustomMiddleware(BaseHTTPMiddleware): async def dispatch( self, request: Request, call_next: RequestResponseEndpoint, ) -> PlainTextResponse: await call_next(request) return PlainTextResponse("Custom") app = Starlette(middleware=[Middleware(CustomMiddleware)]) client = test_client_factory(app) > response = client.get("/does_not_exist") tests/middleware/test_base.py:189: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:456: in get return super().get( /usr/lib/python3.13/site-packages/httpx/_client.py:1066: in get return self.request( starlette/testclient.py:428: in request return super().request( /usr/lib/python3.13/site-packages/httpx/_client.py:837: in request return self.send(request, auth=auth, follow_redirects=follow_redirects) /usr/lib/python3.13/site-packages/httpx/_client.py:926: in send response = self._send_handling_auth( /usr/lib/python3.13/site-packages/httpx/_client.py:954: in _send_handling_auth response = self._send_handling_redirects( /usr/lib/python3.13/site-packages/httpx/_client.py:991: in _send_handling_redirects response = self._send_single_request(request) /usr/lib/python3.13/site-packages/httpx/_client.py:1027: in _send_single_request response = transport.handle_request(request) starlette/testclient.py:337: in handle_request raise exc starlette/testclient.py:334: in handle_request portal.call(self.app, scope, receive, send) /usr/lib/python3.13/site-packages/anyio/from_thread.py:277: in call return cast(T_Retval, self.start_task_soon(func, *args).result()) /usr/lib64/python3.13/concurrent/futures/_base.py:449: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval starlette/applications.py:112: in __call__ await self.middleware_stack(scope, receive, send) starlette/middleware/errors.py:187: in __call__ raise exc starlette/middleware/errors.py:165: in __call__ await self.app(scope, receive, _send) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = .CustomMiddleware object at 0x7f870205e660> scope = {'app': , 'client': ('testclient', 50000), 'extensions': {'... b'*/*'), (b'accept-encoding', b'gzip, deflate'), (b'connection', b'keep-alive'), (b'user-agent', b'testclient')], ...} receive = .receive at 0x7f8701fdef20> send = ._send at 0x7f8701f9c7c0> async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None: if scope["type"] != "http": await self.app(scope, receive, send) return request = _CachedRequest(scope, receive) wrapped_receive = request.wrapped_receive response_sent = anyio.Event() async def call_next(request: Request) -> Response: app_exc: Exception | None = None async def receive_or_disconnect() -> Message: if response_sent.is_set(): return {"type": "http.disconnect"} async with anyio.create_task_group() as task_group: async def wrap(func: typing.Callable[[], typing.Awaitable[T]]) -> T: result = await func() task_group.cancel_scope.cancel() return result task_group.start_soon(wrap, response_sent.wait) message = await wrap(wrapped_receive) if response_sent.is_set(): return {"type": "http.disconnect"} return message async def send_no_error(message: Message) -> None: try: await send_stream.send(message) except anyio.BrokenResourceError: # recv_stream has been closed, i.e. response_sent has been set. return async def coro() -> None: nonlocal app_exc with send_stream: try: await self.app(scope, receive_or_disconnect, send_no_error) except Exception as exc: app_exc = exc task_group.start_soon(coro) try: message = await recv_stream.receive() info = message.get("info", None) if message["type"] == "http.response.debug" and info is not None: message = await recv_stream.receive() except anyio.EndOfStream: if app_exc is not None: raise app_exc raise RuntimeError("No response returned.") assert message["type"] == "http.response.start" async def body_stream() -> typing.AsyncGenerator[bytes, None]: async for message in recv_stream: assert message["type"] == "http.response.body" body = message.get("body", b"") if body: yield body if not message.get("more_body", False): break if app_exc is not None: raise app_exc response = _StreamingResponse(status_code=message["status"], content=body_stream(), info=info) response.raw_headers = message["headers"] return response > send_stream, recv_stream = anyio.create_memory_object_stream[Message]() E TypeError: 'function' object is not subscriptable starlette/middleware/base.py:175: TypeError _____________________ test_fully_evaluated_response[trio] ______________________ test_client_factory = functools.partial(, backend='trio', backend_options={}) def test_fully_evaluated_response(test_client_factory: TestClientFactory) -> None: # Test for https://github.com/encode/starlette/issues/1022 class CustomMiddleware(BaseHTTPMiddleware): async def dispatch( self, request: Request, call_next: RequestResponseEndpoint, ) -> PlainTextResponse: await call_next(request) return PlainTextResponse("Custom") app = Starlette(middleware=[Middleware(CustomMiddleware)]) client = test_client_factory(app) > response = client.get("/does_not_exist") tests/middleware/test_base.py:189: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:456: in get return super().get( /usr/lib/python3.13/site-packages/httpx/_client.py:1066: in get return self.request( starlette/testclient.py:428: in request return super().request( /usr/lib/python3.13/site-packages/httpx/_client.py:837: in request return self.send(request, auth=auth, follow_redirects=follow_redirects) /usr/lib/python3.13/site-packages/httpx/_client.py:926: in send response = self._send_handling_auth( /usr/lib/python3.13/site-packages/httpx/_client.py:954: in _send_handling_auth response = self._send_handling_redirects( /usr/lib/python3.13/site-packages/httpx/_client.py:991: in _send_handling_redirects response = self._send_single_request(request) /usr/lib/python3.13/site-packages/httpx/_client.py:1027: in _send_single_request response = transport.handle_request(request) starlette/testclient.py:337: in handle_request raise exc starlette/testclient.py:334: in handle_request portal.call(self.app, scope, receive, send) /usr/lib/python3.13/site-packages/anyio/from_thread.py:277: in call return cast(T_Retval, self.start_task_soon(func, *args).result()) /usr/lib64/python3.13/concurrent/futures/_base.py:449: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval starlette/applications.py:112: in __call__ await self.middleware_stack(scope, receive, send) starlette/middleware/errors.py:187: in __call__ raise exc starlette/middleware/errors.py:165: in __call__ await self.app(scope, receive, _send) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = .CustomMiddleware object at 0x7f870205fcb0> scope = {'app': , 'client': ('testclient', 50000), 'extensions': {'... b'*/*'), (b'accept-encoding', b'gzip, deflate'), (b'connection', b'keep-alive'), (b'user-agent', b'testclient')], ...} receive = .receive at 0x7f8701f9cfe0> send = ._send at 0x7f8701f9d620> async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None: if scope["type"] != "http": await self.app(scope, receive, send) return request = _CachedRequest(scope, receive) wrapped_receive = request.wrapped_receive response_sent = anyio.Event() async def call_next(request: Request) -> Response: app_exc: Exception | None = None async def receive_or_disconnect() -> Message: if response_sent.is_set(): return {"type": "http.disconnect"} async with anyio.create_task_group() as task_group: async def wrap(func: typing.Callable[[], typing.Awaitable[T]]) -> T: result = await func() task_group.cancel_scope.cancel() return result task_group.start_soon(wrap, response_sent.wait) message = await wrap(wrapped_receive) if response_sent.is_set(): return {"type": "http.disconnect"} return message async def send_no_error(message: Message) -> None: try: await send_stream.send(message) except anyio.BrokenResourceError: # recv_stream has been closed, i.e. response_sent has been set. return async def coro() -> None: nonlocal app_exc with send_stream: try: await self.app(scope, receive_or_disconnect, send_no_error) except Exception as exc: app_exc = exc task_group.start_soon(coro) try: message = await recv_stream.receive() info = message.get("info", None) if message["type"] == "http.response.debug" and info is not None: message = await recv_stream.receive() except anyio.EndOfStream: if app_exc is not None: raise app_exc raise RuntimeError("No response returned.") assert message["type"] == "http.response.start" async def body_stream() -> typing.AsyncGenerator[bytes, None]: async for message in recv_stream: assert message["type"] == "http.response.body" body = message.get("body", b"") if body: yield body if not message.get("more_body", False): break if app_exc is not None: raise app_exc response = _StreamingResponse(status_code=message["status"], content=body_stream(), info=info) response.raw_headers = message["headers"] return response > send_stream, recv_stream = anyio.create_memory_object_stream[Message]() E TypeError: 'function' object is not subscriptable starlette/middleware/base.py:175: TypeError ______ test_contextvars[asyncio-CustomMiddlewareUsingBaseHTTPMiddleware] _______ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) middleware_cls = @pytest.mark.parametrize( "middleware_cls", [ CustomMiddlewareWithoutBaseHTTPMiddleware, pytest.param( CustomMiddlewareUsingBaseHTTPMiddleware, marks=pytest.mark.xfail( reason=( "BaseHTTPMiddleware creates a TaskGroup which copies the context" "and erases any changes to it made within the TaskGroup" ), raises=AssertionError, ), ), ], ) def test_contextvars( test_client_factory: TestClientFactory, middleware_cls: _MiddlewareFactory[Any], ) -> None: # this has to be an async endpoint because Starlette calls run_in_threadpool # on sync endpoints which has it's own set of peculiarities w.r.t propagating # contextvars (it propagates them forwards but not backwards) async def homepage(request: Request) -> PlainTextResponse: assert ctxvar.get() == "set by middleware" ctxvar.set("set by endpoint") return PlainTextResponse("Homepage") app = Starlette(middleware=[Middleware(middleware_cls)], routes=[Route("/", homepage)]) client = test_client_factory(app) > response = client.get("/") tests/middleware/test_base.py:249: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:456: in get return super().get( /usr/lib/python3.13/site-packages/httpx/_client.py:1066: in get return self.request( starlette/testclient.py:428: in request return super().request( /usr/lib/python3.13/site-packages/httpx/_client.py:837: in request return self.send(request, auth=auth, follow_redirects=follow_redirects) /usr/lib/python3.13/site-packages/httpx/_client.py:926: in send response = self._send_handling_auth( /usr/lib/python3.13/site-packages/httpx/_client.py:954: in _send_handling_auth response = self._send_handling_redirects( /usr/lib/python3.13/site-packages/httpx/_client.py:991: in _send_handling_redirects response = self._send_single_request(request) /usr/lib/python3.13/site-packages/httpx/_client.py:1027: in _send_single_request response = transport.handle_request(request) starlette/testclient.py:337: in handle_request raise exc starlette/testclient.py:334: in handle_request portal.call(self.app, scope, receive, send) /usr/lib/python3.13/site-packages/anyio/from_thread.py:277: in call return cast(T_Retval, self.start_task_soon(func, *args).result()) /usr/lib64/python3.13/concurrent/futures/_base.py:456: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval starlette/applications.py:112: in __call__ await self.middleware_stack(scope, receive, send) starlette/middleware/errors.py:187: in __call__ raise exc starlette/middleware/errors.py:165: in __call__ await self.app(scope, receive, _send) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = scope = {'app': , 'client': ('testclient', 50000), 'extensions': {'... b'*/*'), (b'accept-encoding', b'gzip, deflate'), (b'connection', b'keep-alive'), (b'user-agent', b'testclient')], ...} receive = .receive at 0x7f8701f9d940> send = ._send at 0x7f8701f9dbc0> async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None: if scope["type"] != "http": await self.app(scope, receive, send) return request = _CachedRequest(scope, receive) wrapped_receive = request.wrapped_receive response_sent = anyio.Event() async def call_next(request: Request) -> Response: app_exc: Exception | None = None async def receive_or_disconnect() -> Message: if response_sent.is_set(): return {"type": "http.disconnect"} async with anyio.create_task_group() as task_group: async def wrap(func: typing.Callable[[], typing.Awaitable[T]]) -> T: result = await func() task_group.cancel_scope.cancel() return result task_group.start_soon(wrap, response_sent.wait) message = await wrap(wrapped_receive) if response_sent.is_set(): return {"type": "http.disconnect"} return message async def send_no_error(message: Message) -> None: try: await send_stream.send(message) except anyio.BrokenResourceError: # recv_stream has been closed, i.e. response_sent has been set. return async def coro() -> None: nonlocal app_exc with send_stream: try: await self.app(scope, receive_or_disconnect, send_no_error) except Exception as exc: app_exc = exc task_group.start_soon(coro) try: message = await recv_stream.receive() info = message.get("info", None) if message["type"] == "http.response.debug" and info is not None: message = await recv_stream.receive() except anyio.EndOfStream: if app_exc is not None: raise app_exc raise RuntimeError("No response returned.") assert message["type"] == "http.response.start" async def body_stream() -> typing.AsyncGenerator[bytes, None]: async for message in recv_stream: assert message["type"] == "http.response.body" body = message.get("body", b"") if body: yield body if not message.get("more_body", False): break if app_exc is not None: raise app_exc response = _StreamingResponse(status_code=message["status"], content=body_stream(), info=info) response.raw_headers = message["headers"] return response > send_stream, recv_stream = anyio.create_memory_object_stream[Message]() E TypeError: 'function' object is not subscriptable starlette/middleware/base.py:175: TypeError ________ test_contextvars[trio-CustomMiddlewareUsingBaseHTTPMiddleware] ________ test_client_factory = functools.partial(, backend='trio', backend_options={}) middleware_cls = @pytest.mark.parametrize( "middleware_cls", [ CustomMiddlewareWithoutBaseHTTPMiddleware, pytest.param( CustomMiddlewareUsingBaseHTTPMiddleware, marks=pytest.mark.xfail( reason=( "BaseHTTPMiddleware creates a TaskGroup which copies the context" "and erases any changes to it made within the TaskGroup" ), raises=AssertionError, ), ), ], ) def test_contextvars( test_client_factory: TestClientFactory, middleware_cls: _MiddlewareFactory[Any], ) -> None: # this has to be an async endpoint because Starlette calls run_in_threadpool # on sync endpoints which has it's own set of peculiarities w.r.t propagating # contextvars (it propagates them forwards but not backwards) async def homepage(request: Request) -> PlainTextResponse: assert ctxvar.get() == "set by middleware" ctxvar.set("set by endpoint") return PlainTextResponse("Homepage") app = Starlette(middleware=[Middleware(middleware_cls)], routes=[Route("/", homepage)]) client = test_client_factory(app) > response = client.get("/") tests/middleware/test_base.py:249: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:456: in get return super().get( /usr/lib/python3.13/site-packages/httpx/_client.py:1066: in get return self.request( starlette/testclient.py:428: in request return super().request( /usr/lib/python3.13/site-packages/httpx/_client.py:837: in request return self.send(request, auth=auth, follow_redirects=follow_redirects) /usr/lib/python3.13/site-packages/httpx/_client.py:926: in send response = self._send_handling_auth( /usr/lib/python3.13/site-packages/httpx/_client.py:954: in _send_handling_auth response = self._send_handling_redirects( /usr/lib/python3.13/site-packages/httpx/_client.py:991: in _send_handling_redirects response = self._send_single_request(request) /usr/lib/python3.13/site-packages/httpx/_client.py:1027: in _send_single_request response = transport.handle_request(request) starlette/testclient.py:337: in handle_request raise exc starlette/testclient.py:334: in handle_request portal.call(self.app, scope, receive, send) /usr/lib/python3.13/site-packages/anyio/from_thread.py:277: in call return cast(T_Retval, self.start_task_soon(func, *args).result()) /usr/lib64/python3.13/concurrent/futures/_base.py:449: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval starlette/applications.py:112: in __call__ await self.middleware_stack(scope, receive, send) starlette/middleware/errors.py:187: in __call__ raise exc starlette/middleware/errors.py:165: in __call__ await self.app(scope, receive, _send) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = scope = {'app': , 'client': ('testclient', 50000), 'extensions': {'... b'*/*'), (b'accept-encoding', b'gzip, deflate'), (b'connection', b'keep-alive'), (b'user-agent', b'testclient')], ...} receive = .receive at 0x7f8701f9c360> send = ._send at 0x7f8701f9ee80> async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None: if scope["type"] != "http": await self.app(scope, receive, send) return request = _CachedRequest(scope, receive) wrapped_receive = request.wrapped_receive response_sent = anyio.Event() async def call_next(request: Request) -> Response: app_exc: Exception | None = None async def receive_or_disconnect() -> Message: if response_sent.is_set(): return {"type": "http.disconnect"} async with anyio.create_task_group() as task_group: async def wrap(func: typing.Callable[[], typing.Awaitable[T]]) -> T: result = await func() task_group.cancel_scope.cancel() return result task_group.start_soon(wrap, response_sent.wait) message = await wrap(wrapped_receive) if response_sent.is_set(): return {"type": "http.disconnect"} return message async def send_no_error(message: Message) -> None: try: await send_stream.send(message) except anyio.BrokenResourceError: # recv_stream has been closed, i.e. response_sent has been set. return async def coro() -> None: nonlocal app_exc with send_stream: try: await self.app(scope, receive_or_disconnect, send_no_error) except Exception as exc: app_exc = exc task_group.start_soon(coro) try: message = await recv_stream.receive() info = message.get("info", None) if message["type"] == "http.response.debug" and info is not None: message = await recv_stream.receive() except anyio.EndOfStream: if app_exc is not None: raise app_exc raise RuntimeError("No response returned.") assert message["type"] == "http.response.start" async def body_stream() -> typing.AsyncGenerator[bytes, None]: async for message in recv_stream: assert message["type"] == "http.response.body" body = message.get("body", b"") if body: yield body if not message.get("more_body", False): break if app_exc is not None: raise app_exc response = _StreamingResponse(status_code=message["status"], content=body_stream(), info=info) response.raw_headers = message["headers"] return response > send_stream, recv_stream = anyio.create_memory_object_stream[Message]() E TypeError: 'function' object is not subscriptable starlette/middleware/base.py:175: TypeError ________ test_run_background_tasks_even_if_client_disconnects[asyncio] _________ @pytest.mark.anyio async def test_run_background_tasks_even_if_client_disconnects() -> None: # test for https://github.com/encode/starlette/issues/1438 response_complete = anyio.Event() background_task_run = anyio.Event() async def sleep_and_set() -> None: # small delay to give BaseHTTPMiddleware a chance to cancel us # this is required to make the test fail prior to fixing the issue # so do not be surprised if you remove it and the test still passes await anyio.sleep(0.1) background_task_run.set() async def endpoint_with_background_task(_: Request) -> PlainTextResponse: return PlainTextResponse(background=BackgroundTask(sleep_and_set)) async def passthrough( request: Request, call_next: RequestResponseEndpoint, ) -> Response: return await call_next(request) app = Starlette( middleware=[Middleware(BaseHTTPMiddleware, dispatch=passthrough)], routes=[Route("/", endpoint_with_background_task)], ) scope = { "type": "http", "version": "3", "method": "GET", "path": "/", } async def receive() -> Message: raise NotImplementedError("Should not be called!") async def send(message: Message) -> None: if message["type"] == "http.response.body": if not message.get("more_body", False): # pragma: no branch response_complete.set() > await app(scope, receive, send) tests/middleware/test_base.py:295: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/applications.py:112: in __call__ await self.middleware_stack(scope, receive, send) starlette/middleware/errors.py:187: in __call__ raise exc starlette/middleware/errors.py:165: in __call__ await self.app(scope, receive, _send) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = scope = {'app': , 'method': 'GET', 'path': '/', 'type': 'http', ...} receive = .receive at 0x7f8701fdfe20> send = ._send at 0x7f8701fdfba0> async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None: if scope["type"] != "http": await self.app(scope, receive, send) return request = _CachedRequest(scope, receive) wrapped_receive = request.wrapped_receive response_sent = anyio.Event() async def call_next(request: Request) -> Response: app_exc: Exception | None = None async def receive_or_disconnect() -> Message: if response_sent.is_set(): return {"type": "http.disconnect"} async with anyio.create_task_group() as task_group: async def wrap(func: typing.Callable[[], typing.Awaitable[T]]) -> T: result = await func() task_group.cancel_scope.cancel() return result task_group.start_soon(wrap, response_sent.wait) message = await wrap(wrapped_receive) if response_sent.is_set(): return {"type": "http.disconnect"} return message async def send_no_error(message: Message) -> None: try: await send_stream.send(message) except anyio.BrokenResourceError: # recv_stream has been closed, i.e. response_sent has been set. return async def coro() -> None: nonlocal app_exc with send_stream: try: await self.app(scope, receive_or_disconnect, send_no_error) except Exception as exc: app_exc = exc task_group.start_soon(coro) try: message = await recv_stream.receive() info = message.get("info", None) if message["type"] == "http.response.debug" and info is not None: message = await recv_stream.receive() except anyio.EndOfStream: if app_exc is not None: raise app_exc raise RuntimeError("No response returned.") assert message["type"] == "http.response.start" async def body_stream() -> typing.AsyncGenerator[bytes, None]: async for message in recv_stream: assert message["type"] == "http.response.body" body = message.get("body", b"") if body: yield body if not message.get("more_body", False): break if app_exc is not None: raise app_exc response = _StreamingResponse(status_code=message["status"], content=body_stream(), info=info) response.raw_headers = message["headers"] return response > send_stream, recv_stream = anyio.create_memory_object_stream[Message]() E TypeError: 'function' object is not subscriptable starlette/middleware/base.py:175: TypeError __________ test_run_background_tasks_even_if_client_disconnects[trio] __________ @pytest.mark.anyio async def test_run_background_tasks_even_if_client_disconnects() -> None: # test for https://github.com/encode/starlette/issues/1438 response_complete = anyio.Event() background_task_run = anyio.Event() async def sleep_and_set() -> None: # small delay to give BaseHTTPMiddleware a chance to cancel us # this is required to make the test fail prior to fixing the issue # so do not be surprised if you remove it and the test still passes await anyio.sleep(0.1) background_task_run.set() async def endpoint_with_background_task(_: Request) -> PlainTextResponse: return PlainTextResponse(background=BackgroundTask(sleep_and_set)) async def passthrough( request: Request, call_next: RequestResponseEndpoint, ) -> Response: return await call_next(request) app = Starlette( middleware=[Middleware(BaseHTTPMiddleware, dispatch=passthrough)], routes=[Route("/", endpoint_with_background_task)], ) scope = { "type": "http", "version": "3", "method": "GET", "path": "/", } async def receive() -> Message: raise NotImplementedError("Should not be called!") async def send(message: Message) -> None: if message["type"] == "http.response.body": if not message.get("more_body", False): # pragma: no branch response_complete.set() > await app(scope, receive, send) tests/middleware/test_base.py:295: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/applications.py:112: in __call__ await self.middleware_stack(scope, receive, send) starlette/middleware/errors.py:187: in __call__ raise exc starlette/middleware/errors.py:165: in __call__ await self.app(scope, receive, _send) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = scope = {'app': , 'method': 'GET', 'path': '/', 'type': 'http', ...} receive = .receive at 0x7f8701fde2a0> send = ._send at 0x7f8701fde020> async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None: if scope["type"] != "http": await self.app(scope, receive, send) return request = _CachedRequest(scope, receive) wrapped_receive = request.wrapped_receive response_sent = anyio.Event() async def call_next(request: Request) -> Response: app_exc: Exception | None = None async def receive_or_disconnect() -> Message: if response_sent.is_set(): return {"type": "http.disconnect"} async with anyio.create_task_group() as task_group: async def wrap(func: typing.Callable[[], typing.Awaitable[T]]) -> T: result = await func() task_group.cancel_scope.cancel() return result task_group.start_soon(wrap, response_sent.wait) message = await wrap(wrapped_receive) if response_sent.is_set(): return {"type": "http.disconnect"} return message async def send_no_error(message: Message) -> None: try: await send_stream.send(message) except anyio.BrokenResourceError: # recv_stream has been closed, i.e. response_sent has been set. return async def coro() -> None: nonlocal app_exc with send_stream: try: await self.app(scope, receive_or_disconnect, send_no_error) except Exception as exc: app_exc = exc task_group.start_soon(coro) try: message = await recv_stream.receive() info = message.get("info", None) if message["type"] == "http.response.debug" and info is not None: message = await recv_stream.receive() except anyio.EndOfStream: if app_exc is not None: raise app_exc raise RuntimeError("No response returned.") assert message["type"] == "http.response.start" async def body_stream() -> typing.AsyncGenerator[bytes, None]: async for message in recv_stream: assert message["type"] == "http.response.body" body = message.get("body", b"") if body: yield body if not message.get("more_body", False): break if app_exc is not None: raise app_exc response = _StreamingResponse(status_code=message["status"], content=body_stream(), info=info) response.raw_headers = message["headers"] return response > send_stream, recv_stream = anyio.create_memory_object_stream[Message]() E TypeError: 'function' object is not subscriptable starlette/middleware/base.py:175: TypeError ________________ test_do_not_block_on_background_tasks[asyncio] ________________ @pytest.mark.anyio async def test_do_not_block_on_background_tasks() -> None: response_complete = anyio.Event() events: list[str | Message] = [] async def sleep_and_set() -> None: events.append("Background task started") await anyio.sleep(0.1) events.append("Background task finished") async def endpoint_with_background_task(_: Request) -> PlainTextResponse: return PlainTextResponse(content="Hello", background=BackgroundTask(sleep_and_set)) async def passthrough(request: Request, call_next: RequestResponseEndpoint) -> Response: return await call_next(request) app = Starlette( middleware=[Middleware(BaseHTTPMiddleware, dispatch=passthrough)], routes=[Route("/", endpoint_with_background_task)], ) scope = { "type": "http", "version": "3", "method": "GET", "path": "/", } async def receive() -> Message: raise NotImplementedError("Should not be called!") async def send(message: Message) -> None: if message["type"] == "http.response.body": events.append(message) if not message.get("more_body", False): response_complete.set() > async with anyio.create_task_group() as tg: tests/middleware/test_base.py:337: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = exc_type = None, exc_val = None, exc_tb = None async def __aexit__( self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None, ) -> bool | None: ignore_exception = self.cancel_scope.__exit__(exc_type, exc_val, exc_tb) if exc_val is not None: self.cancel_scope.cancel() self._exceptions.append(exc_val) while self.cancel_scope._tasks: try: await asyncio.wait(self.cancel_scope._tasks) except asyncio.CancelledError: self.cancel_scope.cancel() self._active = False if not self.cancel_scope._parent_cancelled(): exceptions = self._filter_cancellation_errors(self._exceptions) else: exceptions = self._exceptions try: if len(exceptions) > 1: if all( isinstance(e, CancelledError) and not e.args for e in exceptions ): # Tasks were cancelled natively, without a cancellation message raise CancelledError else: > raise ExceptionGroup(exceptions) E anyio._backends._asyncio.ExceptionGroup: 2 exceptions were raised in the task group: E ---------------------------- E Traceback (most recent call last): E File "/builddir/build/BUILD/python-starlette-0.45.1-build/python-starlette-0.45.1/starlette/applications.py", line 112, in __call__ E await self.middleware_stack(scope, receive, send) E File "/builddir/build/BUILD/python-starlette-0.45.1-build/python-starlette-0.45.1/starlette/middleware/errors.py", line 187, in __call__ E raise exc E File "/builddir/build/BUILD/python-starlette-0.45.1-build/python-starlette-0.45.1/starlette/middleware/errors.py", line 165, in __call__ E await self.app(scope, receive, _send) E File "/builddir/build/BUILD/python-starlette-0.45.1-build/python-starlette-0.45.1/starlette/middleware/base.py", line 175, in __call__ E send_stream, recv_stream = anyio.create_memory_object_stream[Message]() E ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^ E TypeError: 'function' object is not subscriptable E ---------------------------- E Traceback (most recent call last): E File "/builddir/build/BUILD/python-starlette-0.45.1-build/python-starlette-0.45.1/starlette/applications.py", line 112, in __call__ E await self.middleware_stack(scope, receive, send) E File "/builddir/build/BUILD/python-starlette-0.45.1-build/python-starlette-0.45.1/starlette/middleware/errors.py", line 187, in __call__ E raise exc E File "/builddir/build/BUILD/python-starlette-0.45.1-build/python-starlette-0.45.1/starlette/middleware/errors.py", line 165, in __call__ E await self.app(scope, receive, _send) E File "/builddir/build/BUILD/python-starlette-0.45.1-build/python-starlette-0.45.1/starlette/middleware/base.py", line 175, in __call__ E send_stream, recv_stream = anyio.create_memory_object_stream[Message]() E ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^ E TypeError: 'function' object is not subscriptable /usr/lib/python3.13/site-packages/anyio/_backends/_asyncio.py:595: ExceptionGroup _________________ test_do_not_block_on_background_tasks[trio] __________________ + Exception Group Traceback (most recent call last): | File "/usr/lib/python3.13/site-packages/_pytest/runner.py", line 341, in from_call | result: TResult | None = func() | ~~~~^^ | File "/usr/lib/python3.13/site-packages/_pytest/runner.py", line 242, in | lambda: runtest_hook(item=item, **kwds), when=when, reraise=reraise | ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^ | File "/usr/lib/python3.13/site-packages/pluggy/_hooks.py", line 513, in __call__ | return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) | ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | File "/usr/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec | return self._inner_hookexec(hook_name, methods, kwargs, firstresult) | ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | File "/usr/lib/python3.13/site-packages/pluggy/_callers.py", line 139, in _multicall | raise exception.with_traceback(exception.__traceback__) | File "/usr/lib/python3.13/site-packages/pluggy/_callers.py", line 122, in _multicall | teardown.throw(exception) # type: ignore[union-attr] | ~~~~~~~~~~~~~~^^^^^^^^^^^ | File "/usr/lib/python3.13/site-packages/_pytest/threadexception.py", line 92, in pytest_runtest_call | yield from thread_exception_runtest_hook() | File "/usr/lib/python3.13/site-packages/_pytest/threadexception.py", line 68, in thread_exception_runtest_hook | yield | File "/usr/lib/python3.13/site-packages/pluggy/_callers.py", line 122, in _multicall | teardown.throw(exception) # type: ignore[union-attr] | ~~~~~~~~~~~~~~^^^^^^^^^^^ | File "/usr/lib/python3.13/site-packages/_pytest/unraisableexception.py", line 95, in pytest_runtest_call | yield from unraisable_exception_runtest_hook() | File "/usr/lib/python3.13/site-packages/_pytest/unraisableexception.py", line 70, in unraisable_exception_runtest_hook | yield | File "/usr/lib/python3.13/site-packages/pluggy/_callers.py", line 122, in _multicall | teardown.throw(exception) # type: ignore[union-attr] | ~~~~~~~~~~~~~~^^^^^^^^^^^ | File "/usr/lib/python3.13/site-packages/_pytest/logging.py", line 846, in pytest_runtest_call | yield from self._runtest_for(item, "call") | File "/usr/lib/python3.13/site-packages/_pytest/logging.py", line 829, in _runtest_for | yield | File "/usr/lib/python3.13/site-packages/pluggy/_callers.py", line 122, in _multicall | teardown.throw(exception) # type: ignore[union-attr] | ~~~~~~~~~~~~~~^^^^^^^^^^^ | File "/usr/lib/python3.13/site-packages/_pytest/capture.py", line 880, in pytest_runtest_call | return (yield) | ^^^^^ | File "/usr/lib/python3.13/site-packages/pluggy/_callers.py", line 122, in _multicall | teardown.throw(exception) # type: ignore[union-attr] | ~~~~~~~~~~~~~~^^^^^^^^^^^ | File "/usr/lib/python3.13/site-packages/_pytest/skipping.py", line 257, in pytest_runtest_call | return (yield) | ^^^^^ | File "/usr/lib/python3.13/site-packages/pluggy/_callers.py", line 103, in _multicall | res = hook_impl.function(*args) | File "/usr/lib/python3.13/site-packages/_pytest/runner.py", line 174, in pytest_runtest_call | item.runtest() | ~~~~~~~~~~~~^^ | File "/usr/lib/python3.13/site-packages/_pytest/python.py", line 1627, in runtest | self.ihook.pytest_pyfunc_call(pyfuncitem=self) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^ | File "/usr/lib/python3.13/site-packages/pluggy/_hooks.py", line 513, in __call__ | return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) | ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | File "/usr/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec | return self._inner_hookexec(hook_name, methods, kwargs, firstresult) | ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | File "/usr/lib/python3.13/site-packages/pluggy/_callers.py", line 139, in _multicall | raise exception.with_traceback(exception.__traceback__) | File "/usr/lib/python3.13/site-packages/pluggy/_callers.py", line 103, in _multicall | res = hook_impl.function(*args) | File "/usr/lib/python3.13/site-packages/anyio/pytest_plugin.py", line 117, in pytest_pyfunc_call | runner.run_test(pyfuncitem.obj, testargs) | ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^ | File "/usr/lib/python3.13/site-packages/anyio/_backends/_trio.py", line 996, in run_test | self._call(test_func, **kwargs) | ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^ | File "/usr/lib/python3.13/site-packages/anyio/_backends/_trio.py", line 955, in _call | return outcome.unwrap() | ~~~~~~~~~~~~~~^^ | File "/usr/lib/python3.13/site-packages/outcome/_impl.py", line 138, in unwrap | raise captured_error | File "/usr/lib/python3.13/site-packages/anyio/_backends/_trio.py", line 925, in _call_func | retval = await func(*args, **kwargs) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | File "/builddir/build/BUILD/python-starlette-0.45.1-build/python-starlette-0.45.1/tests/middleware/test_base.py", line 337, in test_do_not_block_on_background_tasks | async with anyio.create_task_group() as tg: | ~~~~~~~~~~~~~~~~~~~~~~~^^ | File "/usr/lib/python3.13/site-packages/anyio/_backends/_trio.py", line 187, in __aexit__ | raise ExceptionGroup(exc.exceptions) from None | trio.NonBaseMultiError: TypeError("'function' object is not subscriptable"), TypeError("'function' object is not subscriptable") +-+---------------- 1 ---------------- | Traceback (most recent call last): | File "/builddir/build/BUILD/python-starlette-0.45.1-build/python-starlette-0.45.1/starlette/applications.py", line 112, in __call__ | await self.middleware_stack(scope, receive, send) | File "/builddir/build/BUILD/python-starlette-0.45.1-build/python-starlette-0.45.1/starlette/middleware/errors.py", line 187, in __call__ | raise exc | File "/builddir/build/BUILD/python-starlette-0.45.1-build/python-starlette-0.45.1/starlette/middleware/errors.py", line 165, in __call__ | await self.app(scope, receive, _send) | File "/builddir/build/BUILD/python-starlette-0.45.1-build/python-starlette-0.45.1/starlette/middleware/base.py", line 175, in __call__ | send_stream, recv_stream = anyio.create_memory_object_stream[Message]() | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^ | TypeError: 'function' object is not subscriptable +---------------- 2 ---------------- | Traceback (most recent call last): | File "/builddir/build/BUILD/python-starlette-0.45.1-build/python-starlette-0.45.1/starlette/applications.py", line 112, in __call__ | await self.middleware_stack(scope, receive, send) | File "/builddir/build/BUILD/python-starlette-0.45.1-build/python-starlette-0.45.1/starlette/middleware/errors.py", line 187, in __call__ | raise exc | File "/builddir/build/BUILD/python-starlette-0.45.1-build/python-starlette-0.45.1/starlette/middleware/errors.py", line 165, in __call__ | await self.app(scope, receive, _send) | File "/builddir/build/BUILD/python-starlette-0.45.1-build/python-starlette-0.45.1/starlette/middleware/base.py", line 175, in __call__ | send_stream, recv_stream = anyio.create_memory_object_stream[Message]() | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^ | TypeError: 'function' object is not subscriptable +------------------------------------ ______ test_run_context_manager_exit_even_if_client_disconnects[asyncio] _______ @pytest.mark.anyio async def test_run_context_manager_exit_even_if_client_disconnects() -> None: # test for https://github.com/encode/starlette/issues/1678#issuecomment-1172916042 response_complete = anyio.Event() context_manager_exited = anyio.Event() async def sleep_and_set() -> None: # small delay to give BaseHTTPMiddleware a chance to cancel us # this is required to make the test fail prior to fixing the issue # so do not be surprised if you remove it and the test still passes await anyio.sleep(0.1) context_manager_exited.set() class ContextManagerMiddleware: def __init__(self, app: ASGIApp): self.app = app async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None: async with AsyncExitStack() as stack: stack.push_async_callback(sleep_and_set) await self.app(scope, receive, send) async def simple_endpoint(_: Request) -> PlainTextResponse: return PlainTextResponse(background=BackgroundTask(sleep_and_set)) async def passthrough( request: Request, call_next: RequestResponseEndpoint, ) -> Response: return await call_next(request) app = Starlette( middleware=[ Middleware(BaseHTTPMiddleware, dispatch=passthrough), Middleware(ContextManagerMiddleware), ], routes=[Route("/", simple_endpoint)], ) scope = { "type": "http", "version": "3", "method": "GET", "path": "/", } async def receive() -> Message: raise NotImplementedError("Should not be called!") async def send(message: Message) -> None: if message["type"] == "http.response.body": if not message.get("more_body", False): # pragma: no branch response_complete.set() > await app(scope, receive, send) tests/middleware/test_base.py:409: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/applications.py:112: in __call__ await self.middleware_stack(scope, receive, send) starlette/middleware/errors.py:187: in __call__ raise exc starlette/middleware/errors.py:165: in __call__ await self.app(scope, receive, _send) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = scope = {'app': , 'method': 'GET', 'path': '/', 'type': 'http', ...} receive = .receive at 0x7f8701f9c860> send = ._send at 0x7f8701f9cb80> async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None: if scope["type"] != "http": await self.app(scope, receive, send) return request = _CachedRequest(scope, receive) wrapped_receive = request.wrapped_receive response_sent = anyio.Event() async def call_next(request: Request) -> Response: app_exc: Exception | None = None async def receive_or_disconnect() -> Message: if response_sent.is_set(): return {"type": "http.disconnect"} async with anyio.create_task_group() as task_group: async def wrap(func: typing.Callable[[], typing.Awaitable[T]]) -> T: result = await func() task_group.cancel_scope.cancel() return result task_group.start_soon(wrap, response_sent.wait) message = await wrap(wrapped_receive) if response_sent.is_set(): return {"type": "http.disconnect"} return message async def send_no_error(message: Message) -> None: try: await send_stream.send(message) except anyio.BrokenResourceError: # recv_stream has been closed, i.e. response_sent has been set. return async def coro() -> None: nonlocal app_exc with send_stream: try: await self.app(scope, receive_or_disconnect, send_no_error) except Exception as exc: app_exc = exc task_group.start_soon(coro) try: message = await recv_stream.receive() info = message.get("info", None) if message["type"] == "http.response.debug" and info is not None: message = await recv_stream.receive() except anyio.EndOfStream: if app_exc is not None: raise app_exc raise RuntimeError("No response returned.") assert message["type"] == "http.response.start" async def body_stream() -> typing.AsyncGenerator[bytes, None]: async for message in recv_stream: assert message["type"] == "http.response.body" body = message.get("body", b"") if body: yield body if not message.get("more_body", False): break if app_exc is not None: raise app_exc response = _StreamingResponse(status_code=message["status"], content=body_stream(), info=info) response.raw_headers = message["headers"] return response > send_stream, recv_stream = anyio.create_memory_object_stream[Message]() E TypeError: 'function' object is not subscriptable starlette/middleware/base.py:175: TypeError ________ test_run_context_manager_exit_even_if_client_disconnects[trio] ________ @pytest.mark.anyio async def test_run_context_manager_exit_even_if_client_disconnects() -> None: # test for https://github.com/encode/starlette/issues/1678#issuecomment-1172916042 response_complete = anyio.Event() context_manager_exited = anyio.Event() async def sleep_and_set() -> None: # small delay to give BaseHTTPMiddleware a chance to cancel us # this is required to make the test fail prior to fixing the issue # so do not be surprised if you remove it and the test still passes await anyio.sleep(0.1) context_manager_exited.set() class ContextManagerMiddleware: def __init__(self, app: ASGIApp): self.app = app async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None: async with AsyncExitStack() as stack: stack.push_async_callback(sleep_and_set) await self.app(scope, receive, send) async def simple_endpoint(_: Request) -> PlainTextResponse: return PlainTextResponse(background=BackgroundTask(sleep_and_set)) async def passthrough( request: Request, call_next: RequestResponseEndpoint, ) -> Response: return await call_next(request) app = Starlette( middleware=[ Middleware(BaseHTTPMiddleware, dispatch=passthrough), Middleware(ContextManagerMiddleware), ], routes=[Route("/", simple_endpoint)], ) scope = { "type": "http", "version": "3", "method": "GET", "path": "/", } async def receive() -> Message: raise NotImplementedError("Should not be called!") async def send(message: Message) -> None: if message["type"] == "http.response.body": if not message.get("more_body", False): # pragma: no branch response_complete.set() > await app(scope, receive, send) tests/middleware/test_base.py:409: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/applications.py:112: in __call__ await self.middleware_stack(scope, receive, send) starlette/middleware/errors.py:187: in __call__ raise exc starlette/middleware/errors.py:165: in __call__ await self.app(scope, receive, _send) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = scope = {'app': , 'method': 'GET', 'path': '/', 'type': 'http', ...} receive = .receive at 0x7f8701fdd260> send = ._send at 0x7f8701fdfa60> async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None: if scope["type"] != "http": await self.app(scope, receive, send) return request = _CachedRequest(scope, receive) wrapped_receive = request.wrapped_receive response_sent = anyio.Event() async def call_next(request: Request) -> Response: app_exc: Exception | None = None async def receive_or_disconnect() -> Message: if response_sent.is_set(): return {"type": "http.disconnect"} async with anyio.create_task_group() as task_group: async def wrap(func: typing.Callable[[], typing.Awaitable[T]]) -> T: result = await func() task_group.cancel_scope.cancel() return result task_group.start_soon(wrap, response_sent.wait) message = await wrap(wrapped_receive) if response_sent.is_set(): return {"type": "http.disconnect"} return message async def send_no_error(message: Message) -> None: try: await send_stream.send(message) except anyio.BrokenResourceError: # recv_stream has been closed, i.e. response_sent has been set. return async def coro() -> None: nonlocal app_exc with send_stream: try: await self.app(scope, receive_or_disconnect, send_no_error) except Exception as exc: app_exc = exc task_group.start_soon(coro) try: message = await recv_stream.receive() info = message.get("info", None) if message["type"] == "http.response.debug" and info is not None: message = await recv_stream.receive() except anyio.EndOfStream: if app_exc is not None: raise app_exc raise RuntimeError("No response returned.") assert message["type"] == "http.response.start" async def body_stream() -> typing.AsyncGenerator[bytes, None]: async for message in recv_stream: assert message["type"] == "http.response.body" body = message.get("body", b"") if body: yield body if not message.get("more_body", False): break if app_exc is not None: raise app_exc response = _StreamingResponse(status_code=message["status"], content=body_stream(), info=info) response.raw_headers = message["headers"] return response > send_stream, recv_stream = anyio.create_memory_object_stream[Message]() E TypeError: 'function' object is not subscriptable starlette/middleware/base.py:175: TypeError ____ test_app_receives_http_disconnect_while_sending_if_discarded[asyncio] _____ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) def test_app_receives_http_disconnect_while_sending_if_discarded( test_client_factory: TestClientFactory, ) -> None: class DiscardingMiddleware(BaseHTTPMiddleware): async def dispatch( self, request: Request, call_next: Any, ) -> PlainTextResponse: # As a matter of ordering, this test targets the case where the downstream # app response is discarded while it is sending a response body. # We need to wait for the downstream app to begin sending a response body # before sending the middleware response that will overwrite the downstream # response. downstream_app_response = await call_next(request) body_generator = downstream_app_response.body_iterator try: await body_generator.__anext__() finally: await body_generator.aclose() return PlainTextResponse("Custom") async def downstream_app( scope: Scope, receive: Receive, send: Send, ) -> None: await send( { "type": "http.response.start", "status": 200, "headers": [ (b"content-type", b"text/plain"), ], } ) async with anyio.create_task_group() as task_group: async def cancel_on_disconnect( *, task_status: TaskStatus[None] = anyio.TASK_STATUS_IGNORED, ) -> None: task_status.started() while True: message = await receive() if message["type"] == "http.disconnect": # pragma: no branch task_group.cancel_scope.cancel() break # Using start instead of start_soon to ensure that # cancel_on_disconnect is scheduled by the event loop # before we start returning the body await task_group.start(cancel_on_disconnect) # A timeout is set for 0.1 second in order to ensure that # we never deadlock the test run in an infinite loop with anyio.move_on_after(0.1): while True: await send( { "type": "http.response.body", "body": b"chunk ", "more_body": True, } ) pytest.fail("http.disconnect should have been received and canceled the scope") # pragma: no cover app = DiscardingMiddleware(downstream_app) client = test_client_factory(app) > response = client.get("/does_not_exist") tests/middleware/test_base.py:486: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:456: in get return super().get( /usr/lib/python3.13/site-packages/httpx/_client.py:1066: in get return self.request( starlette/testclient.py:428: in request return super().request( /usr/lib/python3.13/site-packages/httpx/_client.py:837: in request return self.send(request, auth=auth, follow_redirects=follow_redirects) /usr/lib/python3.13/site-packages/httpx/_client.py:926: in send response = self._send_handling_auth( /usr/lib/python3.13/site-packages/httpx/_client.py:954: in _send_handling_auth response = self._send_handling_redirects( /usr/lib/python3.13/site-packages/httpx/_client.py:991: in _send_handling_redirects response = self._send_single_request(request) /usr/lib/python3.13/site-packages/httpx/_client.py:1027: in _send_single_request response = transport.handle_request(request) starlette/testclient.py:337: in handle_request raise exc starlette/testclient.py:334: in handle_request portal.call(self.app, scope, receive, send) /usr/lib/python3.13/site-packages/anyio/from_thread.py:277: in call return cast(T_Retval, self.start_task_soon(func, *args).result()) /usr/lib64/python3.13/concurrent/futures/_base.py:456: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = .DiscardingMiddleware object at 0x7f870205dbe0> scope = {'client': ('testclient', 50000), 'extensions': {'http.response.debug': {}}, 'headers': [(b'host', b'testserver'), (b'...oding', b'gzip, deflate'), (b'connection', b'keep-alive'), (b'user-agent', b'testclient')], 'http_version': '1.1', ...} receive = .receive at 0x7f8701fde480> send = .send at 0x7f8701fdd620> async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None: if scope["type"] != "http": await self.app(scope, receive, send) return request = _CachedRequest(scope, receive) wrapped_receive = request.wrapped_receive response_sent = anyio.Event() async def call_next(request: Request) -> Response: app_exc: Exception | None = None async def receive_or_disconnect() -> Message: if response_sent.is_set(): return {"type": "http.disconnect"} async with anyio.create_task_group() as task_group: async def wrap(func: typing.Callable[[], typing.Awaitable[T]]) -> T: result = await func() task_group.cancel_scope.cancel() return result task_group.start_soon(wrap, response_sent.wait) message = await wrap(wrapped_receive) if response_sent.is_set(): return {"type": "http.disconnect"} return message async def send_no_error(message: Message) -> None: try: await send_stream.send(message) except anyio.BrokenResourceError: # recv_stream has been closed, i.e. response_sent has been set. return async def coro() -> None: nonlocal app_exc with send_stream: try: await self.app(scope, receive_or_disconnect, send_no_error) except Exception as exc: app_exc = exc task_group.start_soon(coro) try: message = await recv_stream.receive() info = message.get("info", None) if message["type"] == "http.response.debug" and info is not None: message = await recv_stream.receive() except anyio.EndOfStream: if app_exc is not None: raise app_exc raise RuntimeError("No response returned.") assert message["type"] == "http.response.start" async def body_stream() -> typing.AsyncGenerator[bytes, None]: async for message in recv_stream: assert message["type"] == "http.response.body" body = message.get("body", b"") if body: yield body if not message.get("more_body", False): break if app_exc is not None: raise app_exc response = _StreamingResponse(status_code=message["status"], content=body_stream(), info=info) response.raw_headers = message["headers"] return response > send_stream, recv_stream = anyio.create_memory_object_stream[Message]() E TypeError: 'function' object is not subscriptable starlette/middleware/base.py:175: TypeError ______ test_app_receives_http_disconnect_while_sending_if_discarded[trio] ______ test_client_factory = functools.partial(, backend='trio', backend_options={}) def test_app_receives_http_disconnect_while_sending_if_discarded( test_client_factory: TestClientFactory, ) -> None: class DiscardingMiddleware(BaseHTTPMiddleware): async def dispatch( self, request: Request, call_next: Any, ) -> PlainTextResponse: # As a matter of ordering, this test targets the case where the downstream # app response is discarded while it is sending a response body. # We need to wait for the downstream app to begin sending a response body # before sending the middleware response that will overwrite the downstream # response. downstream_app_response = await call_next(request) body_generator = downstream_app_response.body_iterator try: await body_generator.__anext__() finally: await body_generator.aclose() return PlainTextResponse("Custom") async def downstream_app( scope: Scope, receive: Receive, send: Send, ) -> None: await send( { "type": "http.response.start", "status": 200, "headers": [ (b"content-type", b"text/plain"), ], } ) async with anyio.create_task_group() as task_group: async def cancel_on_disconnect( *, task_status: TaskStatus[None] = anyio.TASK_STATUS_IGNORED, ) -> None: task_status.started() while True: message = await receive() if message["type"] == "http.disconnect": # pragma: no branch task_group.cancel_scope.cancel() break # Using start instead of start_soon to ensure that # cancel_on_disconnect is scheduled by the event loop # before we start returning the body await task_group.start(cancel_on_disconnect) # A timeout is set for 0.1 second in order to ensure that # we never deadlock the test run in an infinite loop with anyio.move_on_after(0.1): while True: await send( { "type": "http.response.body", "body": b"chunk ", "more_body": True, } ) pytest.fail("http.disconnect should have been received and canceled the scope") # pragma: no cover app = DiscardingMiddleware(downstream_app) client = test_client_factory(app) > response = client.get("/does_not_exist") tests/middleware/test_base.py:486: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:456: in get return super().get( /usr/lib/python3.13/site-packages/httpx/_client.py:1066: in get return self.request( starlette/testclient.py:428: in request return super().request( /usr/lib/python3.13/site-packages/httpx/_client.py:837: in request return self.send(request, auth=auth, follow_redirects=follow_redirects) /usr/lib/python3.13/site-packages/httpx/_client.py:926: in send response = self._send_handling_auth( /usr/lib/python3.13/site-packages/httpx/_client.py:954: in _send_handling_auth response = self._send_handling_redirects( /usr/lib/python3.13/site-packages/httpx/_client.py:991: in _send_handling_redirects response = self._send_single_request(request) /usr/lib/python3.13/site-packages/httpx/_client.py:1027: in _send_single_request response = transport.handle_request(request) starlette/testclient.py:337: in handle_request raise exc starlette/testclient.py:334: in handle_request portal.call(self.app, scope, receive, send) /usr/lib/python3.13/site-packages/anyio/from_thread.py:277: in call return cast(T_Retval, self.start_task_soon(func, *args).result()) /usr/lib64/python3.13/concurrent/futures/_base.py:449: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = .DiscardingMiddleware object at 0x7f870205d550> scope = {'client': ('testclient', 50000), 'extensions': {'http.response.debug': {}}, 'headers': [(b'host', b'testserver'), (b'...oding', b'gzip, deflate'), (b'connection', b'keep-alive'), (b'user-agent', b'testclient')], 'http_version': '1.1', ...} receive = .receive at 0x7f8701f9d3a0> send = .send at 0x7f8701f9cc20> async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None: if scope["type"] != "http": await self.app(scope, receive, send) return request = _CachedRequest(scope, receive) wrapped_receive = request.wrapped_receive response_sent = anyio.Event() async def call_next(request: Request) -> Response: app_exc: Exception | None = None async def receive_or_disconnect() -> Message: if response_sent.is_set(): return {"type": "http.disconnect"} async with anyio.create_task_group() as task_group: async def wrap(func: typing.Callable[[], typing.Awaitable[T]]) -> T: result = await func() task_group.cancel_scope.cancel() return result task_group.start_soon(wrap, response_sent.wait) message = await wrap(wrapped_receive) if response_sent.is_set(): return {"type": "http.disconnect"} return message async def send_no_error(message: Message) -> None: try: await send_stream.send(message) except anyio.BrokenResourceError: # recv_stream has been closed, i.e. response_sent has been set. return async def coro() -> None: nonlocal app_exc with send_stream: try: await self.app(scope, receive_or_disconnect, send_no_error) except Exception as exc: app_exc = exc task_group.start_soon(coro) try: message = await recv_stream.receive() info = message.get("info", None) if message["type"] == "http.response.debug" and info is not None: message = await recv_stream.receive() except anyio.EndOfStream: if app_exc is not None: raise app_exc raise RuntimeError("No response returned.") assert message["type"] == "http.response.start" async def body_stream() -> typing.AsyncGenerator[bytes, None]: async for message in recv_stream: assert message["type"] == "http.response.body" body = message.get("body", b"") if body: yield body if not message.get("more_body", False): break if app_exc is not None: raise app_exc response = _StreamingResponse(status_code=message["status"], content=body_stream(), info=info) response.raw_headers = message["headers"] return response > send_stream, recv_stream = anyio.create_memory_object_stream[Message]() E TypeError: 'function' object is not subscriptable starlette/middleware/base.py:175: TypeError ____ test_app_receives_http_disconnect_after_sending_if_discarded[asyncio] _____ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) def test_app_receives_http_disconnect_after_sending_if_discarded( test_client_factory: TestClientFactory, ) -> None: class DiscardingMiddleware(BaseHTTPMiddleware): async def dispatch( self, request: Request, call_next: RequestResponseEndpoint, ) -> PlainTextResponse: await call_next(request) return PlainTextResponse("Custom") async def downstream_app( scope: Scope, receive: Receive, send: Send, ) -> None: await send( { "type": "http.response.start", "status": 200, "headers": [ (b"content-type", b"text/plain"), ], } ) await send( { "type": "http.response.body", "body": b"first chunk, ", "more_body": True, } ) await send( { "type": "http.response.body", "body": b"second chunk", "more_body": True, } ) message = await receive() assert message["type"] == "http.disconnect" app = DiscardingMiddleware(downstream_app) client = test_client_factory(app) > response = client.get("/does_not_exist") tests/middleware/test_base.py:536: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:456: in get return super().get( /usr/lib/python3.13/site-packages/httpx/_client.py:1066: in get return self.request( starlette/testclient.py:428: in request return super().request( /usr/lib/python3.13/site-packages/httpx/_client.py:837: in request return self.send(request, auth=auth, follow_redirects=follow_redirects) /usr/lib/python3.13/site-packages/httpx/_client.py:926: in send response = self._send_handling_auth( /usr/lib/python3.13/site-packages/httpx/_client.py:954: in _send_handling_auth response = self._send_handling_redirects( /usr/lib/python3.13/site-packages/httpx/_client.py:991: in _send_handling_redirects response = self._send_single_request(request) /usr/lib/python3.13/site-packages/httpx/_client.py:1027: in _send_single_request response = transport.handle_request(request) starlette/testclient.py:337: in handle_request raise exc starlette/testclient.py:334: in handle_request portal.call(self.app, scope, receive, send) /usr/lib/python3.13/site-packages/anyio/from_thread.py:277: in call return cast(T_Retval, self.start_task_soon(func, *args).result()) /usr/lib64/python3.13/concurrent/futures/_base.py:456: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = .DiscardingMiddleware object at 0x7f87027e6510> scope = {'client': ('testclient', 50000), 'extensions': {'http.response.debug': {}}, 'headers': [(b'host', b'testserver'), (b'...oding', b'gzip, deflate'), (b'connection', b'keep-alive'), (b'user-agent', b'testclient')], 'http_version': '1.1', ...} receive = .receive at 0x7f8701fde160> send = .send at 0x7f8701fdf420> async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None: if scope["type"] != "http": await self.app(scope, receive, send) return request = _CachedRequest(scope, receive) wrapped_receive = request.wrapped_receive response_sent = anyio.Event() async def call_next(request: Request) -> Response: app_exc: Exception | None = None async def receive_or_disconnect() -> Message: if response_sent.is_set(): return {"type": "http.disconnect"} async with anyio.create_task_group() as task_group: async def wrap(func: typing.Callable[[], typing.Awaitable[T]]) -> T: result = await func() task_group.cancel_scope.cancel() return result task_group.start_soon(wrap, response_sent.wait) message = await wrap(wrapped_receive) if response_sent.is_set(): return {"type": "http.disconnect"} return message async def send_no_error(message: Message) -> None: try: await send_stream.send(message) except anyio.BrokenResourceError: # recv_stream has been closed, i.e. response_sent has been set. return async def coro() -> None: nonlocal app_exc with send_stream: try: await self.app(scope, receive_or_disconnect, send_no_error) except Exception as exc: app_exc = exc task_group.start_soon(coro) try: message = await recv_stream.receive() info = message.get("info", None) if message["type"] == "http.response.debug" and info is not None: message = await recv_stream.receive() except anyio.EndOfStream: if app_exc is not None: raise app_exc raise RuntimeError("No response returned.") assert message["type"] == "http.response.start" async def body_stream() -> typing.AsyncGenerator[bytes, None]: async for message in recv_stream: assert message["type"] == "http.response.body" body = message.get("body", b"") if body: yield body if not message.get("more_body", False): break if app_exc is not None: raise app_exc response = _StreamingResponse(status_code=message["status"], content=body_stream(), info=info) response.raw_headers = message["headers"] return response > send_stream, recv_stream = anyio.create_memory_object_stream[Message]() E TypeError: 'function' object is not subscriptable starlette/middleware/base.py:175: TypeError ______ test_app_receives_http_disconnect_after_sending_if_discarded[trio] ______ test_client_factory = functools.partial(, backend='trio', backend_options={}) def test_app_receives_http_disconnect_after_sending_if_discarded( test_client_factory: TestClientFactory, ) -> None: class DiscardingMiddleware(BaseHTTPMiddleware): async def dispatch( self, request: Request, call_next: RequestResponseEndpoint, ) -> PlainTextResponse: await call_next(request) return PlainTextResponse("Custom") async def downstream_app( scope: Scope, receive: Receive, send: Send, ) -> None: await send( { "type": "http.response.start", "status": 200, "headers": [ (b"content-type", b"text/plain"), ], } ) await send( { "type": "http.response.body", "body": b"first chunk, ", "more_body": True, } ) await send( { "type": "http.response.body", "body": b"second chunk", "more_body": True, } ) message = await receive() assert message["type"] == "http.disconnect" app = DiscardingMiddleware(downstream_app) client = test_client_factory(app) > response = client.get("/does_not_exist") tests/middleware/test_base.py:536: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:456: in get return super().get( /usr/lib/python3.13/site-packages/httpx/_client.py:1066: in get return self.request( starlette/testclient.py:428: in request return super().request( /usr/lib/python3.13/site-packages/httpx/_client.py:837: in request return self.send(request, auth=auth, follow_redirects=follow_redirects) /usr/lib/python3.13/site-packages/httpx/_client.py:926: in send response = self._send_handling_auth( /usr/lib/python3.13/site-packages/httpx/_client.py:954: in _send_handling_auth response = self._send_handling_redirects( /usr/lib/python3.13/site-packages/httpx/_client.py:991: in _send_handling_redirects response = self._send_single_request(request) /usr/lib/python3.13/site-packages/httpx/_client.py:1027: in _send_single_request response = transport.handle_request(request) starlette/testclient.py:337: in handle_request raise exc starlette/testclient.py:334: in handle_request portal.call(self.app, scope, receive, send) /usr/lib/python3.13/site-packages/anyio/from_thread.py:277: in call return cast(T_Retval, self.start_task_soon(func, *args).result()) /usr/lib64/python3.13/concurrent/futures/_base.py:449: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = .DiscardingMiddleware object at 0x7f870205e900> scope = {'client': ('testclient', 50000), 'extensions': {'http.response.debug': {}}, 'headers': [(b'host', b'testserver'), (b'...oding', b'gzip, deflate'), (b'connection', b'keep-alive'), (b'user-agent', b'testclient')], 'http_version': '1.1', ...} receive = .receive at 0x7f8701fdff60> send = .send at 0x7f8701fde340> async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None: if scope["type"] != "http": await self.app(scope, receive, send) return request = _CachedRequest(scope, receive) wrapped_receive = request.wrapped_receive response_sent = anyio.Event() async def call_next(request: Request) -> Response: app_exc: Exception | None = None async def receive_or_disconnect() -> Message: if response_sent.is_set(): return {"type": "http.disconnect"} async with anyio.create_task_group() as task_group: async def wrap(func: typing.Callable[[], typing.Awaitable[T]]) -> T: result = await func() task_group.cancel_scope.cancel() return result task_group.start_soon(wrap, response_sent.wait) message = await wrap(wrapped_receive) if response_sent.is_set(): return {"type": "http.disconnect"} return message async def send_no_error(message: Message) -> None: try: await send_stream.send(message) except anyio.BrokenResourceError: # recv_stream has been closed, i.e. response_sent has been set. return async def coro() -> None: nonlocal app_exc with send_stream: try: await self.app(scope, receive_or_disconnect, send_no_error) except Exception as exc: app_exc = exc task_group.start_soon(coro) try: message = await recv_stream.receive() info = message.get("info", None) if message["type"] == "http.response.debug" and info is not None: message = await recv_stream.receive() except anyio.EndOfStream: if app_exc is not None: raise app_exc raise RuntimeError("No response returned.") assert message["type"] == "http.response.start" async def body_stream() -> typing.AsyncGenerator[bytes, None]: async for message in recv_stream: assert message["type"] == "http.response.body" body = message.get("body", b"") if body: yield body if not message.get("more_body", False): break if app_exc is not None: raise app_exc response = _StreamingResponse(status_code=message["status"], content=body_stream(), info=info) response.raw_headers = message["headers"] return response > send_stream, recv_stream = anyio.create_memory_object_stream[Message]() E TypeError: 'function' object is not subscriptable starlette/middleware/base.py:175: TypeError ____ test_read_request_stream_in_app_after_middleware_calls_stream[asyncio] ____ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) def test_read_request_stream_in_app_after_middleware_calls_stream( test_client_factory: TestClientFactory, ) -> None: async def homepage(request: Request) -> PlainTextResponse: expected = [b""] async for chunk in request.stream(): assert chunk == expected.pop(0) assert expected == [] return PlainTextResponse("Homepage") class ConsumingMiddleware(BaseHTTPMiddleware): async def dispatch( self, request: Request, call_next: RequestResponseEndpoint, ) -> Response: expected = [b"a", b""] async for chunk in request.stream(): assert chunk == expected.pop(0) assert expected == [] return await call_next(request) app = Starlette( routes=[Route("/", homepage, methods=["POST"])], middleware=[Middleware(ConsumingMiddleware)], ) client: TestClient = test_client_factory(app) > response = client.post("/", content=b"a") tests/middleware/test_base.py:568: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:529: in post return super().post( /usr/lib/python3.13/site-packages/httpx/_client.py:1157: in post return self.request( starlette/testclient.py:428: in request return super().request( /usr/lib/python3.13/site-packages/httpx/_client.py:837: in request return self.send(request, auth=auth, follow_redirects=follow_redirects) /usr/lib/python3.13/site-packages/httpx/_client.py:926: in send response = self._send_handling_auth( /usr/lib/python3.13/site-packages/httpx/_client.py:954: in _send_handling_auth response = self._send_handling_redirects( /usr/lib/python3.13/site-packages/httpx/_client.py:991: in _send_handling_redirects response = self._send_single_request(request) /usr/lib/python3.13/site-packages/httpx/_client.py:1027: in _send_single_request response = transport.handle_request(request) starlette/testclient.py:337: in handle_request raise exc starlette/testclient.py:334: in handle_request portal.call(self.app, scope, receive, send) /usr/lib/python3.13/site-packages/anyio/from_thread.py:277: in call return cast(T_Retval, self.start_task_soon(func, *args).result()) /usr/lib64/python3.13/concurrent/futures/_base.py:456: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval starlette/applications.py:112: in __call__ await self.middleware_stack(scope, receive, send) starlette/middleware/errors.py:187: in __call__ raise exc starlette/middleware/errors.py:165: in __call__ await self.app(scope, receive, _send) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = .ConsumingMiddleware object at 0x7f87027e6510> scope = {'app': , 'client': ('testclient', 50000), 'extensions': {'...g', b'gzip, deflate'), (b'connection', b'keep-alive'), (b'user-agent', b'testclient'), (b'content-length', b'1')], ...} receive = .receive at 0x7f8701fde8e0> send = ._send at 0x7f8701f9ea20> async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None: if scope["type"] != "http": await self.app(scope, receive, send) return request = _CachedRequest(scope, receive) wrapped_receive = request.wrapped_receive response_sent = anyio.Event() async def call_next(request: Request) -> Response: app_exc: Exception | None = None async def receive_or_disconnect() -> Message: if response_sent.is_set(): return {"type": "http.disconnect"} async with anyio.create_task_group() as task_group: async def wrap(func: typing.Callable[[], typing.Awaitable[T]]) -> T: result = await func() task_group.cancel_scope.cancel() return result task_group.start_soon(wrap, response_sent.wait) message = await wrap(wrapped_receive) if response_sent.is_set(): return {"type": "http.disconnect"} return message async def send_no_error(message: Message) -> None: try: await send_stream.send(message) except anyio.BrokenResourceError: # recv_stream has been closed, i.e. response_sent has been set. return async def coro() -> None: nonlocal app_exc with send_stream: try: await self.app(scope, receive_or_disconnect, send_no_error) except Exception as exc: app_exc = exc task_group.start_soon(coro) try: message = await recv_stream.receive() info = message.get("info", None) if message["type"] == "http.response.debug" and info is not None: message = await recv_stream.receive() except anyio.EndOfStream: if app_exc is not None: raise app_exc raise RuntimeError("No response returned.") assert message["type"] == "http.response.start" async def body_stream() -> typing.AsyncGenerator[bytes, None]: async for message in recv_stream: assert message["type"] == "http.response.body" body = message.get("body", b"") if body: yield body if not message.get("more_body", False): break if app_exc is not None: raise app_exc response = _StreamingResponse(status_code=message["status"], content=body_stream(), info=info) response.raw_headers = message["headers"] return response > send_stream, recv_stream = anyio.create_memory_object_stream[Message]() E TypeError: 'function' object is not subscriptable starlette/middleware/base.py:175: TypeError _____ test_read_request_stream_in_app_after_middleware_calls_stream[trio] ______ test_client_factory = functools.partial(, backend='trio', backend_options={}) def test_read_request_stream_in_app_after_middleware_calls_stream( test_client_factory: TestClientFactory, ) -> None: async def homepage(request: Request) -> PlainTextResponse: expected = [b""] async for chunk in request.stream(): assert chunk == expected.pop(0) assert expected == [] return PlainTextResponse("Homepage") class ConsumingMiddleware(BaseHTTPMiddleware): async def dispatch( self, request: Request, call_next: RequestResponseEndpoint, ) -> Response: expected = [b"a", b""] async for chunk in request.stream(): assert chunk == expected.pop(0) assert expected == [] return await call_next(request) app = Starlette( routes=[Route("/", homepage, methods=["POST"])], middleware=[Middleware(ConsumingMiddleware)], ) client: TestClient = test_client_factory(app) > response = client.post("/", content=b"a") tests/middleware/test_base.py:568: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:529: in post return super().post( /usr/lib/python3.13/site-packages/httpx/_client.py:1157: in post return self.request( starlette/testclient.py:428: in request return super().request( /usr/lib/python3.13/site-packages/httpx/_client.py:837: in request return self.send(request, auth=auth, follow_redirects=follow_redirects) /usr/lib/python3.13/site-packages/httpx/_client.py:926: in send response = self._send_handling_auth( /usr/lib/python3.13/site-packages/httpx/_client.py:954: in _send_handling_auth response = self._send_handling_redirects( /usr/lib/python3.13/site-packages/httpx/_client.py:991: in _send_handling_redirects response = self._send_single_request(request) /usr/lib/python3.13/site-packages/httpx/_client.py:1027: in _send_single_request response = transport.handle_request(request) starlette/testclient.py:337: in handle_request raise exc starlette/testclient.py:334: in handle_request portal.call(self.app, scope, receive, send) /usr/lib/python3.13/site-packages/anyio/from_thread.py:277: in call return cast(T_Retval, self.start_task_soon(func, *args).result()) /usr/lib64/python3.13/concurrent/futures/_base.py:449: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval starlette/applications.py:112: in __call__ await self.middleware_stack(scope, receive, send) starlette/middleware/errors.py:187: in __call__ raise exc starlette/middleware/errors.py:165: in __call__ await self.app(scope, receive, _send) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = .ConsumingMiddleware object at 0x7f870205d6a0> scope = {'app': , 'client': ('testclient', 50000), 'extensions': {'...g', b'gzip, deflate'), (b'connection', b'keep-alive'), (b'user-agent', b'testclient'), (b'content-length', b'1')], ...} receive = .receive at 0x7f8701f9fb00> send = ._send at 0x7f8701cb8860> async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None: if scope["type"] != "http": await self.app(scope, receive, send) return request = _CachedRequest(scope, receive) wrapped_receive = request.wrapped_receive response_sent = anyio.Event() async def call_next(request: Request) -> Response: app_exc: Exception | None = None async def receive_or_disconnect() -> Message: if response_sent.is_set(): return {"type": "http.disconnect"} async with anyio.create_task_group() as task_group: async def wrap(func: typing.Callable[[], typing.Awaitable[T]]) -> T: result = await func() task_group.cancel_scope.cancel() return result task_group.start_soon(wrap, response_sent.wait) message = await wrap(wrapped_receive) if response_sent.is_set(): return {"type": "http.disconnect"} return message async def send_no_error(message: Message) -> None: try: await send_stream.send(message) except anyio.BrokenResourceError: # recv_stream has been closed, i.e. response_sent has been set. return async def coro() -> None: nonlocal app_exc with send_stream: try: await self.app(scope, receive_or_disconnect, send_no_error) except Exception as exc: app_exc = exc task_group.start_soon(coro) try: message = await recv_stream.receive() info = message.get("info", None) if message["type"] == "http.response.debug" and info is not None: message = await recv_stream.receive() except anyio.EndOfStream: if app_exc is not None: raise app_exc raise RuntimeError("No response returned.") assert message["type"] == "http.response.start" async def body_stream() -> typing.AsyncGenerator[bytes, None]: async for message in recv_stream: assert message["type"] == "http.response.body" body = message.get("body", b"") if body: yield body if not message.get("more_body", False): break if app_exc is not None: raise app_exc response = _StreamingResponse(status_code=message["status"], content=body_stream(), info=info) response.raw_headers = message["headers"] return response > send_stream, recv_stream = anyio.create_memory_object_stream[Message]() E TypeError: 'function' object is not subscriptable starlette/middleware/base.py:175: TypeError _____ test_read_request_stream_in_app_after_middleware_calls_body[asyncio] _____ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) def test_read_request_stream_in_app_after_middleware_calls_body( test_client_factory: TestClientFactory, ) -> None: async def homepage(request: Request) -> PlainTextResponse: expected = [b"a", b""] async for chunk in request.stream(): assert chunk == expected.pop(0) assert expected == [] return PlainTextResponse("Homepage") class ConsumingMiddleware(BaseHTTPMiddleware): async def dispatch( self, request: Request, call_next: RequestResponseEndpoint, ) -> Response: assert await request.body() == b"a" return await call_next(request) app = Starlette( routes=[Route("/", homepage, methods=["POST"])], middleware=[Middleware(ConsumingMiddleware)], ) client: TestClient = test_client_factory(app) > response = client.post("/", content=b"a") tests/middleware/test_base.py:597: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:529: in post return super().post( /usr/lib/python3.13/site-packages/httpx/_client.py:1157: in post return self.request( starlette/testclient.py:428: in request return super().request( /usr/lib/python3.13/site-packages/httpx/_client.py:837: in request return self.send(request, auth=auth, follow_redirects=follow_redirects) /usr/lib/python3.13/site-packages/httpx/_client.py:926: in send response = self._send_handling_auth( /usr/lib/python3.13/site-packages/httpx/_client.py:954: in _send_handling_auth response = self._send_handling_redirects( /usr/lib/python3.13/site-packages/httpx/_client.py:991: in _send_handling_redirects response = self._send_single_request(request) /usr/lib/python3.13/site-packages/httpx/_client.py:1027: in _send_single_request response = transport.handle_request(request) starlette/testclient.py:337: in handle_request raise exc starlette/testclient.py:334: in handle_request portal.call(self.app, scope, receive, send) /usr/lib/python3.13/site-packages/anyio/from_thread.py:277: in call return cast(T_Retval, self.start_task_soon(func, *args).result()) /usr/lib64/python3.13/concurrent/futures/_base.py:456: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval starlette/applications.py:112: in __call__ await self.middleware_stack(scope, receive, send) starlette/middleware/errors.py:187: in __call__ raise exc starlette/middleware/errors.py:165: in __call__ await self.app(scope, receive, _send) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = .ConsumingMiddleware object at 0x7f870205fe00> scope = {'app': , 'client': ('testclient', 50000), 'extensions': {'...g', b'gzip, deflate'), (b'connection', b'keep-alive'), (b'user-agent', b'testclient'), (b'content-length', b'1')], ...} receive = .receive at 0x7f8701cb8040> send = ._send at 0x7f8701cb93a0> async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None: if scope["type"] != "http": await self.app(scope, receive, send) return request = _CachedRequest(scope, receive) wrapped_receive = request.wrapped_receive response_sent = anyio.Event() async def call_next(request: Request) -> Response: app_exc: Exception | None = None async def receive_or_disconnect() -> Message: if response_sent.is_set(): return {"type": "http.disconnect"} async with anyio.create_task_group() as task_group: async def wrap(func: typing.Callable[[], typing.Awaitable[T]]) -> T: result = await func() task_group.cancel_scope.cancel() return result task_group.start_soon(wrap, response_sent.wait) message = await wrap(wrapped_receive) if response_sent.is_set(): return {"type": "http.disconnect"} return message async def send_no_error(message: Message) -> None: try: await send_stream.send(message) except anyio.BrokenResourceError: # recv_stream has been closed, i.e. response_sent has been set. return async def coro() -> None: nonlocal app_exc with send_stream: try: await self.app(scope, receive_or_disconnect, send_no_error) except Exception as exc: app_exc = exc task_group.start_soon(coro) try: message = await recv_stream.receive() info = message.get("info", None) if message["type"] == "http.response.debug" and info is not None: message = await recv_stream.receive() except anyio.EndOfStream: if app_exc is not None: raise app_exc raise RuntimeError("No response returned.") assert message["type"] == "http.response.start" async def body_stream() -> typing.AsyncGenerator[bytes, None]: async for message in recv_stream: assert message["type"] == "http.response.body" body = message.get("body", b"") if body: yield body if not message.get("more_body", False): break if app_exc is not None: raise app_exc response = _StreamingResponse(status_code=message["status"], content=body_stream(), info=info) response.raw_headers = message["headers"] return response > send_stream, recv_stream = anyio.create_memory_object_stream[Message]() E TypeError: 'function' object is not subscriptable starlette/middleware/base.py:175: TypeError ______ test_read_request_stream_in_app_after_middleware_calls_body[trio] _______ test_client_factory = functools.partial(, backend='trio', backend_options={}) def test_read_request_stream_in_app_after_middleware_calls_body( test_client_factory: TestClientFactory, ) -> None: async def homepage(request: Request) -> PlainTextResponse: expected = [b"a", b""] async for chunk in request.stream(): assert chunk == expected.pop(0) assert expected == [] return PlainTextResponse("Homepage") class ConsumingMiddleware(BaseHTTPMiddleware): async def dispatch( self, request: Request, call_next: RequestResponseEndpoint, ) -> Response: assert await request.body() == b"a" return await call_next(request) app = Starlette( routes=[Route("/", homepage, methods=["POST"])], middleware=[Middleware(ConsumingMiddleware)], ) client: TestClient = test_client_factory(app) > response = client.post("/", content=b"a") tests/middleware/test_base.py:597: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:529: in post return super().post( /usr/lib/python3.13/site-packages/httpx/_client.py:1157: in post return self.request( starlette/testclient.py:428: in request return super().request( /usr/lib/python3.13/site-packages/httpx/_client.py:837: in request return self.send(request, auth=auth, follow_redirects=follow_redirects) /usr/lib/python3.13/site-packages/httpx/_client.py:926: in send response = self._send_handling_auth( /usr/lib/python3.13/site-packages/httpx/_client.py:954: in _send_handling_auth response = self._send_handling_redirects( /usr/lib/python3.13/site-packages/httpx/_client.py:991: in _send_handling_redirects response = self._send_single_request(request) /usr/lib/python3.13/site-packages/httpx/_client.py:1027: in _send_single_request response = transport.handle_request(request) starlette/testclient.py:337: in handle_request raise exc starlette/testclient.py:334: in handle_request portal.call(self.app, scope, receive, send) /usr/lib/python3.13/site-packages/anyio/from_thread.py:277: in call return cast(T_Retval, self.start_task_soon(func, *args).result()) /usr/lib64/python3.13/concurrent/futures/_base.py:449: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval starlette/applications.py:112: in __call__ await self.middleware_stack(scope, receive, send) starlette/middleware/errors.py:187: in __call__ raise exc starlette/middleware/errors.py:165: in __call__ await self.app(scope, receive, _send) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = .ConsumingMiddleware object at 0x7f870205dbe0> scope = {'app': , 'client': ('testclient', 50000), 'extensions': {'...g', b'gzip, deflate'), (b'connection', b'keep-alive'), (b'user-agent', b'testclient'), (b'content-length', b'1')], ...} receive = .receive at 0x7f8701cba8e0> send = ._send at 0x7f8701cba0c0> async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None: if scope["type"] != "http": await self.app(scope, receive, send) return request = _CachedRequest(scope, receive) wrapped_receive = request.wrapped_receive response_sent = anyio.Event() async def call_next(request: Request) -> Response: app_exc: Exception | None = None async def receive_or_disconnect() -> Message: if response_sent.is_set(): return {"type": "http.disconnect"} async with anyio.create_task_group() as task_group: async def wrap(func: typing.Callable[[], typing.Awaitable[T]]) -> T: result = await func() task_group.cancel_scope.cancel() return result task_group.start_soon(wrap, response_sent.wait) message = await wrap(wrapped_receive) if response_sent.is_set(): return {"type": "http.disconnect"} return message async def send_no_error(message: Message) -> None: try: await send_stream.send(message) except anyio.BrokenResourceError: # recv_stream has been closed, i.e. response_sent has been set. return async def coro() -> None: nonlocal app_exc with send_stream: try: await self.app(scope, receive_or_disconnect, send_no_error) except Exception as exc: app_exc = exc task_group.start_soon(coro) try: message = await recv_stream.receive() info = message.get("info", None) if message["type"] == "http.response.debug" and info is not None: message = await recv_stream.receive() except anyio.EndOfStream: if app_exc is not None: raise app_exc raise RuntimeError("No response returned.") assert message["type"] == "http.response.start" async def body_stream() -> typing.AsyncGenerator[bytes, None]: async for message in recv_stream: assert message["type"] == "http.response.body" body = message.get("body", b"") if body: yield body if not message.get("more_body", False): break if app_exc is not None: raise app_exc response = _StreamingResponse(status_code=message["status"], content=body_stream(), info=info) response.raw_headers = message["headers"] return response > send_stream, recv_stream = anyio.create_memory_object_stream[Message]() E TypeError: 'function' object is not subscriptable starlette/middleware/base.py:175: TypeError _____ test_read_request_body_in_app_after_middleware_calls_stream[asyncio] _____ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) def test_read_request_body_in_app_after_middleware_calls_stream( test_client_factory: TestClientFactory, ) -> None: async def homepage(request: Request) -> PlainTextResponse: assert await request.body() == b"" return PlainTextResponse("Homepage") class ConsumingMiddleware(BaseHTTPMiddleware): async def dispatch( self, request: Request, call_next: RequestResponseEndpoint, ) -> Response: expected = [b"a", b""] async for chunk in request.stream(): assert chunk == expected.pop(0) assert expected == [] return await call_next(request) app = Starlette( routes=[Route("/", homepage, methods=["POST"])], middleware=[Middleware(ConsumingMiddleware)], ) client: TestClient = test_client_factory(app) > response = client.post("/", content=b"a") tests/middleware/test_base.py:626: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:529: in post return super().post( /usr/lib/python3.13/site-packages/httpx/_client.py:1157: in post return self.request( starlette/testclient.py:428: in request return super().request( /usr/lib/python3.13/site-packages/httpx/_client.py:837: in request return self.send(request, auth=auth, follow_redirects=follow_redirects) /usr/lib/python3.13/site-packages/httpx/_client.py:926: in send response = self._send_handling_auth( /usr/lib/python3.13/site-packages/httpx/_client.py:954: in _send_handling_auth response = self._send_handling_redirects( /usr/lib/python3.13/site-packages/httpx/_client.py:991: in _send_handling_redirects response = self._send_single_request(request) /usr/lib/python3.13/site-packages/httpx/_client.py:1027: in _send_single_request response = transport.handle_request(request) starlette/testclient.py:337: in handle_request raise exc starlette/testclient.py:334: in handle_request portal.call(self.app, scope, receive, send) /usr/lib/python3.13/site-packages/anyio/from_thread.py:277: in call return cast(T_Retval, self.start_task_soon(func, *args).result()) /usr/lib64/python3.13/concurrent/futures/_base.py:449: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval starlette/applications.py:112: in __call__ await self.middleware_stack(scope, receive, send) starlette/middleware/errors.py:187: in __call__ raise exc starlette/middleware/errors.py:165: in __call__ await self.app(scope, receive, _send) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = .ConsumingMiddleware object at 0x7f870205c590> scope = {'app': , 'client': ('testclient', 50000), 'extensions': {'...g', b'gzip, deflate'), (b'connection', b'keep-alive'), (b'user-agent', b'testclient'), (b'content-length', b'1')], ...} receive = .receive at 0x7f8701cb89a0> send = ._send at 0x7f8701cbb2e0> async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None: if scope["type"] != "http": await self.app(scope, receive, send) return request = _CachedRequest(scope, receive) wrapped_receive = request.wrapped_receive response_sent = anyio.Event() async def call_next(request: Request) -> Response: app_exc: Exception | None = None async def receive_or_disconnect() -> Message: if response_sent.is_set(): return {"type": "http.disconnect"} async with anyio.create_task_group() as task_group: async def wrap(func: typing.Callable[[], typing.Awaitable[T]]) -> T: result = await func() task_group.cancel_scope.cancel() return result task_group.start_soon(wrap, response_sent.wait) message = await wrap(wrapped_receive) if response_sent.is_set(): return {"type": "http.disconnect"} return message async def send_no_error(message: Message) -> None: try: await send_stream.send(message) except anyio.BrokenResourceError: # recv_stream has been closed, i.e. response_sent has been set. return async def coro() -> None: nonlocal app_exc with send_stream: try: await self.app(scope, receive_or_disconnect, send_no_error) except Exception as exc: app_exc = exc task_group.start_soon(coro) try: message = await recv_stream.receive() info = message.get("info", None) if message["type"] == "http.response.debug" and info is not None: message = await recv_stream.receive() except anyio.EndOfStream: if app_exc is not None: raise app_exc raise RuntimeError("No response returned.") assert message["type"] == "http.response.start" async def body_stream() -> typing.AsyncGenerator[bytes, None]: async for message in recv_stream: assert message["type"] == "http.response.body" body = message.get("body", b"") if body: yield body if not message.get("more_body", False): break if app_exc is not None: raise app_exc response = _StreamingResponse(status_code=message["status"], content=body_stream(), info=info) response.raw_headers = message["headers"] return response > send_stream, recv_stream = anyio.create_memory_object_stream[Message]() E TypeError: 'function' object is not subscriptable starlette/middleware/base.py:175: TypeError ______ test_read_request_body_in_app_after_middleware_calls_stream[trio] _______ test_client_factory = functools.partial(, backend='trio', backend_options={}) def test_read_request_body_in_app_after_middleware_calls_stream( test_client_factory: TestClientFactory, ) -> None: async def homepage(request: Request) -> PlainTextResponse: assert await request.body() == b"" return PlainTextResponse("Homepage") class ConsumingMiddleware(BaseHTTPMiddleware): async def dispatch( self, request: Request, call_next: RequestResponseEndpoint, ) -> Response: expected = [b"a", b""] async for chunk in request.stream(): assert chunk == expected.pop(0) assert expected == [] return await call_next(request) app = Starlette( routes=[Route("/", homepage, methods=["POST"])], middleware=[Middleware(ConsumingMiddleware)], ) client: TestClient = test_client_factory(app) > response = client.post("/", content=b"a") tests/middleware/test_base.py:626: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:529: in post return super().post( /usr/lib/python3.13/site-packages/httpx/_client.py:1157: in post return self.request( starlette/testclient.py:428: in request return super().request( /usr/lib/python3.13/site-packages/httpx/_client.py:837: in request return self.send(request, auth=auth, follow_redirects=follow_redirects) /usr/lib/python3.13/site-packages/httpx/_client.py:926: in send response = self._send_handling_auth( /usr/lib/python3.13/site-packages/httpx/_client.py:954: in _send_handling_auth response = self._send_handling_redirects( /usr/lib/python3.13/site-packages/httpx/_client.py:991: in _send_handling_redirects response = self._send_single_request(request) /usr/lib/python3.13/site-packages/httpx/_client.py:1027: in _send_single_request response = transport.handle_request(request) starlette/testclient.py:337: in handle_request raise exc starlette/testclient.py:334: in handle_request portal.call(self.app, scope, receive, send) /usr/lib/python3.13/site-packages/anyio/from_thread.py:277: in call return cast(T_Retval, self.start_task_soon(func, *args).result()) /usr/lib64/python3.13/concurrent/futures/_base.py:449: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval starlette/applications.py:112: in __call__ await self.middleware_stack(scope, receive, send) starlette/middleware/errors.py:187: in __call__ raise exc starlette/middleware/errors.py:165: in __call__ await self.app(scope, receive, _send) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = .ConsumingMiddleware object at 0x7f870205fb60> scope = {'app': , 'client': ('testclient', 50000), 'extensions': {'...g', b'gzip, deflate'), (b'connection', b'keep-alive'), (b'user-agent', b'testclient'), (b'content-length', b'1')], ...} receive = .receive at 0x7f8701cb8680> send = ._send at 0x7f8701cba020> async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None: if scope["type"] != "http": await self.app(scope, receive, send) return request = _CachedRequest(scope, receive) wrapped_receive = request.wrapped_receive response_sent = anyio.Event() async def call_next(request: Request) -> Response: app_exc: Exception | None = None async def receive_or_disconnect() -> Message: if response_sent.is_set(): return {"type": "http.disconnect"} async with anyio.create_task_group() as task_group: async def wrap(func: typing.Callable[[], typing.Awaitable[T]]) -> T: result = await func() task_group.cancel_scope.cancel() return result task_group.start_soon(wrap, response_sent.wait) message = await wrap(wrapped_receive) if response_sent.is_set(): return {"type": "http.disconnect"} return message async def send_no_error(message: Message) -> None: try: await send_stream.send(message) except anyio.BrokenResourceError: # recv_stream has been closed, i.e. response_sent has been set. return async def coro() -> None: nonlocal app_exc with send_stream: try: await self.app(scope, receive_or_disconnect, send_no_error) except Exception as exc: app_exc = exc task_group.start_soon(coro) try: message = await recv_stream.receive() info = message.get("info", None) if message["type"] == "http.response.debug" and info is not None: message = await recv_stream.receive() except anyio.EndOfStream: if app_exc is not None: raise app_exc raise RuntimeError("No response returned.") assert message["type"] == "http.response.start" async def body_stream() -> typing.AsyncGenerator[bytes, None]: async for message in recv_stream: assert message["type"] == "http.response.body" body = message.get("body", b"") if body: yield body if not message.get("more_body", False): break if app_exc is not None: raise app_exc response = _StreamingResponse(status_code=message["status"], content=body_stream(), info=info) response.raw_headers = message["headers"] return response > send_stream, recv_stream = anyio.create_memory_object_stream[Message]() E TypeError: 'function' object is not subscriptable starlette/middleware/base.py:175: TypeError ______ test_read_request_body_in_app_after_middleware_calls_body[asyncio] ______ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) def test_read_request_body_in_app_after_middleware_calls_body( test_client_factory: TestClientFactory, ) -> None: async def homepage(request: Request) -> PlainTextResponse: assert await request.body() == b"a" return PlainTextResponse("Homepage") class ConsumingMiddleware(BaseHTTPMiddleware): async def dispatch( self, request: Request, call_next: RequestResponseEndpoint, ) -> Response: assert await request.body() == b"a" return await call_next(request) app = Starlette( routes=[Route("/", homepage, methods=["POST"])], middleware=[Middleware(ConsumingMiddleware)], ) client: TestClient = test_client_factory(app) > response = client.post("/", content=b"a") tests/middleware/test_base.py:652: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:529: in post return super().post( /usr/lib/python3.13/site-packages/httpx/_client.py:1157: in post return self.request( starlette/testclient.py:428: in request return super().request( /usr/lib/python3.13/site-packages/httpx/_client.py:837: in request return self.send(request, auth=auth, follow_redirects=follow_redirects) /usr/lib/python3.13/site-packages/httpx/_client.py:926: in send response = self._send_handling_auth( /usr/lib/python3.13/site-packages/httpx/_client.py:954: in _send_handling_auth response = self._send_handling_redirects( /usr/lib/python3.13/site-packages/httpx/_client.py:991: in _send_handling_redirects response = self._send_single_request(request) /usr/lib/python3.13/site-packages/httpx/_client.py:1027: in _send_single_request response = transport.handle_request(request) starlette/testclient.py:337: in handle_request raise exc starlette/testclient.py:334: in handle_request portal.call(self.app, scope, receive, send) /usr/lib/python3.13/site-packages/anyio/from_thread.py:277: in call return cast(T_Retval, self.start_task_soon(func, *args).result()) /usr/lib64/python3.13/concurrent/futures/_base.py:456: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval starlette/applications.py:112: in __call__ await self.middleware_stack(scope, receive, send) starlette/middleware/errors.py:187: in __call__ raise exc starlette/middleware/errors.py:165: in __call__ await self.app(scope, receive, _send) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = .ConsumingMiddleware object at 0x7f870205cec0> scope = {'app': , 'client': ('testclient', 50000), 'extensions': {'...g', b'gzip, deflate'), (b'connection', b'keep-alive'), (b'user-agent', b'testclient'), (b'content-length', b'1')], ...} receive = .receive at 0x7f8701cbb6a0> send = ._send at 0x7f8701cba0c0> async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None: if scope["type"] != "http": await self.app(scope, receive, send) return request = _CachedRequest(scope, receive) wrapped_receive = request.wrapped_receive response_sent = anyio.Event() async def call_next(request: Request) -> Response: app_exc: Exception | None = None async def receive_or_disconnect() -> Message: if response_sent.is_set(): return {"type": "http.disconnect"} async with anyio.create_task_group() as task_group: async def wrap(func: typing.Callable[[], typing.Awaitable[T]]) -> T: result = await func() task_group.cancel_scope.cancel() return result task_group.start_soon(wrap, response_sent.wait) message = await wrap(wrapped_receive) if response_sent.is_set(): return {"type": "http.disconnect"} return message async def send_no_error(message: Message) -> None: try: await send_stream.send(message) except anyio.BrokenResourceError: # recv_stream has been closed, i.e. response_sent has been set. return async def coro() -> None: nonlocal app_exc with send_stream: try: await self.app(scope, receive_or_disconnect, send_no_error) except Exception as exc: app_exc = exc task_group.start_soon(coro) try: message = await recv_stream.receive() info = message.get("info", None) if message["type"] == "http.response.debug" and info is not None: message = await recv_stream.receive() except anyio.EndOfStream: if app_exc is not None: raise app_exc raise RuntimeError("No response returned.") assert message["type"] == "http.response.start" async def body_stream() -> typing.AsyncGenerator[bytes, None]: async for message in recv_stream: assert message["type"] == "http.response.body" body = message.get("body", b"") if body: yield body if not message.get("more_body", False): break if app_exc is not None: raise app_exc response = _StreamingResponse(status_code=message["status"], content=body_stream(), info=info) response.raw_headers = message["headers"] return response > send_stream, recv_stream = anyio.create_memory_object_stream[Message]() E TypeError: 'function' object is not subscriptable starlette/middleware/base.py:175: TypeError _______ test_read_request_body_in_app_after_middleware_calls_body[trio] ________ test_client_factory = functools.partial(, backend='trio', backend_options={}) def test_read_request_body_in_app_after_middleware_calls_body( test_client_factory: TestClientFactory, ) -> None: async def homepage(request: Request) -> PlainTextResponse: assert await request.body() == b"a" return PlainTextResponse("Homepage") class ConsumingMiddleware(BaseHTTPMiddleware): async def dispatch( self, request: Request, call_next: RequestResponseEndpoint, ) -> Response: assert await request.body() == b"a" return await call_next(request) app = Starlette( routes=[Route("/", homepage, methods=["POST"])], middleware=[Middleware(ConsumingMiddleware)], ) client: TestClient = test_client_factory(app) > response = client.post("/", content=b"a") tests/middleware/test_base.py:652: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:529: in post return super().post( /usr/lib/python3.13/site-packages/httpx/_client.py:1157: in post return self.request( starlette/testclient.py:428: in request return super().request( /usr/lib/python3.13/site-packages/httpx/_client.py:837: in request return self.send(request, auth=auth, follow_redirects=follow_redirects) /usr/lib/python3.13/site-packages/httpx/_client.py:926: in send response = self._send_handling_auth( /usr/lib/python3.13/site-packages/httpx/_client.py:954: in _send_handling_auth response = self._send_handling_redirects( /usr/lib/python3.13/site-packages/httpx/_client.py:991: in _send_handling_redirects response = self._send_single_request(request) /usr/lib/python3.13/site-packages/httpx/_client.py:1027: in _send_single_request response = transport.handle_request(request) starlette/testclient.py:337: in handle_request raise exc starlette/testclient.py:334: in handle_request portal.call(self.app, scope, receive, send) /usr/lib/python3.13/site-packages/anyio/from_thread.py:277: in call return cast(T_Retval, self.start_task_soon(func, *args).result()) /usr/lib64/python3.13/concurrent/futures/_base.py:449: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval starlette/applications.py:112: in __call__ await self.middleware_stack(scope, receive, send) starlette/middleware/errors.py:187: in __call__ raise exc starlette/middleware/errors.py:165: in __call__ await self.app(scope, receive, _send) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = .ConsumingMiddleware object at 0x7f870205e510> scope = {'app': , 'client': ('testclient', 50000), 'extensions': {'...g', b'gzip, deflate'), (b'connection', b'keep-alive'), (b'user-agent', b'testclient'), (b'content-length', b'1')], ...} receive = .receive at 0x7f8701cb8680> send = ._send at 0x7f8701c942c0> async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None: if scope["type"] != "http": await self.app(scope, receive, send) return request = _CachedRequest(scope, receive) wrapped_receive = request.wrapped_receive response_sent = anyio.Event() async def call_next(request: Request) -> Response: app_exc: Exception | None = None async def receive_or_disconnect() -> Message: if response_sent.is_set(): return {"type": "http.disconnect"} async with anyio.create_task_group() as task_group: async def wrap(func: typing.Callable[[], typing.Awaitable[T]]) -> T: result = await func() task_group.cancel_scope.cancel() return result task_group.start_soon(wrap, response_sent.wait) message = await wrap(wrapped_receive) if response_sent.is_set(): return {"type": "http.disconnect"} return message async def send_no_error(message: Message) -> None: try: await send_stream.send(message) except anyio.BrokenResourceError: # recv_stream has been closed, i.e. response_sent has been set. return async def coro() -> None: nonlocal app_exc with send_stream: try: await self.app(scope, receive_or_disconnect, send_no_error) except Exception as exc: app_exc = exc task_group.start_soon(coro) try: message = await recv_stream.receive() info = message.get("info", None) if message["type"] == "http.response.debug" and info is not None: message = await recv_stream.receive() except anyio.EndOfStream: if app_exc is not None: raise app_exc raise RuntimeError("No response returned.") assert message["type"] == "http.response.start" async def body_stream() -> typing.AsyncGenerator[bytes, None]: async for message in recv_stream: assert message["type"] == "http.response.body" body = message.get("body", b"") if body: yield body if not message.get("more_body", False): break if app_exc is not None: raise app_exc response = _StreamingResponse(status_code=message["status"], content=body_stream(), info=info) response.raw_headers = message["headers"] return response > send_stream, recv_stream = anyio.create_memory_object_stream[Message]() E TypeError: 'function' object is not subscriptable starlette/middleware/base.py:175: TypeError _____ test_read_request_stream_in_dispatch_after_app_calls_stream[asyncio] _____ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) def test_read_request_stream_in_dispatch_after_app_calls_stream( test_client_factory: TestClientFactory, ) -> None: async def homepage(request: Request) -> PlainTextResponse: expected = [b"a", b""] async for chunk in request.stream(): assert chunk == expected.pop(0) assert expected == [] return PlainTextResponse("Homepage") class ConsumingMiddleware(BaseHTTPMiddleware): async def dispatch( self, request: Request, call_next: RequestResponseEndpoint, ) -> Response: resp = await call_next(request) with pytest.raises(RuntimeError, match="Stream consumed"): async for _ in request.stream(): raise AssertionError("should not be called") # pragma: no cover return resp app = Starlette( routes=[Route("/", homepage, methods=["POST"])], middleware=[Middleware(ConsumingMiddleware)], ) client: TestClient = test_client_factory(app) > response = client.post("/", content=b"a") tests/middleware/test_base.py:684: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:529: in post return super().post( /usr/lib/python3.13/site-packages/httpx/_client.py:1157: in post return self.request( starlette/testclient.py:428: in request return super().request( /usr/lib/python3.13/site-packages/httpx/_client.py:837: in request return self.send(request, auth=auth, follow_redirects=follow_redirects) /usr/lib/python3.13/site-packages/httpx/_client.py:926: in send response = self._send_handling_auth( /usr/lib/python3.13/site-packages/httpx/_client.py:954: in _send_handling_auth response = self._send_handling_redirects( /usr/lib/python3.13/site-packages/httpx/_client.py:991: in _send_handling_redirects response = self._send_single_request(request) /usr/lib/python3.13/site-packages/httpx/_client.py:1027: in _send_single_request response = transport.handle_request(request) starlette/testclient.py:337: in handle_request raise exc starlette/testclient.py:334: in handle_request portal.call(self.app, scope, receive, send) /usr/lib/python3.13/site-packages/anyio/from_thread.py:277: in call return cast(T_Retval, self.start_task_soon(func, *args).result()) /usr/lib64/python3.13/concurrent/futures/_base.py:449: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval starlette/applications.py:112: in __call__ await self.middleware_stack(scope, receive, send) starlette/middleware/errors.py:187: in __call__ raise exc starlette/middleware/errors.py:165: in __call__ await self.app(scope, receive, _send) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = .ConsumingMiddleware object at 0x7f870205eba0> scope = {'app': , 'client': ('testclient', 50000), 'extensions': {'...g', b'gzip, deflate'), (b'connection', b'keep-alive'), (b'user-agent', b'testclient'), (b'content-length', b'1')], ...} receive = .receive at 0x7f8701cba160> send = ._send at 0x7f8701c94ae0> async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None: if scope["type"] != "http": await self.app(scope, receive, send) return request = _CachedRequest(scope, receive) wrapped_receive = request.wrapped_receive response_sent = anyio.Event() async def call_next(request: Request) -> Response: app_exc: Exception | None = None async def receive_or_disconnect() -> Message: if response_sent.is_set(): return {"type": "http.disconnect"} async with anyio.create_task_group() as task_group: async def wrap(func: typing.Callable[[], typing.Awaitable[T]]) -> T: result = await func() task_group.cancel_scope.cancel() return result task_group.start_soon(wrap, response_sent.wait) message = await wrap(wrapped_receive) if response_sent.is_set(): return {"type": "http.disconnect"} return message async def send_no_error(message: Message) -> None: try: await send_stream.send(message) except anyio.BrokenResourceError: # recv_stream has been closed, i.e. response_sent has been set. return async def coro() -> None: nonlocal app_exc with send_stream: try: await self.app(scope, receive_or_disconnect, send_no_error) except Exception as exc: app_exc = exc task_group.start_soon(coro) try: message = await recv_stream.receive() info = message.get("info", None) if message["type"] == "http.response.debug" and info is not None: message = await recv_stream.receive() except anyio.EndOfStream: if app_exc is not None: raise app_exc raise RuntimeError("No response returned.") assert message["type"] == "http.response.start" async def body_stream() -> typing.AsyncGenerator[bytes, None]: async for message in recv_stream: assert message["type"] == "http.response.body" body = message.get("body", b"") if body: yield body if not message.get("more_body", False): break if app_exc is not None: raise app_exc response = _StreamingResponse(status_code=message["status"], content=body_stream(), info=info) response.raw_headers = message["headers"] return response > send_stream, recv_stream = anyio.create_memory_object_stream[Message]() E TypeError: 'function' object is not subscriptable starlette/middleware/base.py:175: TypeError ______ test_read_request_stream_in_dispatch_after_app_calls_stream[trio] _______ test_client_factory = functools.partial(, backend='trio', backend_options={}) def test_read_request_stream_in_dispatch_after_app_calls_stream( test_client_factory: TestClientFactory, ) -> None: async def homepage(request: Request) -> PlainTextResponse: expected = [b"a", b""] async for chunk in request.stream(): assert chunk == expected.pop(0) assert expected == [] return PlainTextResponse("Homepage") class ConsumingMiddleware(BaseHTTPMiddleware): async def dispatch( self, request: Request, call_next: RequestResponseEndpoint, ) -> Response: resp = await call_next(request) with pytest.raises(RuntimeError, match="Stream consumed"): async for _ in request.stream(): raise AssertionError("should not be called") # pragma: no cover return resp app = Starlette( routes=[Route("/", homepage, methods=["POST"])], middleware=[Middleware(ConsumingMiddleware)], ) client: TestClient = test_client_factory(app) > response = client.post("/", content=b"a") tests/middleware/test_base.py:684: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:529: in post return super().post( /usr/lib/python3.13/site-packages/httpx/_client.py:1157: in post return self.request( starlette/testclient.py:428: in request return super().request( /usr/lib/python3.13/site-packages/httpx/_client.py:837: in request return self.send(request, auth=auth, follow_redirects=follow_redirects) /usr/lib/python3.13/site-packages/httpx/_client.py:926: in send response = self._send_handling_auth( /usr/lib/python3.13/site-packages/httpx/_client.py:954: in _send_handling_auth response = self._send_handling_redirects( /usr/lib/python3.13/site-packages/httpx/_client.py:991: in _send_handling_redirects response = self._send_single_request(request) /usr/lib/python3.13/site-packages/httpx/_client.py:1027: in _send_single_request response = transport.handle_request(request) starlette/testclient.py:337: in handle_request raise exc starlette/testclient.py:334: in handle_request portal.call(self.app, scope, receive, send) /usr/lib/python3.13/site-packages/anyio/from_thread.py:277: in call return cast(T_Retval, self.start_task_soon(func, *args).result()) /usr/lib64/python3.13/concurrent/futures/_base.py:456: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval starlette/applications.py:112: in __call__ await self.middleware_stack(scope, receive, send) starlette/middleware/errors.py:187: in __call__ raise exc starlette/middleware/errors.py:165: in __call__ await self.app(scope, receive, _send) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = .ConsumingMiddleware object at 0x7f870205e660> scope = {'app': , 'client': ('testclient', 50000), 'extensions': {'...g', b'gzip, deflate'), (b'connection', b'keep-alive'), (b'user-agent', b'testclient'), (b'content-length', b'1')], ...} receive = .receive at 0x7f8701c95260> send = ._send at 0x7f8701c95f80> async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None: if scope["type"] != "http": await self.app(scope, receive, send) return request = _CachedRequest(scope, receive) wrapped_receive = request.wrapped_receive response_sent = anyio.Event() async def call_next(request: Request) -> Response: app_exc: Exception | None = None async def receive_or_disconnect() -> Message: if response_sent.is_set(): return {"type": "http.disconnect"} async with anyio.create_task_group() as task_group: async def wrap(func: typing.Callable[[], typing.Awaitable[T]]) -> T: result = await func() task_group.cancel_scope.cancel() return result task_group.start_soon(wrap, response_sent.wait) message = await wrap(wrapped_receive) if response_sent.is_set(): return {"type": "http.disconnect"} return message async def send_no_error(message: Message) -> None: try: await send_stream.send(message) except anyio.BrokenResourceError: # recv_stream has been closed, i.e. response_sent has been set. return async def coro() -> None: nonlocal app_exc with send_stream: try: await self.app(scope, receive_or_disconnect, send_no_error) except Exception as exc: app_exc = exc task_group.start_soon(coro) try: message = await recv_stream.receive() info = message.get("info", None) if message["type"] == "http.response.debug" and info is not None: message = await recv_stream.receive() except anyio.EndOfStream: if app_exc is not None: raise app_exc raise RuntimeError("No response returned.") assert message["type"] == "http.response.start" async def body_stream() -> typing.AsyncGenerator[bytes, None]: async for message in recv_stream: assert message["type"] == "http.response.body" body = message.get("body", b"") if body: yield body if not message.get("more_body", False): break if app_exc is not None: raise app_exc response = _StreamingResponse(status_code=message["status"], content=body_stream(), info=info) response.raw_headers = message["headers"] return response > send_stream, recv_stream = anyio.create_memory_object_stream[Message]() E TypeError: 'function' object is not subscriptable starlette/middleware/base.py:175: TypeError ______ test_read_request_stream_in_dispatch_after_app_calls_body[asyncio] ______ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) def test_read_request_stream_in_dispatch_after_app_calls_body( test_client_factory: TestClientFactory, ) -> None: async def homepage(request: Request) -> PlainTextResponse: assert await request.body() == b"a" return PlainTextResponse("Homepage") class ConsumingMiddleware(BaseHTTPMiddleware): async def dispatch( self, request: Request, call_next: RequestResponseEndpoint, ) -> Response: resp = await call_next(request) with pytest.raises(RuntimeError, match="Stream consumed"): async for _ in request.stream(): raise AssertionError("should not be called") # pragma: no cover return resp app = Starlette( routes=[Route("/", homepage, methods=["POST"])], middleware=[Middleware(ConsumingMiddleware)], ) client: TestClient = test_client_factory(app) > response = client.post("/", content=b"a") tests/middleware/test_base.py:713: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:529: in post return super().post( /usr/lib/python3.13/site-packages/httpx/_client.py:1157: in post return self.request( starlette/testclient.py:428: in request return super().request( /usr/lib/python3.13/site-packages/httpx/_client.py:837: in request return self.send(request, auth=auth, follow_redirects=follow_redirects) /usr/lib/python3.13/site-packages/httpx/_client.py:926: in send response = self._send_handling_auth( /usr/lib/python3.13/site-packages/httpx/_client.py:954: in _send_handling_auth response = self._send_handling_redirects( /usr/lib/python3.13/site-packages/httpx/_client.py:991: in _send_handling_redirects response = self._send_single_request(request) /usr/lib/python3.13/site-packages/httpx/_client.py:1027: in _send_single_request response = transport.handle_request(request) starlette/testclient.py:337: in handle_request raise exc starlette/testclient.py:334: in handle_request portal.call(self.app, scope, receive, send) /usr/lib/python3.13/site-packages/anyio/from_thread.py:277: in call return cast(T_Retval, self.start_task_soon(func, *args).result()) /usr/lib64/python3.13/concurrent/futures/_base.py:456: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval starlette/applications.py:112: in __call__ await self.middleware_stack(scope, receive, send) starlette/middleware/errors.py:187: in __call__ raise exc starlette/middleware/errors.py:165: in __call__ await self.app(scope, receive, _send) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = .ConsumingMiddleware object at 0x7f870205ecf0> scope = {'app': , 'client': ('testclient', 50000), 'extensions': {'...g', b'gzip, deflate'), (b'connection', b'keep-alive'), (b'user-agent', b'testclient'), (b'content-length', b'1')], ...} receive = .receive at 0x7f8701c94ea0> send = ._send at 0x7f8701c94a40> async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None: if scope["type"] != "http": await self.app(scope, receive, send) return request = _CachedRequest(scope, receive) wrapped_receive = request.wrapped_receive response_sent = anyio.Event() async def call_next(request: Request) -> Response: app_exc: Exception | None = None async def receive_or_disconnect() -> Message: if response_sent.is_set(): return {"type": "http.disconnect"} async with anyio.create_task_group() as task_group: async def wrap(func: typing.Callable[[], typing.Awaitable[T]]) -> T: result = await func() task_group.cancel_scope.cancel() return result task_group.start_soon(wrap, response_sent.wait) message = await wrap(wrapped_receive) if response_sent.is_set(): return {"type": "http.disconnect"} return message async def send_no_error(message: Message) -> None: try: await send_stream.send(message) except anyio.BrokenResourceError: # recv_stream has been closed, i.e. response_sent has been set. return async def coro() -> None: nonlocal app_exc with send_stream: try: await self.app(scope, receive_or_disconnect, send_no_error) except Exception as exc: app_exc = exc task_group.start_soon(coro) try: message = await recv_stream.receive() info = message.get("info", None) if message["type"] == "http.response.debug" and info is not None: message = await recv_stream.receive() except anyio.EndOfStream: if app_exc is not None: raise app_exc raise RuntimeError("No response returned.") assert message["type"] == "http.response.start" async def body_stream() -> typing.AsyncGenerator[bytes, None]: async for message in recv_stream: assert message["type"] == "http.response.body" body = message.get("body", b"") if body: yield body if not message.get("more_body", False): break if app_exc is not None: raise app_exc response = _StreamingResponse(status_code=message["status"], content=body_stream(), info=info) response.raw_headers = message["headers"] return response > send_stream, recv_stream = anyio.create_memory_object_stream[Message]() E TypeError: 'function' object is not subscriptable starlette/middleware/base.py:175: TypeError _______ test_read_request_stream_in_dispatch_after_app_calls_body[trio] ________ test_client_factory = functools.partial(, backend='trio', backend_options={}) def test_read_request_stream_in_dispatch_after_app_calls_body( test_client_factory: TestClientFactory, ) -> None: async def homepage(request: Request) -> PlainTextResponse: assert await request.body() == b"a" return PlainTextResponse("Homepage") class ConsumingMiddleware(BaseHTTPMiddleware): async def dispatch( self, request: Request, call_next: RequestResponseEndpoint, ) -> Response: resp = await call_next(request) with pytest.raises(RuntimeError, match="Stream consumed"): async for _ in request.stream(): raise AssertionError("should not be called") # pragma: no cover return resp app = Starlette( routes=[Route("/", homepage, methods=["POST"])], middleware=[Middleware(ConsumingMiddleware)], ) client: TestClient = test_client_factory(app) > response = client.post("/", content=b"a") tests/middleware/test_base.py:713: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:529: in post return super().post( /usr/lib/python3.13/site-packages/httpx/_client.py:1157: in post return self.request( starlette/testclient.py:428: in request return super().request( /usr/lib/python3.13/site-packages/httpx/_client.py:837: in request return self.send(request, auth=auth, follow_redirects=follow_redirects) /usr/lib/python3.13/site-packages/httpx/_client.py:926: in send response = self._send_handling_auth( /usr/lib/python3.13/site-packages/httpx/_client.py:954: in _send_handling_auth response = self._send_handling_redirects( /usr/lib/python3.13/site-packages/httpx/_client.py:991: in _send_handling_redirects response = self._send_single_request(request) /usr/lib/python3.13/site-packages/httpx/_client.py:1027: in _send_single_request response = transport.handle_request(request) starlette/testclient.py:337: in handle_request raise exc starlette/testclient.py:334: in handle_request portal.call(self.app, scope, receive, send) /usr/lib/python3.13/site-packages/anyio/from_thread.py:277: in call return cast(T_Retval, self.start_task_soon(func, *args).result()) /usr/lib64/python3.13/concurrent/futures/_base.py:449: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval starlette/applications.py:112: in __call__ await self.middleware_stack(scope, receive, send) starlette/middleware/errors.py:187: in __call__ raise exc starlette/middleware/errors.py:165: in __call__ await self.app(scope, receive, _send) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = .ConsumingMiddleware object at 0x7f870205dbe0> scope = {'app': , 'client': ('testclient', 50000), 'extensions': {'...g', b'gzip, deflate'), (b'connection', b'keep-alive'), (b'user-agent', b'testclient'), (b'content-length', b'1')], ...} receive = .receive at 0x7f8701c968e0> send = ._send at 0x7f8701c97100> async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None: if scope["type"] != "http": await self.app(scope, receive, send) return request = _CachedRequest(scope, receive) wrapped_receive = request.wrapped_receive response_sent = anyio.Event() async def call_next(request: Request) -> Response: app_exc: Exception | None = None async def receive_or_disconnect() -> Message: if response_sent.is_set(): return {"type": "http.disconnect"} async with anyio.create_task_group() as task_group: async def wrap(func: typing.Callable[[], typing.Awaitable[T]]) -> T: result = await func() task_group.cancel_scope.cancel() return result task_group.start_soon(wrap, response_sent.wait) message = await wrap(wrapped_receive) if response_sent.is_set(): return {"type": "http.disconnect"} return message async def send_no_error(message: Message) -> None: try: await send_stream.send(message) except anyio.BrokenResourceError: # recv_stream has been closed, i.e. response_sent has been set. return async def coro() -> None: nonlocal app_exc with send_stream: try: await self.app(scope, receive_or_disconnect, send_no_error) except Exception as exc: app_exc = exc task_group.start_soon(coro) try: message = await recv_stream.receive() info = message.get("info", None) if message["type"] == "http.response.debug" and info is not None: message = await recv_stream.receive() except anyio.EndOfStream: if app_exc is not None: raise app_exc raise RuntimeError("No response returned.") assert message["type"] == "http.response.start" async def body_stream() -> typing.AsyncGenerator[bytes, None]: async for message in recv_stream: assert message["type"] == "http.response.body" body = message.get("body", b"") if body: yield body if not message.get("more_body", False): break if app_exc is not None: raise app_exc response = _StreamingResponse(status_code=message["status"], content=body_stream(), info=info) response.raw_headers = message["headers"] return response > send_stream, recv_stream = anyio.create_memory_object_stream[Message]() E TypeError: 'function' object is not subscriptable starlette/middleware/base.py:175: TypeError ____ test_read_request_stream_in_dispatch_wrapping_app_calls_body[asyncio] _____ @pytest.mark.anyio async def test_read_request_stream_in_dispatch_wrapping_app_calls_body() -> None: async def endpoint(scope: Scope, receive: Receive, send: Send) -> None: request = Request(scope, receive) async for chunk in request.stream(): # pragma: no branch assert chunk == b"2" break await Response()(scope, receive, send) class ConsumingMiddleware(BaseHTTPMiddleware): async def dispatch( self, request: Request, call_next: RequestResponseEndpoint, ) -> Response: expected = b"1" response: Response | None = None async for chunk in request.stream(): # pragma: no branch assert chunk == expected if expected == b"1": response = await call_next(request) expected = b"3" else: break assert response is not None return response async def rcv() -> AsyncGenerator[Message, None]: yield {"type": "http.request", "body": b"1", "more_body": True} yield {"type": "http.request", "body": b"2", "more_body": True} yield {"type": "http.request", "body": b"3"} raise AssertionError( # pragma: no cover "Should not be called, no need to poll for disconnect" ) sent: list[Message] = [] async def send(msg: Message) -> None: sent.append(msg) app: ASGIApp = endpoint app = ConsumingMiddleware(app) rcv_stream = rcv() > await app({"type": "http"}, rcv_stream.__anext__, send) tests/middleware/test_base.py:762: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = .ConsumingMiddleware object at 0x7f870205eba0> scope = {'type': 'http'} receive = send = .send at 0x7f8701c97a60> async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None: if scope["type"] != "http": await self.app(scope, receive, send) return request = _CachedRequest(scope, receive) wrapped_receive = request.wrapped_receive response_sent = anyio.Event() async def call_next(request: Request) -> Response: app_exc: Exception | None = None async def receive_or_disconnect() -> Message: if response_sent.is_set(): return {"type": "http.disconnect"} async with anyio.create_task_group() as task_group: async def wrap(func: typing.Callable[[], typing.Awaitable[T]]) -> T: result = await func() task_group.cancel_scope.cancel() return result task_group.start_soon(wrap, response_sent.wait) message = await wrap(wrapped_receive) if response_sent.is_set(): return {"type": "http.disconnect"} return message async def send_no_error(message: Message) -> None: try: await send_stream.send(message) except anyio.BrokenResourceError: # recv_stream has been closed, i.e. response_sent has been set. return async def coro() -> None: nonlocal app_exc with send_stream: try: await self.app(scope, receive_or_disconnect, send_no_error) except Exception as exc: app_exc = exc task_group.start_soon(coro) try: message = await recv_stream.receive() info = message.get("info", None) if message["type"] == "http.response.debug" and info is not None: message = await recv_stream.receive() except anyio.EndOfStream: if app_exc is not None: raise app_exc raise RuntimeError("No response returned.") assert message["type"] == "http.response.start" async def body_stream() -> typing.AsyncGenerator[bytes, None]: async for message in recv_stream: assert message["type"] == "http.response.body" body = message.get("body", b"") if body: yield body if not message.get("more_body", False): break if app_exc is not None: raise app_exc response = _StreamingResponse(status_code=message["status"], content=body_stream(), info=info) response.raw_headers = message["headers"] return response > send_stream, recv_stream = anyio.create_memory_object_stream[Message]() E TypeError: 'function' object is not subscriptable starlette/middleware/base.py:175: TypeError ______ test_read_request_stream_in_dispatch_wrapping_app_calls_body[trio] ______ @pytest.mark.anyio async def test_read_request_stream_in_dispatch_wrapping_app_calls_body() -> None: async def endpoint(scope: Scope, receive: Receive, send: Send) -> None: request = Request(scope, receive) async for chunk in request.stream(): # pragma: no branch assert chunk == b"2" break await Response()(scope, receive, send) class ConsumingMiddleware(BaseHTTPMiddleware): async def dispatch( self, request: Request, call_next: RequestResponseEndpoint, ) -> Response: expected = b"1" response: Response | None = None async for chunk in request.stream(): # pragma: no branch assert chunk == expected if expected == b"1": response = await call_next(request) expected = b"3" else: break assert response is not None return response async def rcv() -> AsyncGenerator[Message, None]: yield {"type": "http.request", "body": b"1", "more_body": True} yield {"type": "http.request", "body": b"2", "more_body": True} yield {"type": "http.request", "body": b"3"} raise AssertionError( # pragma: no cover "Should not be called, no need to poll for disconnect" ) sent: list[Message] = [] async def send(msg: Message) -> None: sent.append(msg) app: ASGIApp = endpoint app = ConsumingMiddleware(app) rcv_stream = rcv() > await app({"type": "http"}, rcv_stream.__anext__, send) tests/middleware/test_base.py:762: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = .ConsumingMiddleware object at 0x7f870205ecf0> scope = {'type': 'http'} receive = send = .send at 0x7f8701c95120> async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None: if scope["type"] != "http": await self.app(scope, receive, send) return request = _CachedRequest(scope, receive) wrapped_receive = request.wrapped_receive response_sent = anyio.Event() async def call_next(request: Request) -> Response: app_exc: Exception | None = None async def receive_or_disconnect() -> Message: if response_sent.is_set(): return {"type": "http.disconnect"} async with anyio.create_task_group() as task_group: async def wrap(func: typing.Callable[[], typing.Awaitable[T]]) -> T: result = await func() task_group.cancel_scope.cancel() return result task_group.start_soon(wrap, response_sent.wait) message = await wrap(wrapped_receive) if response_sent.is_set(): return {"type": "http.disconnect"} return message async def send_no_error(message: Message) -> None: try: await send_stream.send(message) except anyio.BrokenResourceError: # recv_stream has been closed, i.e. response_sent has been set. return async def coro() -> None: nonlocal app_exc with send_stream: try: await self.app(scope, receive_or_disconnect, send_no_error) except Exception as exc: app_exc = exc task_group.start_soon(coro) try: message = await recv_stream.receive() info = message.get("info", None) if message["type"] == "http.response.debug" and info is not None: message = await recv_stream.receive() except anyio.EndOfStream: if app_exc is not None: raise app_exc raise RuntimeError("No response returned.") assert message["type"] == "http.response.start" async def body_stream() -> typing.AsyncGenerator[bytes, None]: async for message in recv_stream: assert message["type"] == "http.response.body" body = message.get("body", b"") if body: yield body if not message.get("more_body", False): break if app_exc is not None: raise app_exc response = _StreamingResponse(status_code=message["status"], content=body_stream(), info=info) response.raw_headers = message["headers"] return response > send_stream, recv_stream = anyio.create_memory_object_stream[Message]() E TypeError: 'function' object is not subscriptable starlette/middleware/base.py:175: TypeError _ test_read_request_stream_in_dispatch_after_app_calls_body_with_middleware_calling_body_before_call_next[asyncio] _ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) def test_read_request_stream_in_dispatch_after_app_calls_body_with_middleware_calling_body_before_call_next( test_client_factory: TestClientFactory, ) -> None: async def homepage(request: Request) -> PlainTextResponse: assert await request.body() == b"a" return PlainTextResponse("Homepage") class ConsumingMiddleware(BaseHTTPMiddleware): async def dispatch( self, request: Request, call_next: RequestResponseEndpoint, ) -> Response: assert await request.body() == b"a" # this buffers the request body in memory resp = await call_next(request) async for chunk in request.stream(): if chunk: assert chunk == b"a" return resp app = Starlette( routes=[Route("/", homepage, methods=["POST"])], middleware=[Middleware(ConsumingMiddleware)], ) client: TestClient = test_client_factory(app) > response = client.post("/", content=b"a") tests/middleware/test_base.py:802: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:529: in post return super().post( /usr/lib/python3.13/site-packages/httpx/_client.py:1157: in post return self.request( starlette/testclient.py:428: in request return super().request( /usr/lib/python3.13/site-packages/httpx/_client.py:837: in request return self.send(request, auth=auth, follow_redirects=follow_redirects) /usr/lib/python3.13/site-packages/httpx/_client.py:926: in send response = self._send_handling_auth( /usr/lib/python3.13/site-packages/httpx/_client.py:954: in _send_handling_auth response = self._send_handling_redirects( /usr/lib/python3.13/site-packages/httpx/_client.py:991: in _send_handling_redirects response = self._send_single_request(request) /usr/lib/python3.13/site-packages/httpx/_client.py:1027: in _send_single_request response = transport.handle_request(request) starlette/testclient.py:337: in handle_request raise exc starlette/testclient.py:334: in handle_request portal.call(self.app, scope, receive, send) /usr/lib/python3.13/site-packages/anyio/from_thread.py:277: in call return cast(T_Retval, self.start_task_soon(func, *args).result()) /usr/lib64/python3.13/concurrent/futures/_base.py:449: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval starlette/applications.py:112: in __call__ await self.middleware_stack(scope, receive, send) starlette/middleware/errors.py:187: in __call__ raise exc starlette/middleware/errors.py:165: in __call__ await self.app(scope, receive, _send) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = .ConsumingMiddleware object at 0x7f8701f90830> scope = {'app': , 'client': ('testclient', 50000), 'extensions': {'...g', b'gzip, deflate'), (b'connection', b'keep-alive'), (b'user-agent', b'testclient'), (b'content-length', b'1')], ...} receive = .receive at 0x7f8701c97ba0> send = ._send at 0x7f8701200220> async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None: if scope["type"] != "http": await self.app(scope, receive, send) return request = _CachedRequest(scope, receive) wrapped_receive = request.wrapped_receive response_sent = anyio.Event() async def call_next(request: Request) -> Response: app_exc: Exception | None = None async def receive_or_disconnect() -> Message: if response_sent.is_set(): return {"type": "http.disconnect"} async with anyio.create_task_group() as task_group: async def wrap(func: typing.Callable[[], typing.Awaitable[T]]) -> T: result = await func() task_group.cancel_scope.cancel() return result task_group.start_soon(wrap, response_sent.wait) message = await wrap(wrapped_receive) if response_sent.is_set(): return {"type": "http.disconnect"} return message async def send_no_error(message: Message) -> None: try: await send_stream.send(message) except anyio.BrokenResourceError: # recv_stream has been closed, i.e. response_sent has been set. return async def coro() -> None: nonlocal app_exc with send_stream: try: await self.app(scope, receive_or_disconnect, send_no_error) except Exception as exc: app_exc = exc task_group.start_soon(coro) try: message = await recv_stream.receive() info = message.get("info", None) if message["type"] == "http.response.debug" and info is not None: message = await recv_stream.receive() except anyio.EndOfStream: if app_exc is not None: raise app_exc raise RuntimeError("No response returned.") assert message["type"] == "http.response.start" async def body_stream() -> typing.AsyncGenerator[bytes, None]: async for message in recv_stream: assert message["type"] == "http.response.body" body = message.get("body", b"") if body: yield body if not message.get("more_body", False): break if app_exc is not None: raise app_exc response = _StreamingResponse(status_code=message["status"], content=body_stream(), info=info) response.raw_headers = message["headers"] return response > send_stream, recv_stream = anyio.create_memory_object_stream[Message]() E TypeError: 'function' object is not subscriptable starlette/middleware/base.py:175: TypeError _ test_read_request_stream_in_dispatch_after_app_calls_body_with_middleware_calling_body_before_call_next[trio] _ test_client_factory = functools.partial(, backend='trio', backend_options={}) def test_read_request_stream_in_dispatch_after_app_calls_body_with_middleware_calling_body_before_call_next( test_client_factory: TestClientFactory, ) -> None: async def homepage(request: Request) -> PlainTextResponse: assert await request.body() == b"a" return PlainTextResponse("Homepage") class ConsumingMiddleware(BaseHTTPMiddleware): async def dispatch( self, request: Request, call_next: RequestResponseEndpoint, ) -> Response: assert await request.body() == b"a" # this buffers the request body in memory resp = await call_next(request) async for chunk in request.stream(): if chunk: assert chunk == b"a" return resp app = Starlette( routes=[Route("/", homepage, methods=["POST"])], middleware=[Middleware(ConsumingMiddleware)], ) client: TestClient = test_client_factory(app) > response = client.post("/", content=b"a") tests/middleware/test_base.py:802: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:529: in post return super().post( /usr/lib/python3.13/site-packages/httpx/_client.py:1157: in post return self.request( starlette/testclient.py:428: in request return super().request( /usr/lib/python3.13/site-packages/httpx/_client.py:837: in request return self.send(request, auth=auth, follow_redirects=follow_redirects) /usr/lib/python3.13/site-packages/httpx/_client.py:926: in send response = self._send_handling_auth( /usr/lib/python3.13/site-packages/httpx/_client.py:954: in _send_handling_auth response = self._send_handling_redirects( /usr/lib/python3.13/site-packages/httpx/_client.py:991: in _send_handling_redirects response = self._send_single_request(request) /usr/lib/python3.13/site-packages/httpx/_client.py:1027: in _send_single_request response = transport.handle_request(request) starlette/testclient.py:337: in handle_request raise exc starlette/testclient.py:334: in handle_request portal.call(self.app, scope, receive, send) /usr/lib/python3.13/site-packages/anyio/from_thread.py:277: in call return cast(T_Retval, self.start_task_soon(func, *args).result()) /usr/lib64/python3.13/concurrent/futures/_base.py:449: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval starlette/applications.py:112: in __call__ await self.middleware_stack(scope, receive, send) starlette/middleware/errors.py:187: in __call__ raise exc starlette/middleware/errors.py:165: in __call__ await self.app(scope, receive, _send) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = .ConsumingMiddleware object at 0x7f87027e6510> scope = {'app': , 'client': ('testclient', 50000), 'extensions': {'...g', b'gzip, deflate'), (b'connection', b'keep-alive'), (b'user-agent', b'testclient'), (b'content-length', b'1')], ...} receive = .receive at 0x7f8701fdefc0> send = ._send at 0x7f8701cb8680> async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None: if scope["type"] != "http": await self.app(scope, receive, send) return request = _CachedRequest(scope, receive) wrapped_receive = request.wrapped_receive response_sent = anyio.Event() async def call_next(request: Request) -> Response: app_exc: Exception | None = None async def receive_or_disconnect() -> Message: if response_sent.is_set(): return {"type": "http.disconnect"} async with anyio.create_task_group() as task_group: async def wrap(func: typing.Callable[[], typing.Awaitable[T]]) -> T: result = await func() task_group.cancel_scope.cancel() return result task_group.start_soon(wrap, response_sent.wait) message = await wrap(wrapped_receive) if response_sent.is_set(): return {"type": "http.disconnect"} return message async def send_no_error(message: Message) -> None: try: await send_stream.send(message) except anyio.BrokenResourceError: # recv_stream has been closed, i.e. response_sent has been set. return async def coro() -> None: nonlocal app_exc with send_stream: try: await self.app(scope, receive_or_disconnect, send_no_error) except Exception as exc: app_exc = exc task_group.start_soon(coro) try: message = await recv_stream.receive() info = message.get("info", None) if message["type"] == "http.response.debug" and info is not None: message = await recv_stream.receive() except anyio.EndOfStream: if app_exc is not None: raise app_exc raise RuntimeError("No response returned.") assert message["type"] == "http.response.start" async def body_stream() -> typing.AsyncGenerator[bytes, None]: async for message in recv_stream: assert message["type"] == "http.response.body" body = message.get("body", b"") if body: yield body if not message.get("more_body", False): break if app_exc is not None: raise app_exc response = _StreamingResponse(status_code=message["status"], content=body_stream(), info=info) response.raw_headers = message["headers"] return response > send_stream, recv_stream = anyio.create_memory_object_stream[Message]() E TypeError: 'function' object is not subscriptable starlette/middleware/base.py:175: TypeError _ test_read_request_body_in_dispatch_after_app_calls_body_with_middleware_calling_body_before_call_next[asyncio] _ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) def test_read_request_body_in_dispatch_after_app_calls_body_with_middleware_calling_body_before_call_next( test_client_factory: TestClientFactory, ) -> None: async def homepage(request: Request) -> PlainTextResponse: assert await request.body() == b"a" return PlainTextResponse("Homepage") class ConsumingMiddleware(BaseHTTPMiddleware): async def dispatch( self, request: Request, call_next: RequestResponseEndpoint, ) -> Response: assert await request.body() == b"a" # this buffers the request body in memory resp = await call_next(request) assert await request.body() == b"a" # no problem here return resp app = Starlette( routes=[Route("/", homepage, methods=["POST"])], middleware=[Middleware(ConsumingMiddleware)], ) client: TestClient = test_client_factory(app) > response = client.post("/", content=b"a") tests/middleware/test_base.py:830: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:529: in post return super().post( /usr/lib/python3.13/site-packages/httpx/_client.py:1157: in post return self.request( starlette/testclient.py:428: in request return super().request( /usr/lib/python3.13/site-packages/httpx/_client.py:837: in request return self.send(request, auth=auth, follow_redirects=follow_redirects) /usr/lib/python3.13/site-packages/httpx/_client.py:926: in send response = self._send_handling_auth( /usr/lib/python3.13/site-packages/httpx/_client.py:954: in _send_handling_auth response = self._send_handling_redirects( /usr/lib/python3.13/site-packages/httpx/_client.py:991: in _send_handling_redirects response = self._send_single_request(request) /usr/lib/python3.13/site-packages/httpx/_client.py:1027: in _send_single_request response = transport.handle_request(request) starlette/testclient.py:337: in handle_request raise exc starlette/testclient.py:334: in handle_request portal.call(self.app, scope, receive, send) /usr/lib/python3.13/site-packages/anyio/from_thread.py:277: in call return cast(T_Retval, self.start_task_soon(func, *args).result()) /usr/lib64/python3.13/concurrent/futures/_base.py:449: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval starlette/applications.py:112: in __call__ await self.middleware_stack(scope, receive, send) starlette/middleware/errors.py:187: in __call__ raise exc starlette/middleware/errors.py:165: in __call__ await self.app(scope, receive, _send) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = .ConsumingMiddleware object at 0x7f870205e510> scope = {'app': , 'client': ('testclient', 50000), 'extensions': {'...g', b'gzip, deflate'), (b'connection', b'keep-alive'), (b'user-agent', b'testclient'), (b'content-length', b'1')], ...} receive = .receive at 0x7f8701cb9b20> send = ._send at 0x7f8701cba8e0> async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None: if scope["type"] != "http": await self.app(scope, receive, send) return request = _CachedRequest(scope, receive) wrapped_receive = request.wrapped_receive response_sent = anyio.Event() async def call_next(request: Request) -> Response: app_exc: Exception | None = None async def receive_or_disconnect() -> Message: if response_sent.is_set(): return {"type": "http.disconnect"} async with anyio.create_task_group() as task_group: async def wrap(func: typing.Callable[[], typing.Awaitable[T]]) -> T: result = await func() task_group.cancel_scope.cancel() return result task_group.start_soon(wrap, response_sent.wait) message = await wrap(wrapped_receive) if response_sent.is_set(): return {"type": "http.disconnect"} return message async def send_no_error(message: Message) -> None: try: await send_stream.send(message) except anyio.BrokenResourceError: # recv_stream has been closed, i.e. response_sent has been set. return async def coro() -> None: nonlocal app_exc with send_stream: try: await self.app(scope, receive_or_disconnect, send_no_error) except Exception as exc: app_exc = exc task_group.start_soon(coro) try: message = await recv_stream.receive() info = message.get("info", None) if message["type"] == "http.response.debug" and info is not None: message = await recv_stream.receive() except anyio.EndOfStream: if app_exc is not None: raise app_exc raise RuntimeError("No response returned.") assert message["type"] == "http.response.start" async def body_stream() -> typing.AsyncGenerator[bytes, None]: async for message in recv_stream: assert message["type"] == "http.response.body" body = message.get("body", b"") if body: yield body if not message.get("more_body", False): break if app_exc is not None: raise app_exc response = _StreamingResponse(status_code=message["status"], content=body_stream(), info=info) response.raw_headers = message["headers"] return response > send_stream, recv_stream = anyio.create_memory_object_stream[Message]() E TypeError: 'function' object is not subscriptable starlette/middleware/base.py:175: TypeError _ test_read_request_body_in_dispatch_after_app_calls_body_with_middleware_calling_body_before_call_next[trio] _ test_client_factory = functools.partial(, backend='trio', backend_options={}) def test_read_request_body_in_dispatch_after_app_calls_body_with_middleware_calling_body_before_call_next( test_client_factory: TestClientFactory, ) -> None: async def homepage(request: Request) -> PlainTextResponse: assert await request.body() == b"a" return PlainTextResponse("Homepage") class ConsumingMiddleware(BaseHTTPMiddleware): async def dispatch( self, request: Request, call_next: RequestResponseEndpoint, ) -> Response: assert await request.body() == b"a" # this buffers the request body in memory resp = await call_next(request) assert await request.body() == b"a" # no problem here return resp app = Starlette( routes=[Route("/", homepage, methods=["POST"])], middleware=[Middleware(ConsumingMiddleware)], ) client: TestClient = test_client_factory(app) > response = client.post("/", content=b"a") tests/middleware/test_base.py:830: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:529: in post return super().post( /usr/lib/python3.13/site-packages/httpx/_client.py:1157: in post return self.request( starlette/testclient.py:428: in request return super().request( /usr/lib/python3.13/site-packages/httpx/_client.py:837: in request return self.send(request, auth=auth, follow_redirects=follow_redirects) /usr/lib/python3.13/site-packages/httpx/_client.py:926: in send response = self._send_handling_auth( /usr/lib/python3.13/site-packages/httpx/_client.py:954: in _send_handling_auth response = self._send_handling_redirects( /usr/lib/python3.13/site-packages/httpx/_client.py:991: in _send_handling_redirects response = self._send_single_request(request) /usr/lib/python3.13/site-packages/httpx/_client.py:1027: in _send_single_request response = transport.handle_request(request) starlette/testclient.py:337: in handle_request raise exc starlette/testclient.py:334: in handle_request portal.call(self.app, scope, receive, send) /usr/lib/python3.13/site-packages/anyio/from_thread.py:277: in call return cast(T_Retval, self.start_task_soon(func, *args).result()) /usr/lib64/python3.13/concurrent/futures/_base.py:449: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval starlette/applications.py:112: in __call__ await self.middleware_stack(scope, receive, send) starlette/middleware/errors.py:187: in __call__ raise exc starlette/middleware/errors.py:165: in __call__ await self.app(scope, receive, _send) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = .ConsumingMiddleware object at 0x7f87027e6510> scope = {'app': , 'client': ('testclient', 50000), 'extensions': {'...g', b'gzip, deflate'), (b'connection', b'keep-alive'), (b'user-agent', b'testclient'), (b'content-length', b'1')], ...} receive = .receive at 0x7f8701fde8e0> send = ._send at 0x7f8701cba980> async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None: if scope["type"] != "http": await self.app(scope, receive, send) return request = _CachedRequest(scope, receive) wrapped_receive = request.wrapped_receive response_sent = anyio.Event() async def call_next(request: Request) -> Response: app_exc: Exception | None = None async def receive_or_disconnect() -> Message: if response_sent.is_set(): return {"type": "http.disconnect"} async with anyio.create_task_group() as task_group: async def wrap(func: typing.Callable[[], typing.Awaitable[T]]) -> T: result = await func() task_group.cancel_scope.cancel() return result task_group.start_soon(wrap, response_sent.wait) message = await wrap(wrapped_receive) if response_sent.is_set(): return {"type": "http.disconnect"} return message async def send_no_error(message: Message) -> None: try: await send_stream.send(message) except anyio.BrokenResourceError: # recv_stream has been closed, i.e. response_sent has been set. return async def coro() -> None: nonlocal app_exc with send_stream: try: await self.app(scope, receive_or_disconnect, send_no_error) except Exception as exc: app_exc = exc task_group.start_soon(coro) try: message = await recv_stream.receive() info = message.get("info", None) if message["type"] == "http.response.debug" and info is not None: message = await recv_stream.receive() except anyio.EndOfStream: if app_exc is not None: raise app_exc raise RuntimeError("No response returned.") assert message["type"] == "http.response.start" async def body_stream() -> typing.AsyncGenerator[bytes, None]: async for message in recv_stream: assert message["type"] == "http.response.body" body = message.get("body", b"") if body: yield body if not message.get("more_body", False): break if app_exc is not None: raise app_exc response = _StreamingResponse(status_code=message["status"], content=body_stream(), info=info) response.raw_headers = message["headers"] return response > send_stream, recv_stream = anyio.create_memory_object_stream[Message]() E TypeError: 'function' object is not subscriptable starlette/middleware/base.py:175: TypeError ________________ test_read_request_disconnected_client[asyncio] ________________ @pytest.mark.anyio async def test_read_request_disconnected_client() -> None: """If we receive a disconnect message when the downstream ASGI app calls receive() the Request instance passed into the dispatch function should get marked as disconnected. The downstream ASGI app should not get a ClientDisconnect raised, instead if should just receive the disconnect message. """ async def endpoint(scope: Scope, receive: Receive, send: Send) -> None: msg = await receive() assert msg["type"] == "http.disconnect" await Response()(scope, receive, send) class ConsumingMiddleware(BaseHTTPMiddleware): async def dispatch( self, request: Request, call_next: RequestResponseEndpoint, ) -> Response: response = await call_next(request) disconnected = await request.is_disconnected() assert disconnected is True return response scope = {"type": "http", "method": "POST", "path": "/"} async def receive() -> AsyncGenerator[Message, None]: yield {"type": "http.disconnect"} raise AssertionError("Should not be called, would hang") # pragma: no cover async def send(msg: Message) -> None: if msg["type"] == "http.response.start": assert msg["status"] == 200 app: ASGIApp = ConsumingMiddleware(endpoint) rcv = receive() > await app(scope, rcv.__anext__, send) tests/middleware/test_base.py:873: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = .ConsumingMiddleware object at 0x7f870205cec0> scope = {'method': 'POST', 'path': '/', 'type': 'http'} receive = send = .send at 0x7f8701cbb1a0> async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None: if scope["type"] != "http": await self.app(scope, receive, send) return request = _CachedRequest(scope, receive) wrapped_receive = request.wrapped_receive response_sent = anyio.Event() async def call_next(request: Request) -> Response: app_exc: Exception | None = None async def receive_or_disconnect() -> Message: if response_sent.is_set(): return {"type": "http.disconnect"} async with anyio.create_task_group() as task_group: async def wrap(func: typing.Callable[[], typing.Awaitable[T]]) -> T: result = await func() task_group.cancel_scope.cancel() return result task_group.start_soon(wrap, response_sent.wait) message = await wrap(wrapped_receive) if response_sent.is_set(): return {"type": "http.disconnect"} return message async def send_no_error(message: Message) -> None: try: await send_stream.send(message) except anyio.BrokenResourceError: # recv_stream has been closed, i.e. response_sent has been set. return async def coro() -> None: nonlocal app_exc with send_stream: try: await self.app(scope, receive_or_disconnect, send_no_error) except Exception as exc: app_exc = exc task_group.start_soon(coro) try: message = await recv_stream.receive() info = message.get("info", None) if message["type"] == "http.response.debug" and info is not None: message = await recv_stream.receive() except anyio.EndOfStream: if app_exc is not None: raise app_exc raise RuntimeError("No response returned.") assert message["type"] == "http.response.start" async def body_stream() -> typing.AsyncGenerator[bytes, None]: async for message in recv_stream: assert message["type"] == "http.response.body" body = message.get("body", b"") if body: yield body if not message.get("more_body", False): break if app_exc is not None: raise app_exc response = _StreamingResponse(status_code=message["status"], content=body_stream(), info=info) response.raw_headers = message["headers"] return response > send_stream, recv_stream = anyio.create_memory_object_stream[Message]() E TypeError: 'function' object is not subscriptable starlette/middleware/base.py:175: TypeError _________________ test_read_request_disconnected_client[trio] __________________ @pytest.mark.anyio async def test_read_request_disconnected_client() -> None: """If we receive a disconnect message when the downstream ASGI app calls receive() the Request instance passed into the dispatch function should get marked as disconnected. The downstream ASGI app should not get a ClientDisconnect raised, instead if should just receive the disconnect message. """ async def endpoint(scope: Scope, receive: Receive, send: Send) -> None: msg = await receive() assert msg["type"] == "http.disconnect" await Response()(scope, receive, send) class ConsumingMiddleware(BaseHTTPMiddleware): async def dispatch( self, request: Request, call_next: RequestResponseEndpoint, ) -> Response: response = await call_next(request) disconnected = await request.is_disconnected() assert disconnected is True return response scope = {"type": "http", "method": "POST", "path": "/"} async def receive() -> AsyncGenerator[Message, None]: yield {"type": "http.disconnect"} raise AssertionError("Should not be called, would hang") # pragma: no cover async def send(msg: Message) -> None: if msg["type"] == "http.response.start": assert msg["status"] == 200 app: ASGIApp = ConsumingMiddleware(endpoint) rcv = receive() > await app(scope, rcv.__anext__, send) tests/middleware/test_base.py:873: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = .ConsumingMiddleware object at 0x7f870205d6a0> scope = {'method': 'POST', 'path': '/', 'type': 'http'} receive = send = .send at 0x7f8701cb8b80> async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None: if scope["type"] != "http": await self.app(scope, receive, send) return request = _CachedRequest(scope, receive) wrapped_receive = request.wrapped_receive response_sent = anyio.Event() async def call_next(request: Request) -> Response: app_exc: Exception | None = None async def receive_or_disconnect() -> Message: if response_sent.is_set(): return {"type": "http.disconnect"} async with anyio.create_task_group() as task_group: async def wrap(func: typing.Callable[[], typing.Awaitable[T]]) -> T: result = await func() task_group.cancel_scope.cancel() return result task_group.start_soon(wrap, response_sent.wait) message = await wrap(wrapped_receive) if response_sent.is_set(): return {"type": "http.disconnect"} return message async def send_no_error(message: Message) -> None: try: await send_stream.send(message) except anyio.BrokenResourceError: # recv_stream has been closed, i.e. response_sent has been set. return async def coro() -> None: nonlocal app_exc with send_stream: try: await self.app(scope, receive_or_disconnect, send_no_error) except Exception as exc: app_exc = exc task_group.start_soon(coro) try: message = await recv_stream.receive() info = message.get("info", None) if message["type"] == "http.response.debug" and info is not None: message = await recv_stream.receive() except anyio.EndOfStream: if app_exc is not None: raise app_exc raise RuntimeError("No response returned.") assert message["type"] == "http.response.start" async def body_stream() -> typing.AsyncGenerator[bytes, None]: async for message in recv_stream: assert message["type"] == "http.response.body" body = message.get("body", b"") if body: yield body if not message.get("more_body", False): break if app_exc is not None: raise app_exc response = _StreamingResponse(status_code=message["status"], content=body_stream(), info=info) response.raw_headers = message["headers"] return response > send_stream, recv_stream = anyio.create_memory_object_stream[Message]() E TypeError: 'function' object is not subscriptable starlette/middleware/base.py:175: TypeError ________ test_read_request_disconnected_after_consuming_steam[asyncio] _________ @pytest.mark.anyio async def test_read_request_disconnected_after_consuming_steam() -> None: async def endpoint(scope: Scope, receive: Receive, send: Send) -> None: msg = await receive() assert msg.pop("more_body", False) is False assert msg == {"type": "http.request", "body": b"hi"} msg = await receive() assert msg == {"type": "http.disconnect"} await Response()(scope, receive, send) class ConsumingMiddleware(BaseHTTPMiddleware): async def dispatch( self, request: Request, call_next: RequestResponseEndpoint, ) -> Response: await request.body() disconnected = await request.is_disconnected() assert disconnected is True response = await call_next(request) return response scope = {"type": "http", "method": "POST", "path": "/"} async def receive() -> AsyncGenerator[Message, None]: yield {"type": "http.request", "body": b"hi"} yield {"type": "http.disconnect"} raise AssertionError("Should not be called, would hang") # pragma: no cover async def send(msg: Message) -> None: if msg["type"] == "http.response.start": assert msg["status"] == 200 app: ASGIApp = ConsumingMiddleware(endpoint) rcv = receive() > await app(scope, rcv.__anext__, send) tests/middleware/test_base.py:915: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = .ConsumingMiddleware object at 0x7f870205cad0> scope = {'method': 'POST', 'path': '/', 'type': 'http'} receive = send = .send at 0x7f8701cb8220> async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None: if scope["type"] != "http": await self.app(scope, receive, send) return request = _CachedRequest(scope, receive) wrapped_receive = request.wrapped_receive response_sent = anyio.Event() async def call_next(request: Request) -> Response: app_exc: Exception | None = None async def receive_or_disconnect() -> Message: if response_sent.is_set(): return {"type": "http.disconnect"} async with anyio.create_task_group() as task_group: async def wrap(func: typing.Callable[[], typing.Awaitable[T]]) -> T: result = await func() task_group.cancel_scope.cancel() return result task_group.start_soon(wrap, response_sent.wait) message = await wrap(wrapped_receive) if response_sent.is_set(): return {"type": "http.disconnect"} return message async def send_no_error(message: Message) -> None: try: await send_stream.send(message) except anyio.BrokenResourceError: # recv_stream has been closed, i.e. response_sent has been set. return async def coro() -> None: nonlocal app_exc with send_stream: try: await self.app(scope, receive_or_disconnect, send_no_error) except Exception as exc: app_exc = exc task_group.start_soon(coro) try: message = await recv_stream.receive() info = message.get("info", None) if message["type"] == "http.response.debug" and info is not None: message = await recv_stream.receive() except anyio.EndOfStream: if app_exc is not None: raise app_exc raise RuntimeError("No response returned.") assert message["type"] == "http.response.start" async def body_stream() -> typing.AsyncGenerator[bytes, None]: async for message in recv_stream: assert message["type"] == "http.response.body" body = message.get("body", b"") if body: yield body if not message.get("more_body", False): break if app_exc is not None: raise app_exc response = _StreamingResponse(status_code=message["status"], content=body_stream(), info=info) response.raw_headers = message["headers"] return response > send_stream, recv_stream = anyio.create_memory_object_stream[Message]() E TypeError: 'function' object is not subscriptable starlette/middleware/base.py:175: TypeError __________ test_read_request_disconnected_after_consuming_steam[trio] __________ @pytest.mark.anyio async def test_read_request_disconnected_after_consuming_steam() -> None: async def endpoint(scope: Scope, receive: Receive, send: Send) -> None: msg = await receive() assert msg.pop("more_body", False) is False assert msg == {"type": "http.request", "body": b"hi"} msg = await receive() assert msg == {"type": "http.disconnect"} await Response()(scope, receive, send) class ConsumingMiddleware(BaseHTTPMiddleware): async def dispatch( self, request: Request, call_next: RequestResponseEndpoint, ) -> Response: await request.body() disconnected = await request.is_disconnected() assert disconnected is True response = await call_next(request) return response scope = {"type": "http", "method": "POST", "path": "/"} async def receive() -> AsyncGenerator[Message, None]: yield {"type": "http.request", "body": b"hi"} yield {"type": "http.disconnect"} raise AssertionError("Should not be called, would hang") # pragma: no cover async def send(msg: Message) -> None: if msg["type"] == "http.response.start": assert msg["status"] == 200 app: ASGIApp = ConsumingMiddleware(endpoint) rcv = receive() > await app(scope, rcv.__anext__, send) tests/middleware/test_base.py:915: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = .ConsumingMiddleware object at 0x7f870205fcb0> scope = {'method': 'POST', 'path': '/', 'type': 'http'} receive = send = .send at 0x7f8701f9dda0> async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None: if scope["type"] != "http": await self.app(scope, receive, send) return request = _CachedRequest(scope, receive) wrapped_receive = request.wrapped_receive response_sent = anyio.Event() async def call_next(request: Request) -> Response: app_exc: Exception | None = None async def receive_or_disconnect() -> Message: if response_sent.is_set(): return {"type": "http.disconnect"} async with anyio.create_task_group() as task_group: async def wrap(func: typing.Callable[[], typing.Awaitable[T]]) -> T: result = await func() task_group.cancel_scope.cancel() return result task_group.start_soon(wrap, response_sent.wait) message = await wrap(wrapped_receive) if response_sent.is_set(): return {"type": "http.disconnect"} return message async def send_no_error(message: Message) -> None: try: await send_stream.send(message) except anyio.BrokenResourceError: # recv_stream has been closed, i.e. response_sent has been set. return async def coro() -> None: nonlocal app_exc with send_stream: try: await self.app(scope, receive_or_disconnect, send_no_error) except Exception as exc: app_exc = exc task_group.start_soon(coro) try: message = await recv_stream.receive() info = message.get("info", None) if message["type"] == "http.response.debug" and info is not None: message = await recv_stream.receive() except anyio.EndOfStream: if app_exc is not None: raise app_exc raise RuntimeError("No response returned.") assert message["type"] == "http.response.start" async def body_stream() -> typing.AsyncGenerator[bytes, None]: async for message in recv_stream: assert message["type"] == "http.response.body" body = message.get("body", b"") if body: yield body if not message.get("more_body", False): break if app_exc is not None: raise app_exc response = _StreamingResponse(status_code=message["status"], content=body_stream(), info=info) response.raw_headers = message["headers"] return response > send_stream, recv_stream = anyio.create_memory_object_stream[Message]() E TypeError: 'function' object is not subscriptable starlette/middleware/base.py:175: TypeError _____________ test_downstream_middleware_modifies_receive[asyncio] _____________ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) def test_downstream_middleware_modifies_receive( test_client_factory: TestClientFactory, ) -> None: """If a downstream middleware modifies receive() the final ASGI app should see the modified version. """ async def endpoint(scope: Scope, receive: Receive, send: Send) -> None: request = Request(scope, receive) body = await request.body() assert body == b"foo foo " await Response()(scope, receive, send) class ConsumingMiddleware(BaseHTTPMiddleware): async def dispatch( self, request: Request, call_next: RequestResponseEndpoint, ) -> Response: body = await request.body() assert body == b"foo " return await call_next(request) def modifying_middleware(app: ASGIApp) -> ASGIApp: async def wrapped_app(scope: Scope, receive: Receive, send: Send) -> None: async def wrapped_receive() -> Message: msg = await receive() if msg["type"] == "http.request": # pragma: no branch msg["body"] = msg["body"] * 2 return msg await app(scope, wrapped_receive, send) return wrapped_app client = test_client_factory(ConsumingMiddleware(modifying_middleware(endpoint))) > resp = client.post("/", content=b"foo ") tests/middleware/test_base.py:957: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:529: in post return super().post( /usr/lib/python3.13/site-packages/httpx/_client.py:1157: in post return self.request( starlette/testclient.py:428: in request return super().request( /usr/lib/python3.13/site-packages/httpx/_client.py:837: in request return self.send(request, auth=auth, follow_redirects=follow_redirects) /usr/lib/python3.13/site-packages/httpx/_client.py:926: in send response = self._send_handling_auth( /usr/lib/python3.13/site-packages/httpx/_client.py:954: in _send_handling_auth response = self._send_handling_redirects( /usr/lib/python3.13/site-packages/httpx/_client.py:991: in _send_handling_redirects response = self._send_single_request(request) /usr/lib/python3.13/site-packages/httpx/_client.py:1027: in _send_single_request response = transport.handle_request(request) starlette/testclient.py:337: in handle_request raise exc starlette/testclient.py:334: in handle_request portal.call(self.app, scope, receive, send) /usr/lib/python3.13/site-packages/anyio/from_thread.py:277: in call return cast(T_Retval, self.start_task_soon(func, *args).result()) /usr/lib64/python3.13/concurrent/futures/_base.py:449: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = .ConsumingMiddleware object at 0x7f870205e900> scope = {'client': ('testclient', 50000), 'extensions': {'http.response.debug': {}}, 'headers': [(b'host', b'testserver'), (b'...(b'connection', b'keep-alive'), (b'user-agent', b'testclient'), (b'content-length', b'4')], 'http_version': '1.1', ...} receive = .receive at 0x7f8701f9da80> send = .send at 0x7f8701f9d800> async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None: if scope["type"] != "http": await self.app(scope, receive, send) return request = _CachedRequest(scope, receive) wrapped_receive = request.wrapped_receive response_sent = anyio.Event() async def call_next(request: Request) -> Response: app_exc: Exception | None = None async def receive_or_disconnect() -> Message: if response_sent.is_set(): return {"type": "http.disconnect"} async with anyio.create_task_group() as task_group: async def wrap(func: typing.Callable[[], typing.Awaitable[T]]) -> T: result = await func() task_group.cancel_scope.cancel() return result task_group.start_soon(wrap, response_sent.wait) message = await wrap(wrapped_receive) if response_sent.is_set(): return {"type": "http.disconnect"} return message async def send_no_error(message: Message) -> None: try: await send_stream.send(message) except anyio.BrokenResourceError: # recv_stream has been closed, i.e. response_sent has been set. return async def coro() -> None: nonlocal app_exc with send_stream: try: await self.app(scope, receive_or_disconnect, send_no_error) except Exception as exc: app_exc = exc task_group.start_soon(coro) try: message = await recv_stream.receive() info = message.get("info", None) if message["type"] == "http.response.debug" and info is not None: message = await recv_stream.receive() except anyio.EndOfStream: if app_exc is not None: raise app_exc raise RuntimeError("No response returned.") assert message["type"] == "http.response.start" async def body_stream() -> typing.AsyncGenerator[bytes, None]: async for message in recv_stream: assert message["type"] == "http.response.body" body = message.get("body", b"") if body: yield body if not message.get("more_body", False): break if app_exc is not None: raise app_exc response = _StreamingResponse(status_code=message["status"], content=body_stream(), info=info) response.raw_headers = message["headers"] return response > send_stream, recv_stream = anyio.create_memory_object_stream[Message]() E TypeError: 'function' object is not subscriptable starlette/middleware/base.py:175: TypeError ______________ test_downstream_middleware_modifies_receive[trio] _______________ test_client_factory = functools.partial(, backend='trio', backend_options={}) def test_downstream_middleware_modifies_receive( test_client_factory: TestClientFactory, ) -> None: """If a downstream middleware modifies receive() the final ASGI app should see the modified version. """ async def endpoint(scope: Scope, receive: Receive, send: Send) -> None: request = Request(scope, receive) body = await request.body() assert body == b"foo foo " await Response()(scope, receive, send) class ConsumingMiddleware(BaseHTTPMiddleware): async def dispatch( self, request: Request, call_next: RequestResponseEndpoint, ) -> Response: body = await request.body() assert body == b"foo " return await call_next(request) def modifying_middleware(app: ASGIApp) -> ASGIApp: async def wrapped_app(scope: Scope, receive: Receive, send: Send) -> None: async def wrapped_receive() -> Message: msg = await receive() if msg["type"] == "http.request": # pragma: no branch msg["body"] = msg["body"] * 2 return msg await app(scope, wrapped_receive, send) return wrapped_app client = test_client_factory(ConsumingMiddleware(modifying_middleware(endpoint))) > resp = client.post("/", content=b"foo ") tests/middleware/test_base.py:957: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:529: in post return super().post( /usr/lib/python3.13/site-packages/httpx/_client.py:1157: in post return self.request( starlette/testclient.py:428: in request return super().request( /usr/lib/python3.13/site-packages/httpx/_client.py:837: in request return self.send(request, auth=auth, follow_redirects=follow_redirects) /usr/lib/python3.13/site-packages/httpx/_client.py:926: in send response = self._send_handling_auth( /usr/lib/python3.13/site-packages/httpx/_client.py:954: in _send_handling_auth response = self._send_handling_redirects( /usr/lib/python3.13/site-packages/httpx/_client.py:991: in _send_handling_redirects response = self._send_single_request(request) /usr/lib/python3.13/site-packages/httpx/_client.py:1027: in _send_single_request response = transport.handle_request(request) starlette/testclient.py:337: in handle_request raise exc starlette/testclient.py:334: in handle_request portal.call(self.app, scope, receive, send) /usr/lib/python3.13/site-packages/anyio/from_thread.py:277: in call return cast(T_Retval, self.start_task_soon(func, *args).result()) /usr/lib64/python3.13/concurrent/futures/_base.py:449: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = .ConsumingMiddleware object at 0x7f870205cad0> scope = {'client': ('testclient', 50000), 'extensions': {'http.response.debug': {}}, 'headers': [(b'host', b'testserver'), (b'...(b'connection', b'keep-alive'), (b'user-agent', b'testclient'), (b'content-length', b'4')], 'http_version': '1.1', ...} receive = .receive at 0x7f8701cb91c0> send = .send at 0x7f8701cb8220> async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None: if scope["type"] != "http": await self.app(scope, receive, send) return request = _CachedRequest(scope, receive) wrapped_receive = request.wrapped_receive response_sent = anyio.Event() async def call_next(request: Request) -> Response: app_exc: Exception | None = None async def receive_or_disconnect() -> Message: if response_sent.is_set(): return {"type": "http.disconnect"} async with anyio.create_task_group() as task_group: async def wrap(func: typing.Callable[[], typing.Awaitable[T]]) -> T: result = await func() task_group.cancel_scope.cancel() return result task_group.start_soon(wrap, response_sent.wait) message = await wrap(wrapped_receive) if response_sent.is_set(): return {"type": "http.disconnect"} return message async def send_no_error(message: Message) -> None: try: await send_stream.send(message) except anyio.BrokenResourceError: # recv_stream has been closed, i.e. response_sent has been set. return async def coro() -> None: nonlocal app_exc with send_stream: try: await self.app(scope, receive_or_disconnect, send_no_error) except Exception as exc: app_exc = exc task_group.start_soon(coro) try: message = await recv_stream.receive() info = message.get("info", None) if message["type"] == "http.response.debug" and info is not None: message = await recv_stream.receive() except anyio.EndOfStream: if app_exc is not None: raise app_exc raise RuntimeError("No response returned.") assert message["type"] == "http.response.start" async def body_stream() -> typing.AsyncGenerator[bytes, None]: async for message in recv_stream: assert message["type"] == "http.response.body" body = message.get("body", b"") if body: yield body if not message.get("more_body", False): break if app_exc is not None: raise app_exc response = _StreamingResponse(status_code=message["status"], content=body_stream(), info=info) response.raw_headers = message["headers"] return response > send_stream, recv_stream = anyio.create_memory_object_stream[Message]() E TypeError: 'function' object is not subscriptable starlette/middleware/base.py:175: TypeError ___________________ test_pr_1519_comment_1236166180_example ____________________ def test_pr_1519_comment_1236166180_example() -> None: """ https://github.com/encode/starlette/pull/1519#issuecomment-1236166180 """ bodies: list[bytes] = [] class LogRequestBodySize(BaseHTTPMiddleware): async def dispatch( self, request: Request, call_next: RequestResponseEndpoint, ) -> Response: print(len(await request.body())) return await call_next(request) def replace_body_middleware(app: ASGIApp) -> ASGIApp: async def wrapped_app(scope: Scope, receive: Receive, send: Send) -> None: async def wrapped_rcv() -> Message: msg = await receive() msg["body"] += b"-foo" return msg await app(scope, wrapped_rcv, send) return wrapped_app async def endpoint(request: Request) -> Response: body = await request.body() bodies.append(body) return Response() app: ASGIApp = Starlette(routes=[Route("/", endpoint, methods=["POST"])]) app = replace_body_middleware(app) app = LogRequestBodySize(app) client = TestClient(app) > resp = client.post("/", content=b"Hello, World!") tests/middleware/test_base.py:997: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:529: in post return super().post( /usr/lib/python3.13/site-packages/httpx/_client.py:1157: in post return self.request( starlette/testclient.py:428: in request return super().request( /usr/lib/python3.13/site-packages/httpx/_client.py:837: in request return self.send(request, auth=auth, follow_redirects=follow_redirects) /usr/lib/python3.13/site-packages/httpx/_client.py:926: in send response = self._send_handling_auth( /usr/lib/python3.13/site-packages/httpx/_client.py:954: in _send_handling_auth response = self._send_handling_redirects( /usr/lib/python3.13/site-packages/httpx/_client.py:991: in _send_handling_redirects response = self._send_single_request(request) /usr/lib/python3.13/site-packages/httpx/_client.py:1027: in _send_single_request response = transport.handle_request(request) starlette/testclient.py:337: in handle_request raise exc starlette/testclient.py:334: in handle_request portal.call(self.app, scope, receive, send) /usr/lib/python3.13/site-packages/anyio/from_thread.py:277: in call return cast(T_Retval, self.start_task_soon(func, *args).result()) /usr/lib64/python3.13/concurrent/futures/_base.py:456: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = .LogRequestBodySize object at 0x7f870205c590> scope = {'client': ('testclient', 50000), 'extensions': {'http.response.debug': {}}, 'headers': [(b'host', b'testserver'), (b'...b'connection', b'keep-alive'), (b'user-agent', b'testclient'), (b'content-length', b'13')], 'http_version': '1.1', ...} receive = .receive at 0x7f8701cbb240> send = .send at 0x7f8701cba520> async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None: if scope["type"] != "http": await self.app(scope, receive, send) return request = _CachedRequest(scope, receive) wrapped_receive = request.wrapped_receive response_sent = anyio.Event() async def call_next(request: Request) -> Response: app_exc: Exception | None = None async def receive_or_disconnect() -> Message: if response_sent.is_set(): return {"type": "http.disconnect"} async with anyio.create_task_group() as task_group: async def wrap(func: typing.Callable[[], typing.Awaitable[T]]) -> T: result = await func() task_group.cancel_scope.cancel() return result task_group.start_soon(wrap, response_sent.wait) message = await wrap(wrapped_receive) if response_sent.is_set(): return {"type": "http.disconnect"} return message async def send_no_error(message: Message) -> None: try: await send_stream.send(message) except anyio.BrokenResourceError: # recv_stream has been closed, i.e. response_sent has been set. return async def coro() -> None: nonlocal app_exc with send_stream: try: await self.app(scope, receive_or_disconnect, send_no_error) except Exception as exc: app_exc = exc task_group.start_soon(coro) try: message = await recv_stream.receive() info = message.get("info", None) if message["type"] == "http.response.debug" and info is not None: message = await recv_stream.receive() except anyio.EndOfStream: if app_exc is not None: raise app_exc raise RuntimeError("No response returned.") assert message["type"] == "http.response.start" async def body_stream() -> typing.AsyncGenerator[bytes, None]: async for message in recv_stream: assert message["type"] == "http.response.body" body = message.get("body", b"") if body: yield body if not message.get("more_body", False): break if app_exc is not None: raise app_exc response = _StreamingResponse(status_code=message["status"], content=body_stream(), info=info) response.raw_headers = message["headers"] return response > send_stream, recv_stream = anyio.create_memory_object_stream[Message]() E TypeError: 'function' object is not subscriptable starlette/middleware/base.py:175: TypeError ________ test_multiple_middlewares_stacked_client_disconnected[asyncio] ________ @pytest.mark.anyio async def test_multiple_middlewares_stacked_client_disconnected() -> None: """ Tests for: - https://github.com/encode/starlette/issues/2516 - https://github.com/encode/starlette/pull/2687 """ ordered_events: list[str] = [] unordered_events: list[str] = [] class MyMiddleware(BaseHTTPMiddleware): def __init__(self, app: ASGIApp, version: int) -> None: self.version = version super().__init__(app) async def dispatch(self, request: Request, call_next: RequestResponseEndpoint) -> Response: ordered_events.append(f"{self.version}:STARTED") res = await call_next(request) ordered_events.append(f"{self.version}:COMPLETED") def background() -> None: unordered_events.append(f"{self.version}:BACKGROUND") assert res.background is None res.background = BackgroundTask(background) return res async def sleepy(request: Request) -> Response: try: await request.body() except ClientDisconnect: pass else: # pragma: no cover raise AssertionError("Should have raised ClientDisconnect") return Response(b"") app = Starlette( routes=[Route("/", sleepy)], middleware=[Middleware(MyMiddleware, version=_ + 1) for _ in range(10)], ) scope = { "type": "http", "version": "3", "method": "GET", "path": "/", } async def receive() -> AsyncIterator[Message]: yield {"type": "http.disconnect"} sent: list[Message] = [] async def send(message: Message) -> None: sent.append(message) > await app(scope, receive().__anext__, send) tests/middleware/test_base.py:1059: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/applications.py:112: in __call__ await self.middleware_stack(scope, receive, send) starlette/middleware/errors.py:187: in __call__ raise exc starlette/middleware/errors.py:165: in __call__ await self.app(scope, receive, _send) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = .MyMiddleware object at 0x7f8701fef650> scope = {'app': , 'method': 'GET', 'path': '/', 'type': 'http', ...} receive = send = ._send at 0x7f8701cb84a0> async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None: if scope["type"] != "http": await self.app(scope, receive, send) return request = _CachedRequest(scope, receive) wrapped_receive = request.wrapped_receive response_sent = anyio.Event() async def call_next(request: Request) -> Response: app_exc: Exception | None = None async def receive_or_disconnect() -> Message: if response_sent.is_set(): return {"type": "http.disconnect"} async with anyio.create_task_group() as task_group: async def wrap(func: typing.Callable[[], typing.Awaitable[T]]) -> T: result = await func() task_group.cancel_scope.cancel() return result task_group.start_soon(wrap, response_sent.wait) message = await wrap(wrapped_receive) if response_sent.is_set(): return {"type": "http.disconnect"} return message async def send_no_error(message: Message) -> None: try: await send_stream.send(message) except anyio.BrokenResourceError: # recv_stream has been closed, i.e. response_sent has been set. return async def coro() -> None: nonlocal app_exc with send_stream: try: await self.app(scope, receive_or_disconnect, send_no_error) except Exception as exc: app_exc = exc task_group.start_soon(coro) try: message = await recv_stream.receive() info = message.get("info", None) if message["type"] == "http.response.debug" and info is not None: message = await recv_stream.receive() except anyio.EndOfStream: if app_exc is not None: raise app_exc raise RuntimeError("No response returned.") assert message["type"] == "http.response.start" async def body_stream() -> typing.AsyncGenerator[bytes, None]: async for message in recv_stream: assert message["type"] == "http.response.body" body = message.get("body", b"") if body: yield body if not message.get("more_body", False): break if app_exc is not None: raise app_exc response = _StreamingResponse(status_code=message["status"], content=body_stream(), info=info) response.raw_headers = message["headers"] return response > send_stream, recv_stream = anyio.create_memory_object_stream[Message]() E TypeError: 'function' object is not subscriptable starlette/middleware/base.py:175: TypeError _________ test_multiple_middlewares_stacked_client_disconnected[trio] __________ @pytest.mark.anyio async def test_multiple_middlewares_stacked_client_disconnected() -> None: """ Tests for: - https://github.com/encode/starlette/issues/2516 - https://github.com/encode/starlette/pull/2687 """ ordered_events: list[str] = [] unordered_events: list[str] = [] class MyMiddleware(BaseHTTPMiddleware): def __init__(self, app: ASGIApp, version: int) -> None: self.version = version super().__init__(app) async def dispatch(self, request: Request, call_next: RequestResponseEndpoint) -> Response: ordered_events.append(f"{self.version}:STARTED") res = await call_next(request) ordered_events.append(f"{self.version}:COMPLETED") def background() -> None: unordered_events.append(f"{self.version}:BACKGROUND") assert res.background is None res.background = BackgroundTask(background) return res async def sleepy(request: Request) -> Response: try: await request.body() except ClientDisconnect: pass else: # pragma: no cover raise AssertionError("Should have raised ClientDisconnect") return Response(b"") app = Starlette( routes=[Route("/", sleepy)], middleware=[Middleware(MyMiddleware, version=_ + 1) for _ in range(10)], ) scope = { "type": "http", "version": "3", "method": "GET", "path": "/", } async def receive() -> AsyncIterator[Message]: yield {"type": "http.disconnect"} sent: list[Message] = [] async def send(message: Message) -> None: sent.append(message) > await app(scope, receive().__anext__, send) tests/middleware/test_base.py:1059: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/applications.py:112: in __call__ await self.middleware_stack(scope, receive, send) starlette/middleware/errors.py:187: in __call__ raise exc starlette/middleware/errors.py:165: in __call__ await self.app(scope, receive, _send) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = .MyMiddleware object at 0x7f8701fef550> scope = {'app': , 'method': 'GET', 'path': '/', 'type': 'http', ...} receive = send = ._send at 0x7f8701f9d9e0> async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None: if scope["type"] != "http": await self.app(scope, receive, send) return request = _CachedRequest(scope, receive) wrapped_receive = request.wrapped_receive response_sent = anyio.Event() async def call_next(request: Request) -> Response: app_exc: Exception | None = None async def receive_or_disconnect() -> Message: if response_sent.is_set(): return {"type": "http.disconnect"} async with anyio.create_task_group() as task_group: async def wrap(func: typing.Callable[[], typing.Awaitable[T]]) -> T: result = await func() task_group.cancel_scope.cancel() return result task_group.start_soon(wrap, response_sent.wait) message = await wrap(wrapped_receive) if response_sent.is_set(): return {"type": "http.disconnect"} return message async def send_no_error(message: Message) -> None: try: await send_stream.send(message) except anyio.BrokenResourceError: # recv_stream has been closed, i.e. response_sent has been set. return async def coro() -> None: nonlocal app_exc with send_stream: try: await self.app(scope, receive_or_disconnect, send_no_error) except Exception as exc: app_exc = exc task_group.start_soon(coro) try: message = await recv_stream.receive() info = message.get("info", None) if message["type"] == "http.response.debug" and info is not None: message = await recv_stream.receive() except anyio.EndOfStream: if app_exc is not None: raise app_exc raise RuntimeError("No response returned.") assert message["type"] == "http.response.start" async def body_stream() -> typing.AsyncGenerator[bytes, None]: async for message in recv_stream: assert message["type"] == "http.response.body" body = message.get("body", b"") if body: yield body if not message.get("more_body", False): break if app_exc is not None: raise app_exc response = _StreamingResponse(status_code=message["status"], content=body_stream(), info=info) response.raw_headers = message["headers"] return response > send_stream, recv_stream = anyio.create_memory_object_stream[Message]() E TypeError: 'function' object is not subscriptable starlette/middleware/base.py:175: TypeError _______________ test_poll_for_disconnect_repeated[asyncio-True] ________________ send_body = True @pytest.mark.anyio @pytest.mark.parametrize("send_body", [True, False]) async def test_poll_for_disconnect_repeated(send_body: bool) -> None: async def app_poll_disconnect(scope: Scope, receive: Receive, send: Send) -> None: for _ in range(2): msg = await receive() while msg["type"] == "http.request": msg = await receive() assert msg["type"] == "http.disconnect" await Response(b"good!")(scope, receive, send) class MyMiddleware(BaseHTTPMiddleware): async def dispatch(self, request: Request, call_next: RequestResponseEndpoint) -> Response: return await call_next(request) app = MyMiddleware(app_poll_disconnect) scope = { "type": "http", "version": "3", "method": "GET", "path": "/", } async def receive() -> AsyncIterator[Message]: # the key here is that we only ever send 1 htt.disconnect message if send_body: yield {"type": "http.request", "body": b"hello", "more_body": True} yield {"type": "http.request", "body": b"", "more_body": False} yield {"type": "http.disconnect"} raise AssertionError("Should not be called, would hang") # pragma: no cover sent: list[Message] = [] async def send(message: Message) -> None: sent.append(message) > await app(scope, receive().__anext__, send) tests/middleware/test_base.py:1146: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = .MyMiddleware object at 0x7f870205d2b0> scope = {'method': 'GET', 'path': '/', 'type': 'http', 'version': '3'} receive = send = .send at 0x7f8701f9c720> async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None: if scope["type"] != "http": await self.app(scope, receive, send) return request = _CachedRequest(scope, receive) wrapped_receive = request.wrapped_receive response_sent = anyio.Event() async def call_next(request: Request) -> Response: app_exc: Exception | None = None async def receive_or_disconnect() -> Message: if response_sent.is_set(): return {"type": "http.disconnect"} async with anyio.create_task_group() as task_group: async def wrap(func: typing.Callable[[], typing.Awaitable[T]]) -> T: result = await func() task_group.cancel_scope.cancel() return result task_group.start_soon(wrap, response_sent.wait) message = await wrap(wrapped_receive) if response_sent.is_set(): return {"type": "http.disconnect"} return message async def send_no_error(message: Message) -> None: try: await send_stream.send(message) except anyio.BrokenResourceError: # recv_stream has been closed, i.e. response_sent has been set. return async def coro() -> None: nonlocal app_exc with send_stream: try: await self.app(scope, receive_or_disconnect, send_no_error) except Exception as exc: app_exc = exc task_group.start_soon(coro) try: message = await recv_stream.receive() info = message.get("info", None) if message["type"] == "http.response.debug" and info is not None: message = await recv_stream.receive() except anyio.EndOfStream: if app_exc is not None: raise app_exc raise RuntimeError("No response returned.") assert message["type"] == "http.response.start" async def body_stream() -> typing.AsyncGenerator[bytes, None]: async for message in recv_stream: assert message["type"] == "http.response.body" body = message.get("body", b"") if body: yield body if not message.get("more_body", False): break if app_exc is not None: raise app_exc response = _StreamingResponse(status_code=message["status"], content=body_stream(), info=info) response.raw_headers = message["headers"] return response > send_stream, recv_stream = anyio.create_memory_object_stream[Message]() E TypeError: 'function' object is not subscriptable starlette/middleware/base.py:175: TypeError _______________ test_poll_for_disconnect_repeated[asyncio-False] _______________ send_body = False @pytest.mark.anyio @pytest.mark.parametrize("send_body", [True, False]) async def test_poll_for_disconnect_repeated(send_body: bool) -> None: async def app_poll_disconnect(scope: Scope, receive: Receive, send: Send) -> None: for _ in range(2): msg = await receive() while msg["type"] == "http.request": msg = await receive() assert msg["type"] == "http.disconnect" await Response(b"good!")(scope, receive, send) class MyMiddleware(BaseHTTPMiddleware): async def dispatch(self, request: Request, call_next: RequestResponseEndpoint) -> Response: return await call_next(request) app = MyMiddleware(app_poll_disconnect) scope = { "type": "http", "version": "3", "method": "GET", "path": "/", } async def receive() -> AsyncIterator[Message]: # the key here is that we only ever send 1 htt.disconnect message if send_body: yield {"type": "http.request", "body": b"hello", "more_body": True} yield {"type": "http.request", "body": b"", "more_body": False} yield {"type": "http.disconnect"} raise AssertionError("Should not be called, would hang") # pragma: no cover sent: list[Message] = [] async def send(message: Message) -> None: sent.append(message) > await app(scope, receive().__anext__, send) tests/middleware/test_base.py:1146: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = .MyMiddleware object at 0x7f870205d400> scope = {'method': 'GET', 'path': '/', 'type': 'http', 'version': '3'} receive = send = .send at 0x7f8701c944a0> async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None: if scope["type"] != "http": await self.app(scope, receive, send) return request = _CachedRequest(scope, receive) wrapped_receive = request.wrapped_receive response_sent = anyio.Event() async def call_next(request: Request) -> Response: app_exc: Exception | None = None async def receive_or_disconnect() -> Message: if response_sent.is_set(): return {"type": "http.disconnect"} async with anyio.create_task_group() as task_group: async def wrap(func: typing.Callable[[], typing.Awaitable[T]]) -> T: result = await func() task_group.cancel_scope.cancel() return result task_group.start_soon(wrap, response_sent.wait) message = await wrap(wrapped_receive) if response_sent.is_set(): return {"type": "http.disconnect"} return message async def send_no_error(message: Message) -> None: try: await send_stream.send(message) except anyio.BrokenResourceError: # recv_stream has been closed, i.e. response_sent has been set. return async def coro() -> None: nonlocal app_exc with send_stream: try: await self.app(scope, receive_or_disconnect, send_no_error) except Exception as exc: app_exc = exc task_group.start_soon(coro) try: message = await recv_stream.receive() info = message.get("info", None) if message["type"] == "http.response.debug" and info is not None: message = await recv_stream.receive() except anyio.EndOfStream: if app_exc is not None: raise app_exc raise RuntimeError("No response returned.") assert message["type"] == "http.response.start" async def body_stream() -> typing.AsyncGenerator[bytes, None]: async for message in recv_stream: assert message["type"] == "http.response.body" body = message.get("body", b"") if body: yield body if not message.get("more_body", False): break if app_exc is not None: raise app_exc response = _StreamingResponse(status_code=message["status"], content=body_stream(), info=info) response.raw_headers = message["headers"] return response > send_stream, recv_stream = anyio.create_memory_object_stream[Message]() E TypeError: 'function' object is not subscriptable starlette/middleware/base.py:175: TypeError _________________ test_poll_for_disconnect_repeated[trio-True] _________________ send_body = True @pytest.mark.anyio @pytest.mark.parametrize("send_body", [True, False]) async def test_poll_for_disconnect_repeated(send_body: bool) -> None: async def app_poll_disconnect(scope: Scope, receive: Receive, send: Send) -> None: for _ in range(2): msg = await receive() while msg["type"] == "http.request": msg = await receive() assert msg["type"] == "http.disconnect" await Response(b"good!")(scope, receive, send) class MyMiddleware(BaseHTTPMiddleware): async def dispatch(self, request: Request, call_next: RequestResponseEndpoint) -> Response: return await call_next(request) app = MyMiddleware(app_poll_disconnect) scope = { "type": "http", "version": "3", "method": "GET", "path": "/", } async def receive() -> AsyncIterator[Message]: # the key here is that we only ever send 1 htt.disconnect message if send_body: yield {"type": "http.request", "body": b"hello", "more_body": True} yield {"type": "http.request", "body": b"", "more_body": False} yield {"type": "http.disconnect"} raise AssertionError("Should not be called, would hang") # pragma: no cover sent: list[Message] = [] async def send(message: Message) -> None: sent.append(message) > await app(scope, receive().__anext__, send) tests/middleware/test_base.py:1146: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = .MyMiddleware object at 0x7f870205c980> scope = {'method': 'GET', 'path': '/', 'type': 'http', 'version': '3'} receive = send = .send at 0x7f8701f9ce00> async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None: if scope["type"] != "http": await self.app(scope, receive, send) return request = _CachedRequest(scope, receive) wrapped_receive = request.wrapped_receive response_sent = anyio.Event() async def call_next(request: Request) -> Response: app_exc: Exception | None = None async def receive_or_disconnect() -> Message: if response_sent.is_set(): return {"type": "http.disconnect"} async with anyio.create_task_group() as task_group: async def wrap(func: typing.Callable[[], typing.Awaitable[T]]) -> T: result = await func() task_group.cancel_scope.cancel() return result task_group.start_soon(wrap, response_sent.wait) message = await wrap(wrapped_receive) if response_sent.is_set(): return {"type": "http.disconnect"} return message async def send_no_error(message: Message) -> None: try: await send_stream.send(message) except anyio.BrokenResourceError: # recv_stream has been closed, i.e. response_sent has been set. return async def coro() -> None: nonlocal app_exc with send_stream: try: await self.app(scope, receive_or_disconnect, send_no_error) except Exception as exc: app_exc = exc task_group.start_soon(coro) try: message = await recv_stream.receive() info = message.get("info", None) if message["type"] == "http.response.debug" and info is not None: message = await recv_stream.receive() except anyio.EndOfStream: if app_exc is not None: raise app_exc raise RuntimeError("No response returned.") assert message["type"] == "http.response.start" async def body_stream() -> typing.AsyncGenerator[bytes, None]: async for message in recv_stream: assert message["type"] == "http.response.body" body = message.get("body", b"") if body: yield body if not message.get("more_body", False): break if app_exc is not None: raise app_exc response = _StreamingResponse(status_code=message["status"], content=body_stream(), info=info) response.raw_headers = message["headers"] return response > send_stream, recv_stream = anyio.create_memory_object_stream[Message]() E TypeError: 'function' object is not subscriptable starlette/middleware/base.py:175: TypeError ________________ test_poll_for_disconnect_repeated[trio-False] _________________ send_body = False @pytest.mark.anyio @pytest.mark.parametrize("send_body", [True, False]) async def test_poll_for_disconnect_repeated(send_body: bool) -> None: async def app_poll_disconnect(scope: Scope, receive: Receive, send: Send) -> None: for _ in range(2): msg = await receive() while msg["type"] == "http.request": msg = await receive() assert msg["type"] == "http.disconnect" await Response(b"good!")(scope, receive, send) class MyMiddleware(BaseHTTPMiddleware): async def dispatch(self, request: Request, call_next: RequestResponseEndpoint) -> Response: return await call_next(request) app = MyMiddleware(app_poll_disconnect) scope = { "type": "http", "version": "3", "method": "GET", "path": "/", } async def receive() -> AsyncIterator[Message]: # the key here is that we only ever send 1 htt.disconnect message if send_body: yield {"type": "http.request", "body": b"hello", "more_body": True} yield {"type": "http.request", "body": b"", "more_body": False} yield {"type": "http.disconnect"} raise AssertionError("Should not be called, would hang") # pragma: no cover sent: list[Message] = [] async def send(message: Message) -> None: sent.append(message) > await app(scope, receive().__anext__, send) tests/middleware/test_base.py:1146: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = .MyMiddleware object at 0x7f870205fcb0> scope = {'method': 'GET', 'path': '/', 'type': 'http', 'version': '3'} receive = send = .send at 0x7f8701f9d940> async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None: if scope["type"] != "http": await self.app(scope, receive, send) return request = _CachedRequest(scope, receive) wrapped_receive = request.wrapped_receive response_sent = anyio.Event() async def call_next(request: Request) -> Response: app_exc: Exception | None = None async def receive_or_disconnect() -> Message: if response_sent.is_set(): return {"type": "http.disconnect"} async with anyio.create_task_group() as task_group: async def wrap(func: typing.Callable[[], typing.Awaitable[T]]) -> T: result = await func() task_group.cancel_scope.cancel() return result task_group.start_soon(wrap, response_sent.wait) message = await wrap(wrapped_receive) if response_sent.is_set(): return {"type": "http.disconnect"} return message async def send_no_error(message: Message) -> None: try: await send_stream.send(message) except anyio.BrokenResourceError: # recv_stream has been closed, i.e. response_sent has been set. return async def coro() -> None: nonlocal app_exc with send_stream: try: await self.app(scope, receive_or_disconnect, send_no_error) except Exception as exc: app_exc = exc task_group.start_soon(coro) try: message = await recv_stream.receive() info = message.get("info", None) if message["type"] == "http.response.debug" and info is not None: message = await recv_stream.receive() except anyio.EndOfStream: if app_exc is not None: raise app_exc raise RuntimeError("No response returned.") assert message["type"] == "http.response.start" async def body_stream() -> typing.AsyncGenerator[bytes, None]: async for message in recv_stream: assert message["type"] == "http.response.body" body = message.get("body", b"") if body: yield body if not message.get("more_body", False): break if app_exc is not None: raise app_exc response = _StreamingResponse(status_code=message["status"], content=body_stream(), info=info) response.raw_headers = message["headers"] return response > send_stream, recv_stream = anyio.create_memory_object_stream[Message]() E TypeError: 'function' object is not subscriptable starlette/middleware/base.py:175: TypeError _________________________ test_debug_not_http[asyncio] _________________________ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) def test_debug_not_http(test_client_factory: TestClientFactory) -> None: """ DebugMiddleware should just pass through any non-http messages as-is. """ async def app(scope: Scope, receive: Receive, send: Send) -> None: raise RuntimeError("Something went wrong") app = ServerErrorMiddleware(app) with pytest.raises(RuntimeError): client = test_client_factory(app) > with client.websocket_connect("/"): tests/middleware/test_errors.py:79: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:101: in __enter__ fut, cs = portal.start_task(self._run) /usr/lib/python3.13/site-packages/anyio/from_thread.py:405: in start_task return f, task_status_future.result() /usr/lib64/python3.13/concurrent/futures/_base.py:456: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = async def _run(self, *, task_status: anyio.abc.TaskStatus[anyio.CancelScope]) -> None: """ The sub-thread in which the websocket session runs. """ > send_tx, send_rx = anyio.create_memory_object_stream[Message](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:120: TypeError __________________________ test_debug_not_http[trio] ___________________________ test_client_factory = functools.partial(, backend='trio', backend_options={}) def test_debug_not_http(test_client_factory: TestClientFactory) -> None: """ DebugMiddleware should just pass through any non-http messages as-is. """ async def app(scope: Scope, receive: Receive, send: Send) -> None: raise RuntimeError("Something went wrong") app = ServerErrorMiddleware(app) with pytest.raises(RuntimeError): client = test_client_factory(app) > with client.websocket_connect("/"): tests/middleware/test_errors.py:79: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:101: in __enter__ fut, cs = portal.start_task(self._run) /usr/lib/python3.13/site-packages/anyio/from_thread.py:405: in start_task return f, task_status_future.result() /usr/lib64/python3.13/concurrent/futures/_base.py:449: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = async def _run(self, *, task_status: anyio.abc.TaskStatus[anyio.CancelScope]) -> None: """ The sub-thread in which the websocket session runs. """ > send_tx, send_rx = anyio.create_memory_object_stream[Message](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:120: TypeError ____________________ test_app_add_websocket_route[asyncio] _____________________ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) def test_app_add_websocket_route(test_client_factory: TestClientFactory) -> None: async def websocket_endpoint(session: WebSocket) -> None: await session.accept() await session.send_text("Hello, world!") await session.close() app = Starlette( routes=[ WebSocketRoute("/ws", endpoint=websocket_endpoint), ] ) client = test_client_factory(app) > with client.websocket_connect("/ws") as session: tests/test_applications.py:350: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:101: in __enter__ fut, cs = portal.start_task(self._run) /usr/lib/python3.13/site-packages/anyio/from_thread.py:405: in start_task return f, task_status_future.result() /usr/lib64/python3.13/concurrent/futures/_base.py:456: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = async def _run(self, *, task_status: anyio.abc.TaskStatus[anyio.CancelScope]) -> None: """ The sub-thread in which the websocket session runs. """ > send_tx, send_rx = anyio.create_memory_object_stream[Message](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:120: TypeError ______________________ test_app_add_websocket_route[trio] ______________________ test_client_factory = functools.partial(, backend='trio', backend_options={}) def test_app_add_websocket_route(test_client_factory: TestClientFactory) -> None: async def websocket_endpoint(session: WebSocket) -> None: await session.accept() await session.send_text("Hello, world!") await session.close() app = Starlette( routes=[ WebSocketRoute("/ws", endpoint=websocket_endpoint), ] ) client = test_client_factory(app) > with client.websocket_connect("/ws") as session: tests/test_applications.py:350: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:101: in __enter__ fut, cs = portal.start_task(self._run) /usr/lib/python3.13/site-packages/anyio/from_thread.py:405: in start_task return f, task_status_future.result() /usr/lib64/python3.13/concurrent/futures/_base.py:449: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = async def _run(self, *, task_status: anyio.abc.TaskStatus[anyio.CancelScope]) -> None: """ The sub-thread in which the websocket session runs. """ > send_tx, send_rx = anyio.create_memory_object_stream[Message](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:120: TypeError _____________________ test_app_add_event_handler[asyncio] ______________________ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) def test_app_add_event_handler(test_client_factory: TestClientFactory) -> None: startup_complete = False cleanup_complete = False def run_startup() -> None: nonlocal startup_complete startup_complete = True def run_cleanup() -> None: nonlocal cleanup_complete cleanup_complete = True with pytest.deprecated_call(match="The on_startup and on_shutdown parameters are deprecated"): app = Starlette( on_startup=[run_startup], on_shutdown=[run_cleanup], ) assert not startup_complete assert not cleanup_complete > with test_client_factory(app): tests/test_applications.py:375: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __enter__(self) -> TestClient: with contextlib.ExitStack() as stack: self.portal = portal = stack.enter_context(anyio.from_thread.start_blocking_portal(**self.async_backend)) @stack.callback def reset_portal() -> None: self.portal = None > send1, receive1 = anyio.create_memory_object_stream[ typing.Union[typing.MutableMapping[str, typing.Any], None] ](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:660: TypeError _______________________ test_app_add_event_handler[trio] _______________________ test_client_factory = functools.partial(, backend='trio', backend_options={}) def test_app_add_event_handler(test_client_factory: TestClientFactory) -> None: startup_complete = False cleanup_complete = False def run_startup() -> None: nonlocal startup_complete startup_complete = True def run_cleanup() -> None: nonlocal cleanup_complete cleanup_complete = True with pytest.deprecated_call(match="The on_startup and on_shutdown parameters are deprecated"): app = Starlette( on_startup=[run_startup], on_shutdown=[run_cleanup], ) assert not startup_complete assert not cleanup_complete > with test_client_factory(app): tests/test_applications.py:375: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __enter__(self) -> TestClient: with contextlib.ExitStack() as stack: self.portal = portal = stack.enter_context(anyio.from_thread.start_blocking_portal(**self.async_backend)) @stack.callback def reset_portal() -> None: self.portal = None > send1, receive1 = anyio.create_memory_object_stream[ typing.Union[typing.MutableMapping[str, typing.Any], None] ](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:660: TypeError _____________________ test_app_async_cm_lifespan[asyncio] ______________________ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) def test_app_async_cm_lifespan(test_client_factory: TestClientFactory) -> None: startup_complete = False cleanup_complete = False @asynccontextmanager async def lifespan(app: ASGIApp) -> AsyncGenerator[None, None]: nonlocal startup_complete, cleanup_complete startup_complete = True yield cleanup_complete = True app = Starlette(lifespan=lifespan) assert not startup_complete assert not cleanup_complete > with test_client_factory(app): tests/test_applications.py:397: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __enter__(self) -> TestClient: with contextlib.ExitStack() as stack: self.portal = portal = stack.enter_context(anyio.from_thread.start_blocking_portal(**self.async_backend)) @stack.callback def reset_portal() -> None: self.portal = None > send1, receive1 = anyio.create_memory_object_stream[ typing.Union[typing.MutableMapping[str, typing.Any], None] ](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:660: TypeError _______________________ test_app_async_cm_lifespan[trio] _______________________ test_client_factory = functools.partial(, backend='trio', backend_options={}) def test_app_async_cm_lifespan(test_client_factory: TestClientFactory) -> None: startup_complete = False cleanup_complete = False @asynccontextmanager async def lifespan(app: ASGIApp) -> AsyncGenerator[None, None]: nonlocal startup_complete, cleanup_complete startup_complete = True yield cleanup_complete = True app = Starlette(lifespan=lifespan) assert not startup_complete assert not cleanup_complete > with test_client_factory(app): tests/test_applications.py:397: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __enter__(self) -> TestClient: with contextlib.ExitStack() as stack: self.portal = portal = stack.enter_context(anyio.from_thread.start_blocking_portal(**self.async_backend)) @stack.callback def reset_portal() -> None: self.portal = None > send1, receive1 = anyio.create_memory_object_stream[ typing.Union[typing.MutableMapping[str, typing.Any], None] ](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:660: TypeError _____________________ test_app_async_gen_lifespan[asyncio] _____________________ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) @deprecated_lifespan def test_app_async_gen_lifespan(test_client_factory: TestClientFactory) -> None: startup_complete = False cleanup_complete = False async def lifespan(app: ASGIApp) -> AsyncGenerator[None, None]: nonlocal startup_complete, cleanup_complete startup_complete = True yield cleanup_complete = True app = Starlette(lifespan=lifespan) # type: ignore assert not startup_complete assert not cleanup_complete > with test_client_factory(app): tests/test_applications.py:428: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __enter__(self) -> TestClient: with contextlib.ExitStack() as stack: self.portal = portal = stack.enter_context(anyio.from_thread.start_blocking_portal(**self.async_backend)) @stack.callback def reset_portal() -> None: self.portal = None > send1, receive1 = anyio.create_memory_object_stream[ typing.Union[typing.MutableMapping[str, typing.Any], None] ](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:660: TypeError ______________________ test_app_async_gen_lifespan[trio] _______________________ test_client_factory = functools.partial(, backend='trio', backend_options={}) @deprecated_lifespan def test_app_async_gen_lifespan(test_client_factory: TestClientFactory) -> None: startup_complete = False cleanup_complete = False async def lifespan(app: ASGIApp) -> AsyncGenerator[None, None]: nonlocal startup_complete, cleanup_complete startup_complete = True yield cleanup_complete = True app = Starlette(lifespan=lifespan) # type: ignore assert not startup_complete assert not cleanup_complete > with test_client_factory(app): tests/test_applications.py:428: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __enter__(self) -> TestClient: with contextlib.ExitStack() as stack: self.portal = portal = stack.enter_context(anyio.from_thread.start_blocking_portal(**self.async_backend)) @stack.callback def reset_portal() -> None: self.portal = None > send1, receive1 = anyio.create_memory_object_stream[ typing.Union[typing.MutableMapping[str, typing.Any], None] ](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:660: TypeError _____________________ test_app_sync_gen_lifespan[asyncio] ______________________ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) @deprecated_lifespan def test_app_sync_gen_lifespan(test_client_factory: TestClientFactory) -> None: startup_complete = False cleanup_complete = False def lifespan(app: ASGIApp) -> Generator[None, None, None]: nonlocal startup_complete, cleanup_complete startup_complete = True yield cleanup_complete = True app = Starlette(lifespan=lifespan) # type: ignore assert not startup_complete assert not cleanup_complete > with test_client_factory(app): tests/test_applications.py:450: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __enter__(self) -> TestClient: with contextlib.ExitStack() as stack: self.portal = portal = stack.enter_context(anyio.from_thread.start_blocking_portal(**self.async_backend)) @stack.callback def reset_portal() -> None: self.portal = None > send1, receive1 = anyio.create_memory_object_stream[ typing.Union[typing.MutableMapping[str, typing.Any], None] ](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:660: TypeError _______________________ test_app_sync_gen_lifespan[trio] _______________________ test_client_factory = functools.partial(, backend='trio', backend_options={}) @deprecated_lifespan def test_app_sync_gen_lifespan(test_client_factory: TestClientFactory) -> None: startup_complete = False cleanup_complete = False def lifespan(app: ASGIApp) -> Generator[None, None, None]: nonlocal startup_complete, cleanup_complete startup_complete = True yield cleanup_complete = True app = Starlette(lifespan=lifespan) # type: ignore assert not startup_complete assert not cleanup_complete > with test_client_factory(app): tests/test_applications.py:450: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __enter__(self) -> TestClient: with contextlib.ExitStack() as stack: self.portal = portal = stack.enter_context(anyio.from_thread.start_blocking_portal(**self.async_backend)) @stack.callback def reset_portal() -> None: self.portal = None > send1, receive1 = anyio.create_memory_object_stream[ typing.Union[typing.MutableMapping[str, typing.Any], None] ](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:660: TypeError _____________________ test_middleware_stack_init[asyncio] ______________________ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) def test_middleware_stack_init(test_client_factory: TestClientFactory) -> None: class NoOpMiddleware: def __init__(self, app: ASGIApp): self.app = app async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None: await self.app(scope, receive, send) class SimpleInitializableMiddleware: counter = 0 def __init__(self, app: ASGIApp): self.app = app SimpleInitializableMiddleware.counter += 1 async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None: await self.app(scope, receive, send) def get_app() -> ASGIApp: app = Starlette() app.add_middleware(SimpleInitializableMiddleware) app.add_middleware(NoOpMiddleware) return app app = get_app() > with test_client_factory(app): tests/test_applications.py:523: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __enter__(self) -> TestClient: with contextlib.ExitStack() as stack: self.portal = portal = stack.enter_context(anyio.from_thread.start_blocking_portal(**self.async_backend)) @stack.callback def reset_portal() -> None: self.portal = None > send1, receive1 = anyio.create_memory_object_stream[ typing.Union[typing.MutableMapping[str, typing.Any], None] ](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:660: TypeError _______________________ test_middleware_stack_init[trio] _______________________ test_client_factory = functools.partial(, backend='trio', backend_options={}) def test_middleware_stack_init(test_client_factory: TestClientFactory) -> None: class NoOpMiddleware: def __init__(self, app: ASGIApp): self.app = app async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None: await self.app(scope, receive, send) class SimpleInitializableMiddleware: counter = 0 def __init__(self, app: ASGIApp): self.app = app SimpleInitializableMiddleware.counter += 1 async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None: await self.app(scope, receive, send) def get_app() -> ASGIApp: app = Starlette() app.add_middleware(SimpleInitializableMiddleware) app.add_middleware(NoOpMiddleware) return app app = get_app() > with test_client_factory(app): tests/test_applications.py:523: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __enter__(self) -> TestClient: with contextlib.ExitStack() as stack: self.portal = portal = stack.enter_context(anyio.from_thread.start_blocking_portal(**self.async_backend)) @stack.callback def reset_portal() -> None: self.portal = None > send1, receive1 = anyio.create_memory_object_stream[ typing.Union[typing.MutableMapping[str, typing.Any], None] ](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:660: TypeError ________________________ test_middleware_args[asyncio] _________________________ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) def test_middleware_args(test_client_factory: TestClientFactory) -> None: calls: list[str] = [] class MiddlewareWithArgs: def __init__(self, app: ASGIApp, arg: str) -> None: self.app = app self.arg = arg async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None: calls.append(self.arg) await self.app(scope, receive, send) app = Starlette() app.add_middleware(MiddlewareWithArgs, "foo") app.add_middleware(MiddlewareWithArgs, "bar") > with test_client_factory(app): tests/test_applications.py:555: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __enter__(self) -> TestClient: with contextlib.ExitStack() as stack: self.portal = portal = stack.enter_context(anyio.from_thread.start_blocking_portal(**self.async_backend)) @stack.callback def reset_portal() -> None: self.portal = None > send1, receive1 = anyio.create_memory_object_stream[ typing.Union[typing.MutableMapping[str, typing.Any], None] ](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:660: TypeError __________________________ test_middleware_args[trio] __________________________ test_client_factory = functools.partial(, backend='trio', backend_options={}) def test_middleware_args(test_client_factory: TestClientFactory) -> None: calls: list[str] = [] class MiddlewareWithArgs: def __init__(self, app: ASGIApp, arg: str) -> None: self.app = app self.arg = arg async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None: calls.append(self.arg) await self.app(scope, receive, send) app = Starlette() app.add_middleware(MiddlewareWithArgs, "foo") app.add_middleware(MiddlewareWithArgs, "bar") > with test_client_factory(app): tests/test_applications.py:555: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __enter__(self) -> TestClient: with contextlib.ExitStack() as stack: self.portal = portal = stack.enter_context(anyio.from_thread.start_blocking_portal(**self.async_backend)) @stack.callback def reset_portal() -> None: self.portal = None > send1, receive1 = anyio.create_memory_object_stream[ typing.Union[typing.MutableMapping[str, typing.Any], None] ](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:660: TypeError _______________________ test_middleware_factory[asyncio] _______________________ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) def test_middleware_factory(test_client_factory: TestClientFactory) -> None: calls: list[str] = [] def _middleware_factory(app: ASGIApp, arg: str) -> ASGIApp: async def _app(scope: Scope, receive: Receive, send: Send) -> None: calls.append(arg) await app(scope, receive, send) return _app def get_middleware_factory() -> Callable[[ASGIApp, str], ASGIApp]: return _middleware_factory app = Starlette() app.add_middleware(_middleware_factory, arg="foo") app.add_middleware(get_middleware_factory(), "bar") > with test_client_factory(app): tests/test_applications.py:578: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __enter__(self) -> TestClient: with contextlib.ExitStack() as stack: self.portal = portal = stack.enter_context(anyio.from_thread.start_blocking_portal(**self.async_backend)) @stack.callback def reset_portal() -> None: self.portal = None > send1, receive1 = anyio.create_memory_object_stream[ typing.Union[typing.MutableMapping[str, typing.Any], None] ](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:660: TypeError ________________________ test_middleware_factory[trio] _________________________ test_client_factory = functools.partial(, backend='trio', backend_options={}) def test_middleware_factory(test_client_factory: TestClientFactory) -> None: calls: list[str] = [] def _middleware_factory(app: ASGIApp, arg: str) -> ASGIApp: async def _app(scope: Scope, receive: Receive, send: Send) -> None: calls.append(arg) await app(scope, receive, send) return _app def get_middleware_factory() -> Callable[[ASGIApp, str], ASGIApp]: return _middleware_factory app = Starlette() app.add_middleware(_middleware_factory, arg="foo") app.add_middleware(get_middleware_factory(), "bar") > with test_client_factory(app): tests/test_applications.py:578: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __enter__(self) -> TestClient: with contextlib.ExitStack() as stack: self.portal = portal = stack.enter_context(anyio.from_thread.start_blocking_portal(**self.async_backend)) @stack.callback def reset_portal() -> None: self.portal = None > send1, receive1 = anyio.create_memory_object_stream[ typing.Union[typing.MutableMapping[str, typing.Any], None] ](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:660: TypeError _________________________ test_user_interface[asyncio] _________________________ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) def test_user_interface(test_client_factory: TestClientFactory) -> None: > with test_client_factory(app) as client: tests/test_authentication.py:213: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __enter__(self) -> TestClient: with contextlib.ExitStack() as stack: self.portal = portal = stack.enter_context(anyio.from_thread.start_blocking_portal(**self.async_backend)) @stack.callback def reset_portal() -> None: self.portal = None > send1, receive1 = anyio.create_memory_object_stream[ typing.Union[typing.MutableMapping[str, typing.Any], None] ](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:660: TypeError __________________________ test_user_interface[trio] ___________________________ test_client_factory = functools.partial(, backend='trio', backend_options={}) def test_user_interface(test_client_factory: TestClientFactory) -> None: > with test_client_factory(app) as client: tests/test_authentication.py:213: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __enter__(self) -> TestClient: with contextlib.ExitStack() as stack: self.portal = portal = stack.enter_context(anyio.from_thread.start_blocking_portal(**self.async_backend)) @stack.callback def reset_portal() -> None: self.portal = None > send1, receive1 = anyio.create_memory_object_stream[ typing.Union[typing.MutableMapping[str, typing.Any], None] ](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:660: TypeError ____________________ test_authentication_required[asyncio] _____________________ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) def test_authentication_required(test_client_factory: TestClientFactory) -> None: > with test_client_factory(app) as client: tests/test_authentication.py:224: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __enter__(self) -> TestClient: with contextlib.ExitStack() as stack: self.portal = portal = stack.enter_context(anyio.from_thread.start_blocking_portal(**self.async_backend)) @stack.callback def reset_portal() -> None: self.portal = None > send1, receive1 = anyio.create_memory_object_stream[ typing.Union[typing.MutableMapping[str, typing.Any], None] ](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:660: TypeError ______________________ test_authentication_required[trio] ______________________ test_client_factory = functools.partial(, backend='trio', backend_options={}) def test_authentication_required(test_client_factory: TestClientFactory) -> None: > with test_client_factory(app) as client: tests/test_authentication.py:224: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __enter__(self) -> TestClient: with contextlib.ExitStack() as stack: self.portal = portal = stack.enter_context(anyio.from_thread.start_blocking_portal(**self.async_backend)) @stack.callback def reset_portal() -> None: self.portal = None > send1, receive1 = anyio.create_memory_object_stream[ typing.Union[typing.MutableMapping[str, typing.Any], None] ](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:660: TypeError _______________ test_websocket_authentication_required[asyncio] ________________ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) def test_websocket_authentication_required( test_client_factory: TestClientFactory, ) -> None: > with test_client_factory(app) as client: tests/test_authentication.py:276: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __enter__(self) -> TestClient: with contextlib.ExitStack() as stack: self.portal = portal = stack.enter_context(anyio.from_thread.start_blocking_portal(**self.async_backend)) @stack.callback def reset_portal() -> None: self.portal = None > send1, receive1 = anyio.create_memory_object_stream[ typing.Union[typing.MutableMapping[str, typing.Any], None] ](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:660: TypeError _________________ test_websocket_authentication_required[trio] _________________ test_client_factory = functools.partial(, backend='trio', backend_options={}) def test_websocket_authentication_required( test_client_factory: TestClientFactory, ) -> None: > with test_client_factory(app) as client: tests/test_authentication.py:276: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __enter__(self) -> TestClient: with contextlib.ExitStack() as stack: self.portal = portal = stack.enter_context(anyio.from_thread.start_blocking_portal(**self.async_backend)) @stack.callback def reset_portal() -> None: self.portal = None > send1, receive1 = anyio.create_memory_object_stream[ typing.Union[typing.MutableMapping[str, typing.Any], None] ](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:660: TypeError ____________________ test_authentication_redirect[asyncio] _____________________ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) def test_authentication_redirect(test_client_factory: TestClientFactory) -> None: > with test_client_factory(app) as client: tests/test_authentication.py:307: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __enter__(self) -> TestClient: with contextlib.ExitStack() as stack: self.portal = portal = stack.enter_context(anyio.from_thread.start_blocking_portal(**self.async_backend)) @stack.callback def reset_portal() -> None: self.portal = None > send1, receive1 = anyio.create_memory_object_stream[ typing.Union[typing.MutableMapping[str, typing.Any], None] ](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:660: TypeError ______________________ test_authentication_redirect[trio] ______________________ test_client_factory = functools.partial(, backend='trio', backend_options={}) def test_authentication_redirect(test_client_factory: TestClientFactory) -> None: > with test_client_factory(app) as client: tests/test_authentication.py:307: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __enter__(self) -> TestClient: with contextlib.ExitStack() as stack: self.portal = portal = stack.enter_context(anyio.from_thread.start_blocking_portal(**self.async_backend)) @stack.callback def reset_portal() -> None: self.portal = None > send1, receive1 = anyio.create_memory_object_stream[ typing.Union[typing.MutableMapping[str, typing.Any], None] ](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:660: TypeError ________________________ test_custom_on_error[asyncio] _________________________ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) def test_custom_on_error(test_client_factory: TestClientFactory) -> None: > with test_client_factory(other_app) as client: tests/test_authentication.py:348: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __enter__(self) -> TestClient: with contextlib.ExitStack() as stack: self.portal = portal = stack.enter_context(anyio.from_thread.start_blocking_portal(**self.async_backend)) @stack.callback def reset_portal() -> None: self.portal = None > send1, receive1 = anyio.create_memory_object_stream[ typing.Union[typing.MutableMapping[str, typing.Any], None] ](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:660: TypeError __________________________ test_custom_on_error[trio] __________________________ test_client_factory = functools.partial(, backend='trio', backend_options={}) def test_custom_on_error(test_client_factory: TestClientFactory) -> None: > with test_client_factory(other_app) as client: tests/test_authentication.py:348: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __enter__(self) -> TestClient: with contextlib.ExitStack() as stack: self.portal = portal = stack.enter_context(anyio.from_thread.start_blocking_portal(**self.async_backend)) @stack.callback def reset_portal() -> None: self.portal = None > send1, receive1 = anyio.create_memory_object_stream[ typing.Union[typing.MutableMapping[str, typing.Any], None] ](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:660: TypeError _________________ test_websocket_endpoint_on_connect[asyncio] __________________ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) def test_websocket_endpoint_on_connect(test_client_factory: TestClientFactory) -> None: class WebSocketApp(WebSocketEndpoint): async def on_connect(self, websocket: WebSocket) -> None: assert websocket["subprotocols"] == ["soap", "wamp"] await websocket.accept(subprotocol="wamp") client = test_client_factory(WebSocketApp) > with client.websocket_connect("/ws", subprotocols=["soap", "wamp"]) as websocket: tests/test_endpoints.py:57: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:101: in __enter__ fut, cs = portal.start_task(self._run) /usr/lib/python3.13/site-packages/anyio/from_thread.py:405: in start_task return f, task_status_future.result() /usr/lib64/python3.13/concurrent/futures/_base.py:456: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = async def _run(self, *, task_status: anyio.abc.TaskStatus[anyio.CancelScope]) -> None: """ The sub-thread in which the websocket session runs. """ > send_tx, send_rx = anyio.create_memory_object_stream[Message](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:120: TypeError ___________________ test_websocket_endpoint_on_connect[trio] ___________________ test_client_factory = functools.partial(, backend='trio', backend_options={}) def test_websocket_endpoint_on_connect(test_client_factory: TestClientFactory) -> None: class WebSocketApp(WebSocketEndpoint): async def on_connect(self, websocket: WebSocket) -> None: assert websocket["subprotocols"] == ["soap", "wamp"] await websocket.accept(subprotocol="wamp") client = test_client_factory(WebSocketApp) > with client.websocket_connect("/ws", subprotocols=["soap", "wamp"]) as websocket: tests/test_endpoints.py:57: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:101: in __enter__ fut, cs = portal.start_task(self._run) /usr/lib/python3.13/site-packages/anyio/from_thread.py:405: in start_task return f, task_status_future.result() /usr/lib64/python3.13/concurrent/futures/_base.py:456: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = async def _run(self, *, task_status: anyio.abc.TaskStatus[anyio.CancelScope]) -> None: """ The sub-thread in which the websocket session runs. """ > send_tx, send_rx = anyio.create_memory_object_stream[Message](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:120: TypeError ______________ test_websocket_endpoint_on_receive_bytes[asyncio] _______________ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) def test_websocket_endpoint_on_receive_bytes( test_client_factory: TestClientFactory, ) -> None: class WebSocketApp(WebSocketEndpoint): encoding = "bytes" async def on_receive(self, websocket: WebSocket, data: bytes) -> None: await websocket.send_bytes(b"Message bytes was: " + data) client = test_client_factory(WebSocketApp) > with client.websocket_connect("/ws") as websocket: tests/test_endpoints.py:71: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:101: in __enter__ fut, cs = portal.start_task(self._run) /usr/lib/python3.13/site-packages/anyio/from_thread.py:405: in start_task return f, task_status_future.result() /usr/lib64/python3.13/concurrent/futures/_base.py:456: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = async def _run(self, *, task_status: anyio.abc.TaskStatus[anyio.CancelScope]) -> None: """ The sub-thread in which the websocket session runs. """ > send_tx, send_rx = anyio.create_memory_object_stream[Message](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:120: TypeError ________________ test_websocket_endpoint_on_receive_bytes[trio] ________________ test_client_factory = functools.partial(, backend='trio', backend_options={}) def test_websocket_endpoint_on_receive_bytes( test_client_factory: TestClientFactory, ) -> None: class WebSocketApp(WebSocketEndpoint): encoding = "bytes" async def on_receive(self, websocket: WebSocket, data: bytes) -> None: await websocket.send_bytes(b"Message bytes was: " + data) client = test_client_factory(WebSocketApp) > with client.websocket_connect("/ws") as websocket: tests/test_endpoints.py:71: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:101: in __enter__ fut, cs = portal.start_task(self._run) /usr/lib/python3.13/site-packages/anyio/from_thread.py:405: in start_task return f, task_status_future.result() /usr/lib64/python3.13/concurrent/futures/_base.py:456: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = async def _run(self, *, task_status: anyio.abc.TaskStatus[anyio.CancelScope]) -> None: """ The sub-thread in which the websocket session runs. """ > send_tx, send_rx = anyio.create_memory_object_stream[Message](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:120: TypeError _______________ test_websocket_endpoint_on_receive_json[asyncio] _______________ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) def test_websocket_endpoint_on_receive_json( test_client_factory: TestClientFactory, ) -> None: class WebSocketApp(WebSocketEndpoint): encoding = "json" async def on_receive(self, websocket: WebSocket, data: str) -> None: await websocket.send_json({"message": data}) client = test_client_factory(WebSocketApp) > with client.websocket_connect("/ws") as websocket: tests/test_endpoints.py:91: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:101: in __enter__ fut, cs = portal.start_task(self._run) /usr/lib/python3.13/site-packages/anyio/from_thread.py:405: in start_task return f, task_status_future.result() /usr/lib64/python3.13/concurrent/futures/_base.py:456: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = async def _run(self, *, task_status: anyio.abc.TaskStatus[anyio.CancelScope]) -> None: """ The sub-thread in which the websocket session runs. """ > send_tx, send_rx = anyio.create_memory_object_stream[Message](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:120: TypeError ________________ test_websocket_endpoint_on_receive_json[trio] _________________ test_client_factory = functools.partial(, backend='trio', backend_options={}) def test_websocket_endpoint_on_receive_json( test_client_factory: TestClientFactory, ) -> None: class WebSocketApp(WebSocketEndpoint): encoding = "json" async def on_receive(self, websocket: WebSocket, data: str) -> None: await websocket.send_json({"message": data}) client = test_client_factory(WebSocketApp) > with client.websocket_connect("/ws") as websocket: tests/test_endpoints.py:91: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:101: in __enter__ fut, cs = portal.start_task(self._run) /usr/lib/python3.13/site-packages/anyio/from_thread.py:405: in start_task return f, task_status_future.result() /usr/lib64/python3.13/concurrent/futures/_base.py:449: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = async def _run(self, *, task_status: anyio.abc.TaskStatus[anyio.CancelScope]) -> None: """ The sub-thread in which the websocket session runs. """ > send_tx, send_rx = anyio.create_memory_object_stream[Message](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:120: TypeError ___________ test_websocket_endpoint_on_receive_json_binary[asyncio] ____________ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) def test_websocket_endpoint_on_receive_json_binary( test_client_factory: TestClientFactory, ) -> None: class WebSocketApp(WebSocketEndpoint): encoding = "json" async def on_receive(self, websocket: WebSocket, data: str) -> None: await websocket.send_json({"message": data}, mode="binary") client = test_client_factory(WebSocketApp) > with client.websocket_connect("/ws") as websocket: tests/test_endpoints.py:111: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:101: in __enter__ fut, cs = portal.start_task(self._run) /usr/lib/python3.13/site-packages/anyio/from_thread.py:405: in start_task return f, task_status_future.result() /usr/lib64/python3.13/concurrent/futures/_base.py:456: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = async def _run(self, *, task_status: anyio.abc.TaskStatus[anyio.CancelScope]) -> None: """ The sub-thread in which the websocket session runs. """ > send_tx, send_rx = anyio.create_memory_object_stream[Message](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:120: TypeError _____________ test_websocket_endpoint_on_receive_json_binary[trio] _____________ test_client_factory = functools.partial(, backend='trio', backend_options={}) def test_websocket_endpoint_on_receive_json_binary( test_client_factory: TestClientFactory, ) -> None: class WebSocketApp(WebSocketEndpoint): encoding = "json" async def on_receive(self, websocket: WebSocket, data: str) -> None: await websocket.send_json({"message": data}, mode="binary") client = test_client_factory(WebSocketApp) > with client.websocket_connect("/ws") as websocket: tests/test_endpoints.py:111: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:101: in __enter__ fut, cs = portal.start_task(self._run) /usr/lib/python3.13/site-packages/anyio/from_thread.py:405: in start_task return f, task_status_future.result() /usr/lib64/python3.13/concurrent/futures/_base.py:449: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = async def _run(self, *, task_status: anyio.abc.TaskStatus[anyio.CancelScope]) -> None: """ The sub-thread in which the websocket session runs. """ > send_tx, send_rx = anyio.create_memory_object_stream[Message](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:120: TypeError _______________ test_websocket_endpoint_on_receive_text[asyncio] _______________ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) def test_websocket_endpoint_on_receive_text( test_client_factory: TestClientFactory, ) -> None: class WebSocketApp(WebSocketEndpoint): encoding = "text" async def on_receive(self, websocket: WebSocket, data: str) -> None: await websocket.send_text(f"Message text was: {data}") client = test_client_factory(WebSocketApp) > with client.websocket_connect("/ws") as websocket: tests/test_endpoints.py:127: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:101: in __enter__ fut, cs = portal.start_task(self._run) /usr/lib/python3.13/site-packages/anyio/from_thread.py:405: in start_task return f, task_status_future.result() /usr/lib64/python3.13/concurrent/futures/_base.py:456: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = async def _run(self, *, task_status: anyio.abc.TaskStatus[anyio.CancelScope]) -> None: """ The sub-thread in which the websocket session runs. """ > send_tx, send_rx = anyio.create_memory_object_stream[Message](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:120: TypeError ________________ test_websocket_endpoint_on_receive_text[trio] _________________ test_client_factory = functools.partial(, backend='trio', backend_options={}) def test_websocket_endpoint_on_receive_text( test_client_factory: TestClientFactory, ) -> None: class WebSocketApp(WebSocketEndpoint): encoding = "text" async def on_receive(self, websocket: WebSocket, data: str) -> None: await websocket.send_text(f"Message text was: {data}") client = test_client_factory(WebSocketApp) > with client.websocket_connect("/ws") as websocket: tests/test_endpoints.py:127: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:101: in __enter__ fut, cs = portal.start_task(self._run) /usr/lib/python3.13/site-packages/anyio/from_thread.py:405: in start_task return f, task_status_future.result() /usr/lib64/python3.13/concurrent/futures/_base.py:456: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = async def _run(self, *, task_status: anyio.abc.TaskStatus[anyio.CancelScope]) -> None: """ The sub-thread in which the websocket session runs. """ > send_tx, send_rx = anyio.create_memory_object_stream[Message](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:120: TypeError _________________ test_websocket_endpoint_on_default[asyncio] __________________ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) def test_websocket_endpoint_on_default(test_client_factory: TestClientFactory) -> None: class WebSocketApp(WebSocketEndpoint): encoding = None async def on_receive(self, websocket: WebSocket, data: str) -> None: await websocket.send_text(f"Message text was: {data}") client = test_client_factory(WebSocketApp) > with client.websocket_connect("/ws") as websocket: tests/test_endpoints.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:101: in __enter__ fut, cs = portal.start_task(self._run) /usr/lib/python3.13/site-packages/anyio/from_thread.py:405: in start_task return f, task_status_future.result() /usr/lib64/python3.13/concurrent/futures/_base.py:456: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = async def _run(self, *, task_status: anyio.abc.TaskStatus[anyio.CancelScope]) -> None: """ The sub-thread in which the websocket session runs. """ > send_tx, send_rx = anyio.create_memory_object_stream[Message](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:120: TypeError ___________________ test_websocket_endpoint_on_default[trio] ___________________ test_client_factory = functools.partial(, backend='trio', backend_options={}) def test_websocket_endpoint_on_default(test_client_factory: TestClientFactory) -> None: class WebSocketApp(WebSocketEndpoint): encoding = None async def on_receive(self, websocket: WebSocket, data: str) -> None: await websocket.send_text(f"Message text was: {data}") client = test_client_factory(WebSocketApp) > with client.websocket_connect("/ws") as websocket: tests/test_endpoints.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:101: in __enter__ fut, cs = portal.start_task(self._run) /usr/lib/python3.13/site-packages/anyio/from_thread.py:405: in start_task return f, task_status_future.result() /usr/lib64/python3.13/concurrent/futures/_base.py:449: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = async def _run(self, *, task_status: anyio.abc.TaskStatus[anyio.CancelScope]) -> None: """ The sub-thread in which the websocket session runs. """ > send_tx, send_rx = anyio.create_memory_object_stream[Message](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:120: TypeError ________________ test_websocket_endpoint_on_disconnect[asyncio] ________________ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) def test_websocket_endpoint_on_disconnect( test_client_factory: TestClientFactory, ) -> None: class WebSocketApp(WebSocketEndpoint): async def on_disconnect(self, websocket: WebSocket, close_code: int) -> None: assert close_code == 1001 await websocket.close(code=close_code) client = test_client_factory(WebSocketApp) > with client.websocket_connect("/ws") as websocket: tests/test_endpoints.py:160: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:101: in __enter__ fut, cs = portal.start_task(self._run) /usr/lib/python3.13/site-packages/anyio/from_thread.py:405: in start_task return f, task_status_future.result() /usr/lib64/python3.13/concurrent/futures/_base.py:456: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = async def _run(self, *, task_status: anyio.abc.TaskStatus[anyio.CancelScope]) -> None: """ The sub-thread in which the websocket session runs. """ > send_tx, send_rx = anyio.create_memory_object_stream[Message](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:120: TypeError _________________ test_websocket_endpoint_on_disconnect[trio] __________________ test_client_factory = functools.partial(, backend='trio', backend_options={}) def test_websocket_endpoint_on_disconnect( test_client_factory: TestClientFactory, ) -> None: class WebSocketApp(WebSocketEndpoint): async def on_disconnect(self, websocket: WebSocket, close_code: int) -> None: assert close_code == 1001 await websocket.close(code=close_code) client = test_client_factory(WebSocketApp) > with client.websocket_connect("/ws") as websocket: tests/test_endpoints.py:160: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:101: in __enter__ fut, cs = portal.start_task(self._run) /usr/lib/python3.13/site-packages/anyio/from_thread.py:405: in start_task return f, task_status_future.result() /usr/lib64/python3.13/concurrent/futures/_base.py:456: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = async def _run(self, *, task_status: anyio.abc.TaskStatus[anyio.CancelScope]) -> None: """ The sub-thread in which the websocket session runs. """ > send_tx, send_rx = anyio.create_memory_object_stream[Message](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:120: TypeError ________________________ test_protocol_switch[asyncio] _________________________ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) def test_protocol_switch(test_client_factory: TestClientFactory) -> None: client = test_client_factory(mixed_protocol_app) response = client.get("/") assert response.status_code == 200 assert response.text == "URL: http://testserver/" > with client.websocket_connect("/") as session: tests/test_routing.py:363: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:101: in __enter__ fut, cs = portal.start_task(self._run) /usr/lib/python3.13/site-packages/anyio/from_thread.py:405: in start_task return f, task_status_future.result() /usr/lib64/python3.13/concurrent/futures/_base.py:456: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = async def _run(self, *, task_status: anyio.abc.TaskStatus[anyio.CancelScope]) -> None: """ The sub-thread in which the websocket session runs. """ > send_tx, send_rx = anyio.create_memory_object_stream[Message](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:120: TypeError __________________________ test_protocol_switch[trio] __________________________ test_client_factory = functools.partial(, backend='trio', backend_options={}) def test_protocol_switch(test_client_factory: TestClientFactory) -> None: client = test_client_factory(mixed_protocol_app) response = client.get("/") assert response.status_code == 200 assert response.text == "URL: http://testserver/" > with client.websocket_connect("/") as session: tests/test_routing.py:363: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:101: in __enter__ fut, cs = portal.start_task(self._run) /usr/lib/python3.13/site-packages/anyio/from_thread.py:405: in start_task return f, task_status_future.result() /usr/lib64/python3.13/concurrent/futures/_base.py:449: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = async def _run(self, *, task_status: anyio.abc.TaskStatus[anyio.CancelScope]) -> None: """ The sub-thread in which the websocket session runs. """ > send_tx, send_rx = anyio.create_memory_object_stream[Message](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:120: TypeError __________________ test_standalone_ws_route_matches[asyncio] ___________________ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) def test_standalone_ws_route_matches( test_client_factory: TestClientFactory, ) -> None: app = WebSocketRoute("/", ws_helloworld) client = test_client_factory(app) > with client.websocket_connect("/") as websocket: tests/test_routing.py:609: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:101: in __enter__ fut, cs = portal.start_task(self._run) /usr/lib/python3.13/site-packages/anyio/from_thread.py:405: in start_task return f, task_status_future.result() /usr/lib64/python3.13/concurrent/futures/_base.py:456: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = async def _run(self, *, task_status: anyio.abc.TaskStatus[anyio.CancelScope]) -> None: """ The sub-thread in which the websocket session runs. """ > send_tx, send_rx = anyio.create_memory_object_stream[Message](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:120: TypeError ____________________ test_standalone_ws_route_matches[trio] ____________________ test_client_factory = functools.partial(, backend='trio', backend_options={}) def test_standalone_ws_route_matches( test_client_factory: TestClientFactory, ) -> None: app = WebSocketRoute("/", ws_helloworld) client = test_client_factory(app) > with client.websocket_connect("/") as websocket: tests/test_routing.py:609: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:101: in __enter__ fut, cs = portal.start_task(self._run) /usr/lib/python3.13/site-packages/anyio/from_thread.py:405: in start_task return f, task_status_future.result() /usr/lib64/python3.13/concurrent/futures/_base.py:449: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = async def _run(self, *, task_status: anyio.abc.TaskStatus[anyio.CancelScope]) -> None: """ The sub-thread in which the websocket session runs. """ > send_tx, send_rx = anyio.create_memory_object_stream[Message](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:120: TypeError _______________ test_standalone_ws_route_does_not_match[asyncio] _______________ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) def test_standalone_ws_route_does_not_match( test_client_factory: TestClientFactory, ) -> None: app = WebSocketRoute("/", ws_helloworld) client = test_client_factory(app) with pytest.raises(WebSocketDisconnect): > with client.websocket_connect("/invalid"): tests/test_routing.py:620: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:101: in __enter__ fut, cs = portal.start_task(self._run) /usr/lib/python3.13/site-packages/anyio/from_thread.py:405: in start_task return f, task_status_future.result() /usr/lib64/python3.13/concurrent/futures/_base.py:456: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = async def _run(self, *, task_status: anyio.abc.TaskStatus[anyio.CancelScope]) -> None: """ The sub-thread in which the websocket session runs. """ > send_tx, send_rx = anyio.create_memory_object_stream[Message](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:120: TypeError ________________ test_standalone_ws_route_does_not_match[trio] _________________ test_client_factory = functools.partial(, backend='trio', backend_options={}) def test_standalone_ws_route_does_not_match( test_client_factory: TestClientFactory, ) -> None: app = WebSocketRoute("/", ws_helloworld) client = test_client_factory(app) with pytest.raises(WebSocketDisconnect): > with client.websocket_connect("/invalid"): tests/test_routing.py:620: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:101: in __enter__ fut, cs = portal.start_task(self._run) /usr/lib/python3.13/site-packages/anyio/from_thread.py:405: in start_task return f, task_status_future.result() /usr/lib64/python3.13/concurrent/futures/_base.py:449: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = async def _run(self, *, task_status: anyio.abc.TaskStatus[anyio.CancelScope]) -> None: """ The sub-thread in which the websocket session runs. """ > send_tx, send_rx = anyio.create_memory_object_stream[Message](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:120: TypeError _________________________ test_lifespan_async[asyncio] _________________________ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) def test_lifespan_async(test_client_factory: TestClientFactory) -> None: startup_complete = False shutdown_complete = False async def hello_world(request: Request) -> PlainTextResponse: return PlainTextResponse("hello, world") async def run_startup() -> None: nonlocal startup_complete startup_complete = True async def run_shutdown() -> None: nonlocal shutdown_complete shutdown_complete = True with pytest.deprecated_call(match="The on_startup and on_shutdown parameters are deprecated"): app = Router( on_startup=[run_startup], on_shutdown=[run_shutdown], routes=[Route("/", hello_world)], ) assert not startup_complete assert not shutdown_complete > with test_client_factory(app) as client: tests/test_routing.py:648: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __enter__(self) -> TestClient: with contextlib.ExitStack() as stack: self.portal = portal = stack.enter_context(anyio.from_thread.start_blocking_portal(**self.async_backend)) @stack.callback def reset_portal() -> None: self.portal = None > send1, receive1 = anyio.create_memory_object_stream[ typing.Union[typing.MutableMapping[str, typing.Any], None] ](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:660: TypeError __________________________ test_lifespan_async[trio] ___________________________ test_client_factory = functools.partial(, backend='trio', backend_options={}) def test_lifespan_async(test_client_factory: TestClientFactory) -> None: startup_complete = False shutdown_complete = False async def hello_world(request: Request) -> PlainTextResponse: return PlainTextResponse("hello, world") async def run_startup() -> None: nonlocal startup_complete startup_complete = True async def run_shutdown() -> None: nonlocal shutdown_complete shutdown_complete = True with pytest.deprecated_call(match="The on_startup and on_shutdown parameters are deprecated"): app = Router( on_startup=[run_startup], on_shutdown=[run_shutdown], routes=[Route("/", hello_world)], ) assert not startup_complete assert not shutdown_complete > with test_client_factory(app) as client: tests/test_routing.py:648: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __enter__(self) -> TestClient: with contextlib.ExitStack() as stack: self.portal = portal = stack.enter_context(anyio.from_thread.start_blocking_portal(**self.async_backend)) @stack.callback def reset_portal() -> None: self.portal = None > send1, receive1 = anyio.create_memory_object_stream[ typing.Union[typing.MutableMapping[str, typing.Any], None] ](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:660: TypeError _________________________ test_lifespan_sync[asyncio] __________________________ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) def test_lifespan_sync(test_client_factory: TestClientFactory) -> None: startup_complete = False shutdown_complete = False def hello_world(request: Request) -> PlainTextResponse: return PlainTextResponse("hello, world") def run_startup() -> None: nonlocal startup_complete startup_complete = True def run_shutdown() -> None: nonlocal shutdown_complete shutdown_complete = True with pytest.deprecated_call(match="The on_startup and on_shutdown parameters are deprecated"): app = Router( on_startup=[run_startup], on_shutdown=[run_shutdown], routes=[Route("/", hello_world)], ) assert not startup_complete assert not shutdown_complete > with test_client_factory(app) as client: tests/test_routing.py:720: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __enter__(self) -> TestClient: with contextlib.ExitStack() as stack: self.portal = portal = stack.enter_context(anyio.from_thread.start_blocking_portal(**self.async_backend)) @stack.callback def reset_portal() -> None: self.portal = None > send1, receive1 = anyio.create_memory_object_stream[ typing.Union[typing.MutableMapping[str, typing.Any], None] ](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:660: TypeError ___________________________ test_lifespan_sync[trio] ___________________________ test_client_factory = functools.partial(, backend='trio', backend_options={}) def test_lifespan_sync(test_client_factory: TestClientFactory) -> None: startup_complete = False shutdown_complete = False def hello_world(request: Request) -> PlainTextResponse: return PlainTextResponse("hello, world") def run_startup() -> None: nonlocal startup_complete startup_complete = True def run_shutdown() -> None: nonlocal shutdown_complete shutdown_complete = True with pytest.deprecated_call(match="The on_startup and on_shutdown parameters are deprecated"): app = Router( on_startup=[run_startup], on_shutdown=[run_shutdown], routes=[Route("/", hello_world)], ) assert not startup_complete assert not shutdown_complete > with test_client_factory(app) as client: tests/test_routing.py:720: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __enter__(self) -> TestClient: with contextlib.ExitStack() as stack: self.portal = portal = stack.enter_context(anyio.from_thread.start_blocking_portal(**self.async_backend)) @stack.callback def reset_portal() -> None: self.portal = None > send1, receive1 = anyio.create_memory_object_stream[ typing.Union[typing.MutableMapping[str, typing.Any], None] ](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:660: TypeError ___________________ test_lifespan_state_unsupported[asyncio] ___________________ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) def test_lifespan_state_unsupported( test_client_factory: TestClientFactory, ) -> None: @contextlib.asynccontextmanager async def lifespan( app: ASGIApp, ) -> typing.AsyncGenerator[dict[str, str], None]: yield {"foo": "bar"} app = Router( lifespan=lifespan, routes=[Mount("/", PlainTextResponse("hello, world"))], ) async def no_state_wrapper(scope: Scope, receive: Receive, send: Send) -> None: del scope["state"] await app(scope, receive, send) with pytest.raises(RuntimeError, match='The server does not support "state" in the lifespan scope'): > with test_client_factory(no_state_wrapper): tests/test_routing.py:747: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __enter__(self) -> TestClient: with contextlib.ExitStack() as stack: self.portal = portal = stack.enter_context(anyio.from_thread.start_blocking_portal(**self.async_backend)) @stack.callback def reset_portal() -> None: self.portal = None > send1, receive1 = anyio.create_memory_object_stream[ typing.Union[typing.MutableMapping[str, typing.Any], None] ](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:660: TypeError ____________________ test_lifespan_state_unsupported[trio] _____________________ test_client_factory = functools.partial(, backend='trio', backend_options={}) def test_lifespan_state_unsupported( test_client_factory: TestClientFactory, ) -> None: @contextlib.asynccontextmanager async def lifespan( app: ASGIApp, ) -> typing.AsyncGenerator[dict[str, str], None]: yield {"foo": "bar"} app = Router( lifespan=lifespan, routes=[Mount("/", PlainTextResponse("hello, world"))], ) async def no_state_wrapper(scope: Scope, receive: Receive, send: Send) -> None: del scope["state"] await app(scope, receive, send) with pytest.raises(RuntimeError, match='The server does not support "state" in the lifespan scope'): > with test_client_factory(no_state_wrapper): tests/test_routing.py:747: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __enter__(self) -> TestClient: with contextlib.ExitStack() as stack: self.portal = portal = stack.enter_context(anyio.from_thread.start_blocking_portal(**self.async_backend)) @stack.callback def reset_portal() -> None: self.portal = None > send1, receive1 = anyio.create_memory_object_stream[ typing.Union[typing.MutableMapping[str, typing.Any], None] ](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:660: TypeError ____________________ test_lifespan_state_async_cm[asyncio] _____________________ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) def test_lifespan_state_async_cm(test_client_factory: TestClientFactory) -> None: startup_complete = False shutdown_complete = False class State(typing.TypedDict): count: int items: list[int] async def hello_world(request: Request) -> Response: # modifications to the state should not leak across requests assert request.state.count == 0 # modify the state, this should not leak to the lifespan or other requests request.state.count += 1 # since state.items is a mutable object this modification _will_ leak across # requests and to the lifespan request.state.items.append(1) return PlainTextResponse("hello, world") @contextlib.asynccontextmanager async def lifespan(app: Starlette) -> typing.AsyncIterator[State]: nonlocal startup_complete, shutdown_complete startup_complete = True state = State(count=0, items=[]) yield state shutdown_complete = True # modifications made to the state from a request do not leak to the lifespan assert state["count"] == 0 # unless of course the request mutates a mutable object that is referenced # via state assert state["items"] == [1, 1] app = Router( lifespan=lifespan, routes=[Route("/", hello_world)], ) assert not startup_complete assert not shutdown_complete > with test_client_factory(app) as client: tests/test_routing.py:789: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __enter__(self) -> TestClient: with contextlib.ExitStack() as stack: self.portal = portal = stack.enter_context(anyio.from_thread.start_blocking_portal(**self.async_backend)) @stack.callback def reset_portal() -> None: self.portal = None > send1, receive1 = anyio.create_memory_object_stream[ typing.Union[typing.MutableMapping[str, typing.Any], None] ](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:660: TypeError ______________________ test_lifespan_state_async_cm[trio] ______________________ test_client_factory = functools.partial(, backend='trio', backend_options={}) def test_lifespan_state_async_cm(test_client_factory: TestClientFactory) -> None: startup_complete = False shutdown_complete = False class State(typing.TypedDict): count: int items: list[int] async def hello_world(request: Request) -> Response: # modifications to the state should not leak across requests assert request.state.count == 0 # modify the state, this should not leak to the lifespan or other requests request.state.count += 1 # since state.items is a mutable object this modification _will_ leak across # requests and to the lifespan request.state.items.append(1) return PlainTextResponse("hello, world") @contextlib.asynccontextmanager async def lifespan(app: Starlette) -> typing.AsyncIterator[State]: nonlocal startup_complete, shutdown_complete startup_complete = True state = State(count=0, items=[]) yield state shutdown_complete = True # modifications made to the state from a request do not leak to the lifespan assert state["count"] == 0 # unless of course the request mutates a mutable object that is referenced # via state assert state["items"] == [1, 1] app = Router( lifespan=lifespan, routes=[Route("/", hello_world)], ) assert not startup_complete assert not shutdown_complete > with test_client_factory(app) as client: tests/test_routing.py:789: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __enter__(self) -> TestClient: with contextlib.ExitStack() as stack: self.portal = portal = stack.enter_context(anyio.from_thread.start_blocking_portal(**self.async_backend)) @stack.callback def reset_portal() -> None: self.portal = None > send1, receive1 = anyio.create_memory_object_stream[ typing.Union[typing.MutableMapping[str, typing.Any], None] ](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:660: TypeError ________________________ test_raise_on_startup[asyncio] ________________________ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) def test_raise_on_startup(test_client_factory: TestClientFactory) -> None: def run_startup() -> None: raise RuntimeError() with pytest.deprecated_call(match="The on_startup and on_shutdown parameters are deprecated"): router = Router(on_startup=[run_startup]) startup_failed = False async def app(scope: Scope, receive: Receive, send: Send) -> None: async def _send(message: Message) -> None: nonlocal startup_failed if message["type"] == "lifespan.startup.failed": # pragma: no branch startup_failed = True return await send(message) await router(scope, receive, _send) with pytest.raises(RuntimeError): > with test_client_factory(app): tests/test_routing.py:817: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __enter__(self) -> TestClient: with contextlib.ExitStack() as stack: self.portal = portal = stack.enter_context(anyio.from_thread.start_blocking_portal(**self.async_backend)) @stack.callback def reset_portal() -> None: self.portal = None > send1, receive1 = anyio.create_memory_object_stream[ typing.Union[typing.MutableMapping[str, typing.Any], None] ](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:660: TypeError _________________________ test_raise_on_startup[trio] __________________________ test_client_factory = functools.partial(, backend='trio', backend_options={}) def test_raise_on_startup(test_client_factory: TestClientFactory) -> None: def run_startup() -> None: raise RuntimeError() with pytest.deprecated_call(match="The on_startup and on_shutdown parameters are deprecated"): router = Router(on_startup=[run_startup]) startup_failed = False async def app(scope: Scope, receive: Receive, send: Send) -> None: async def _send(message: Message) -> None: nonlocal startup_failed if message["type"] == "lifespan.startup.failed": # pragma: no branch startup_failed = True return await send(message) await router(scope, receive, _send) with pytest.raises(RuntimeError): > with test_client_factory(app): tests/test_routing.py:817: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __enter__(self) -> TestClient: with contextlib.ExitStack() as stack: self.portal = portal = stack.enter_context(anyio.from_thread.start_blocking_portal(**self.async_backend)) @stack.callback def reset_portal() -> None: self.portal = None > send1, receive1 = anyio.create_memory_object_stream[ typing.Union[typing.MutableMapping[str, typing.Any], None] ](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:660: TypeError _______________________ test_raise_on_shutdown[asyncio] ________________________ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) def test_raise_on_shutdown(test_client_factory: TestClientFactory) -> None: def run_shutdown() -> None: raise RuntimeError() with pytest.deprecated_call(match="The on_startup and on_shutdown parameters are deprecated"): app = Router(on_shutdown=[run_shutdown]) with pytest.raises(RuntimeError): > with test_client_factory(app): tests/test_routing.py:830: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __enter__(self) -> TestClient: with contextlib.ExitStack() as stack: self.portal = portal = stack.enter_context(anyio.from_thread.start_blocking_portal(**self.async_backend)) @stack.callback def reset_portal() -> None: self.portal = None > send1, receive1 = anyio.create_memory_object_stream[ typing.Union[typing.MutableMapping[str, typing.Any], None] ](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:660: TypeError _________________________ test_raise_on_shutdown[trio] _________________________ test_client_factory = functools.partial(, backend='trio', backend_options={}) def test_raise_on_shutdown(test_client_factory: TestClientFactory) -> None: def run_shutdown() -> None: raise RuntimeError() with pytest.deprecated_call(match="The on_startup and on_shutdown parameters are deprecated"): app = Router(on_shutdown=[run_shutdown]) with pytest.raises(RuntimeError): > with test_client_factory(app): tests/test_routing.py:830: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __enter__(self) -> TestClient: with contextlib.ExitStack() as stack: self.portal = portal = stack.enter_context(anyio.from_thread.start_blocking_portal(**self.async_backend)) @stack.callback def reset_portal() -> None: self.portal = None > send1, receive1 = anyio.create_memory_object_stream[ typing.Union[typing.MutableMapping[str, typing.Any], None] ](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:660: TypeError ___________________ test_partial_async_ws_endpoint[asyncio] ____________________ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) def test_partial_async_ws_endpoint( test_client_factory: TestClientFactory, ) -> None: test_client = test_client_factory(app) > with test_client.websocket_connect("/partial/ws") as websocket: tests/test_routing.py:849: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:101: in __enter__ fut, cs = portal.start_task(self._run) /usr/lib/python3.13/site-packages/anyio/from_thread.py:405: in start_task return f, task_status_future.result() /usr/lib64/python3.13/concurrent/futures/_base.py:456: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = async def _run(self, *, task_status: anyio.abc.TaskStatus[anyio.CancelScope]) -> None: """ The sub-thread in which the websocket session runs. """ > send_tx, send_rx = anyio.create_memory_object_stream[Message](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:120: TypeError _____________________ test_partial_async_ws_endpoint[trio] _____________________ test_client_factory = functools.partial(, backend='trio', backend_options={}) def test_partial_async_ws_endpoint( test_client_factory: TestClientFactory, ) -> None: test_client = test_client_factory(app) > with test_client.websocket_connect("/partial/ws") as websocket: tests/test_routing.py:849: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:101: in __enter__ fut, cs = portal.start_task(self._run) /usr/lib/python3.13/site-packages/anyio/from_thread.py:405: in start_task return f, task_status_future.result() /usr/lib64/python3.13/concurrent/futures/_base.py:449: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = async def _run(self, *, task_status: anyio.abc.TaskStatus[anyio.CancelScope]) -> None: """ The sub-thread in which the websocket session runs. """ > send_tx, send_rx = anyio.create_memory_object_stream[Message](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:120: TypeError ___________________ test_websocket_route_middleware[asyncio] ___________________ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) def test_websocket_route_middleware( test_client_factory: TestClientFactory, ) -> None: async def websocket_endpoint(session: WebSocket) -> None: await session.accept() await session.send_text("Hello, world!") await session.close() class WebsocketMiddleware: def __init__(self, app: ASGIApp) -> None: self.app = app async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None: async def modified_send(msg: Message) -> None: if msg["type"] == "websocket.accept": msg["headers"].append((b"X-Test", b"Set by middleware")) await send(msg) await self.app(scope, receive, modified_send) app = Starlette( routes=[ WebSocketRoute( "/ws", endpoint=websocket_endpoint, middleware=[Middleware(WebsocketMiddleware)], ) ] ) client = test_client_factory(app) > with client.websocket_connect("/ws") as websocket: tests/test_routing.py:1127: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:101: in __enter__ fut, cs = portal.start_task(self._run) /usr/lib/python3.13/site-packages/anyio/from_thread.py:405: in start_task return f, task_status_future.result() /usr/lib64/python3.13/concurrent/futures/_base.py:456: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = async def _run(self, *, task_status: anyio.abc.TaskStatus[anyio.CancelScope]) -> None: """ The sub-thread in which the websocket session runs. """ > send_tx, send_rx = anyio.create_memory_object_stream[Message](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:120: TypeError ____________________ test_websocket_route_middleware[trio] _____________________ test_client_factory = functools.partial(, backend='trio', backend_options={}) def test_websocket_route_middleware( test_client_factory: TestClientFactory, ) -> None: async def websocket_endpoint(session: WebSocket) -> None: await session.accept() await session.send_text("Hello, world!") await session.close() class WebsocketMiddleware: def __init__(self, app: ASGIApp) -> None: self.app = app async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None: async def modified_send(msg: Message) -> None: if msg["type"] == "websocket.accept": msg["headers"].append((b"X-Test", b"Set by middleware")) await send(msg) await self.app(scope, receive, modified_send) app = Starlette( routes=[ WebSocketRoute( "/ws", endpoint=websocket_endpoint, middleware=[Middleware(WebsocketMiddleware)], ) ] ) client = test_client_factory(app) > with client.websocket_connect("/ws") as websocket: tests/test_routing.py:1127: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:101: in __enter__ fut, cs = portal.start_task(self._run) /usr/lib/python3.13/site-packages/anyio/from_thread.py:405: in start_task return f, task_status_future.result() /usr/lib64/python3.13/concurrent/futures/_base.py:456: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = async def _run(self, *, task_status: anyio.abc.TaskStatus[anyio.CancelScope]) -> None: """ The sub-thread in which the websocket session runs. """ > send_tx, send_rx = anyio.create_memory_object_stream[Message](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:120: TypeError ________________ test_staticfiles_head_with_middleware[asyncio] ________________ tmpdir = local('/tmp/pytest-of-mockbuild/pytest-0/test_staticfiles_head_with_mid0') test_client_factory = functools.partial(, backend='asyncio', backend_options={}) def test_staticfiles_head_with_middleware(tmpdir: Path, test_client_factory: TestClientFactory) -> None: """ see https://github.com/encode/starlette/pull/935 """ path = os.path.join(tmpdir, "example.txt") with open(path, "w") as file: file.write("x" * 100) async def does_nothing_middleware(request: Request, call_next: RequestResponseEndpoint) -> Response: response = await call_next(request) return response routes = [Mount("/static", app=StaticFiles(directory=tmpdir), name="static")] middleware = [Middleware(BaseHTTPMiddleware, dispatch=does_nothing_middleware)] app = Starlette(routes=routes, middleware=middleware) client = test_client_factory(app) > response = client.head("/static/example.txt") tests/test_staticfiles.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:502: in head return super().head( /usr/lib/python3.13/site-packages/httpx/_client.py:1124: in head return self.request( starlette/testclient.py:428: in request return super().request( /usr/lib/python3.13/site-packages/httpx/_client.py:837: in request return self.send(request, auth=auth, follow_redirects=follow_redirects) /usr/lib/python3.13/site-packages/httpx/_client.py:926: in send response = self._send_handling_auth( /usr/lib/python3.13/site-packages/httpx/_client.py:954: in _send_handling_auth response = self._send_handling_redirects( /usr/lib/python3.13/site-packages/httpx/_client.py:991: in _send_handling_redirects response = self._send_single_request(request) /usr/lib/python3.13/site-packages/httpx/_client.py:1027: in _send_single_request response = transport.handle_request(request) starlette/testclient.py:337: in handle_request raise exc starlette/testclient.py:334: in handle_request portal.call(self.app, scope, receive, send) /usr/lib/python3.13/site-packages/anyio/from_thread.py:277: in call return cast(T_Retval, self.start_task_soon(func, *args).result()) /usr/lib64/python3.13/concurrent/futures/_base.py:456: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval starlette/applications.py:112: in __call__ await self.middleware_stack(scope, receive, send) starlette/middleware/errors.py:187: in __call__ raise exc starlette/middleware/errors.py:165: in __call__ await self.app(scope, receive, _send) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = scope = {'app': , 'client': ('testclient', 50000), 'extensions': {'... b'*/*'), (b'accept-encoding', b'gzip, deflate'), (b'connection', b'keep-alive'), (b'user-agent', b'testclient')], ...} receive = .receive at 0x7f8700225080> send = ._send at 0x7f8701054900> async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None: if scope["type"] != "http": await self.app(scope, receive, send) return request = _CachedRequest(scope, receive) wrapped_receive = request.wrapped_receive response_sent = anyio.Event() async def call_next(request: Request) -> Response: app_exc: Exception | None = None async def receive_or_disconnect() -> Message: if response_sent.is_set(): return {"type": "http.disconnect"} async with anyio.create_task_group() as task_group: async def wrap(func: typing.Callable[[], typing.Awaitable[T]]) -> T: result = await func() task_group.cancel_scope.cancel() return result task_group.start_soon(wrap, response_sent.wait) message = await wrap(wrapped_receive) if response_sent.is_set(): return {"type": "http.disconnect"} return message async def send_no_error(message: Message) -> None: try: await send_stream.send(message) except anyio.BrokenResourceError: # recv_stream has been closed, i.e. response_sent has been set. return async def coro() -> None: nonlocal app_exc with send_stream: try: await self.app(scope, receive_or_disconnect, send_no_error) except Exception as exc: app_exc = exc task_group.start_soon(coro) try: message = await recv_stream.receive() info = message.get("info", None) if message["type"] == "http.response.debug" and info is not None: message = await recv_stream.receive() except anyio.EndOfStream: if app_exc is not None: raise app_exc raise RuntimeError("No response returned.") assert message["type"] == "http.response.start" async def body_stream() -> typing.AsyncGenerator[bytes, None]: async for message in recv_stream: assert message["type"] == "http.response.body" body = message.get("body", b"") if body: yield body if not message.get("more_body", False): break if app_exc is not None: raise app_exc response = _StreamingResponse(status_code=message["status"], content=body_stream(), info=info) response.raw_headers = message["headers"] return response > send_stream, recv_stream = anyio.create_memory_object_stream[Message]() E TypeError: 'function' object is not subscriptable starlette/middleware/base.py:175: TypeError _________________ test_staticfiles_head_with_middleware[trio] __________________ tmpdir = local('/tmp/pytest-of-mockbuild/pytest-0/test_staticfiles_head_with_mid1') test_client_factory = functools.partial(, backend='trio', backend_options={}) def test_staticfiles_head_with_middleware(tmpdir: Path, test_client_factory: TestClientFactory) -> None: """ see https://github.com/encode/starlette/pull/935 """ path = os.path.join(tmpdir, "example.txt") with open(path, "w") as file: file.write("x" * 100) async def does_nothing_middleware(request: Request, call_next: RequestResponseEndpoint) -> Response: response = await call_next(request) return response routes = [Mount("/static", app=StaticFiles(directory=tmpdir), name="static")] middleware = [Middleware(BaseHTTPMiddleware, dispatch=does_nothing_middleware)] app = Starlette(routes=routes, middleware=middleware) client = test_client_factory(app) > response = client.head("/static/example.txt") tests/test_staticfiles.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:502: in head return super().head( /usr/lib/python3.13/site-packages/httpx/_client.py:1124: in head return self.request( starlette/testclient.py:428: in request return super().request( /usr/lib/python3.13/site-packages/httpx/_client.py:837: in request return self.send(request, auth=auth, follow_redirects=follow_redirects) /usr/lib/python3.13/site-packages/httpx/_client.py:926: in send response = self._send_handling_auth( /usr/lib/python3.13/site-packages/httpx/_client.py:954: in _send_handling_auth response = self._send_handling_redirects( /usr/lib/python3.13/site-packages/httpx/_client.py:991: in _send_handling_redirects response = self._send_single_request(request) /usr/lib/python3.13/site-packages/httpx/_client.py:1027: in _send_single_request response = transport.handle_request(request) starlette/testclient.py:337: in handle_request raise exc starlette/testclient.py:334: in handle_request portal.call(self.app, scope, receive, send) /usr/lib/python3.13/site-packages/anyio/from_thread.py:277: in call return cast(T_Retval, self.start_task_soon(func, *args).result()) /usr/lib64/python3.13/concurrent/futures/_base.py:449: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval starlette/applications.py:112: in __call__ await self.middleware_stack(scope, receive, send) starlette/middleware/errors.py:187: in __call__ raise exc starlette/middleware/errors.py:165: in __call__ await self.app(scope, receive, _send) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = scope = {'app': , 'client': ('testclient', 50000), 'extensions': {'... b'*/*'), (b'accept-encoding', b'gzip, deflate'), (b'connection', b'keep-alive'), (b'user-agent', b'testclient')], ...} receive = .receive at 0x7f87002276a0> send = ._send at 0x7f8700f86980> async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None: if scope["type"] != "http": await self.app(scope, receive, send) return request = _CachedRequest(scope, receive) wrapped_receive = request.wrapped_receive response_sent = anyio.Event() async def call_next(request: Request) -> Response: app_exc: Exception | None = None async def receive_or_disconnect() -> Message: if response_sent.is_set(): return {"type": "http.disconnect"} async with anyio.create_task_group() as task_group: async def wrap(func: typing.Callable[[], typing.Awaitable[T]]) -> T: result = await func() task_group.cancel_scope.cancel() return result task_group.start_soon(wrap, response_sent.wait) message = await wrap(wrapped_receive) if response_sent.is_set(): return {"type": "http.disconnect"} return message async def send_no_error(message: Message) -> None: try: await send_stream.send(message) except anyio.BrokenResourceError: # recv_stream has been closed, i.e. response_sent has been set. return async def coro() -> None: nonlocal app_exc with send_stream: try: await self.app(scope, receive_or_disconnect, send_no_error) except Exception as exc: app_exc = exc task_group.start_soon(coro) try: message = await recv_stream.receive() info = message.get("info", None) if message["type"] == "http.response.debug" and info is not None: message = await recv_stream.receive() except anyio.EndOfStream: if app_exc is not None: raise app_exc raise RuntimeError("No response returned.") assert message["type"] == "http.response.start" async def body_stream() -> typing.AsyncGenerator[bytes, None]: async for message in recv_stream: assert message["type"] == "http.response.body" body = message.get("body", b"") if body: yield body if not message.get("more_body", False): break if app_exc is not None: raise app_exc response = _StreamingResponse(status_code=message["status"], content=body_stream(), info=info) response.raw_headers = message["headers"] return response > send_stream, recv_stream = anyio.create_memory_object_stream[Message]() E TypeError: 'function' object is not subscriptable starlette/middleware/base.py:175: TypeError ____________________ test_template_with_middleware[asyncio] ____________________ tmpdir = local('/tmp/pytest-of-mockbuild/pytest-0/test_template_with_middleware_0') test_client_factory = functools.partial(, backend='asyncio', backend_options={}) def test_template_with_middleware(tmpdir: Path, test_client_factory: TestClientFactory) -> None: path = os.path.join(tmpdir, "index.html") with open(path, "w") as file: file.write("Hello, world") async def homepage(request: Request) -> Response: return templates.TemplateResponse(request, "index.html") class CustomMiddleware(BaseHTTPMiddleware): async def dispatch(self, request: Request, call_next: RequestResponseEndpoint) -> Response: return await call_next(request) app = Starlette( debug=True, routes=[Route("/", endpoint=homepage)], middleware=[Middleware(CustomMiddleware)], ) templates = Jinja2Templates(directory=str(tmpdir)) client = test_client_factory(app) > response = client.get("/") tests/test_templates.py:87: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:456: in get return super().get( /usr/lib/python3.13/site-packages/httpx/_client.py:1066: in get return self.request( starlette/testclient.py:428: in request return super().request( /usr/lib/python3.13/site-packages/httpx/_client.py:837: in request return self.send(request, auth=auth, follow_redirects=follow_redirects) /usr/lib/python3.13/site-packages/httpx/_client.py:926: in send response = self._send_handling_auth( /usr/lib/python3.13/site-packages/httpx/_client.py:954: in _send_handling_auth response = self._send_handling_redirects( /usr/lib/python3.13/site-packages/httpx/_client.py:991: in _send_handling_redirects response = self._send_single_request(request) /usr/lib/python3.13/site-packages/httpx/_client.py:1027: in _send_single_request response = transport.handle_request(request) starlette/testclient.py:337: in handle_request raise exc starlette/testclient.py:334: in handle_request portal.call(self.app, scope, receive, send) /usr/lib/python3.13/site-packages/anyio/from_thread.py:277: in call return cast(T_Retval, self.start_task_soon(func, *args).result()) /usr/lib64/python3.13/concurrent/futures/_base.py:456: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval starlette/applications.py:112: in __call__ await self.middleware_stack(scope, receive, send) starlette/middleware/errors.py:187: in __call__ raise exc starlette/middleware/errors.py:165: in __call__ await self.app(scope, receive, _send) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = .CustomMiddleware object at 0x7f870205ecf0> scope = {'app': , 'client': ('testclient', 50000), 'extensions': {'... b'*/*'), (b'accept-encoding', b'gzip, deflate'), (b'connection', b'keep-alive'), (b'user-agent', b'testclient')], ...} receive = .receive at 0x7f8700644540> send = ._send at 0x7f8700645e40> async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None: if scope["type"] != "http": await self.app(scope, receive, send) return request = _CachedRequest(scope, receive) wrapped_receive = request.wrapped_receive response_sent = anyio.Event() async def call_next(request: Request) -> Response: app_exc: Exception | None = None async def receive_or_disconnect() -> Message: if response_sent.is_set(): return {"type": "http.disconnect"} async with anyio.create_task_group() as task_group: async def wrap(func: typing.Callable[[], typing.Awaitable[T]]) -> T: result = await func() task_group.cancel_scope.cancel() return result task_group.start_soon(wrap, response_sent.wait) message = await wrap(wrapped_receive) if response_sent.is_set(): return {"type": "http.disconnect"} return message async def send_no_error(message: Message) -> None: try: await send_stream.send(message) except anyio.BrokenResourceError: # recv_stream has been closed, i.e. response_sent has been set. return async def coro() -> None: nonlocal app_exc with send_stream: try: await self.app(scope, receive_or_disconnect, send_no_error) except Exception as exc: app_exc = exc task_group.start_soon(coro) try: message = await recv_stream.receive() info = message.get("info", None) if message["type"] == "http.response.debug" and info is not None: message = await recv_stream.receive() except anyio.EndOfStream: if app_exc is not None: raise app_exc raise RuntimeError("No response returned.") assert message["type"] == "http.response.start" async def body_stream() -> typing.AsyncGenerator[bytes, None]: async for message in recv_stream: assert message["type"] == "http.response.body" body = message.get("body", b"") if body: yield body if not message.get("more_body", False): break if app_exc is not None: raise app_exc response = _StreamingResponse(status_code=message["status"], content=body_stream(), info=info) response.raw_headers = message["headers"] return response > send_stream, recv_stream = anyio.create_memory_object_stream[Message]() E TypeError: 'function' object is not subscriptable starlette/middleware/base.py:175: TypeError _____________________ test_template_with_middleware[trio] ______________________ tmpdir = local('/tmp/pytest-of-mockbuild/pytest-0/test_template_with_middleware_1') test_client_factory = functools.partial(, backend='trio', backend_options={}) def test_template_with_middleware(tmpdir: Path, test_client_factory: TestClientFactory) -> None: path = os.path.join(tmpdir, "index.html") with open(path, "w") as file: file.write("Hello, world") async def homepage(request: Request) -> Response: return templates.TemplateResponse(request, "index.html") class CustomMiddleware(BaseHTTPMiddleware): async def dispatch(self, request: Request, call_next: RequestResponseEndpoint) -> Response: return await call_next(request) app = Starlette( debug=True, routes=[Route("/", endpoint=homepage)], middleware=[Middleware(CustomMiddleware)], ) templates = Jinja2Templates(directory=str(tmpdir)) client = test_client_factory(app) > response = client.get("/") tests/test_templates.py:87: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:456: in get return super().get( /usr/lib/python3.13/site-packages/httpx/_client.py:1066: in get return self.request( starlette/testclient.py:428: in request return super().request( /usr/lib/python3.13/site-packages/httpx/_client.py:837: in request return self.send(request, auth=auth, follow_redirects=follow_redirects) /usr/lib/python3.13/site-packages/httpx/_client.py:926: in send response = self._send_handling_auth( /usr/lib/python3.13/site-packages/httpx/_client.py:954: in _send_handling_auth response = self._send_handling_redirects( /usr/lib/python3.13/site-packages/httpx/_client.py:991: in _send_handling_redirects response = self._send_single_request(request) /usr/lib/python3.13/site-packages/httpx/_client.py:1027: in _send_single_request response = transport.handle_request(request) starlette/testclient.py:337: in handle_request raise exc starlette/testclient.py:334: in handle_request portal.call(self.app, scope, receive, send) /usr/lib/python3.13/site-packages/anyio/from_thread.py:277: in call return cast(T_Retval, self.start_task_soon(func, *args).result()) /usr/lib64/python3.13/concurrent/futures/_base.py:449: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval starlette/applications.py:112: in __call__ await self.middleware_stack(scope, receive, send) starlette/middleware/errors.py:187: in __call__ raise exc starlette/middleware/errors.py:165: in __call__ await self.app(scope, receive, _send) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = .CustomMiddleware object at 0x7f87027e6510> scope = {'app': , 'client': ('testclient', 50000), 'extensions': {'... b'*/*'), (b'accept-encoding', b'gzip, deflate'), (b'connection', b'keep-alive'), (b'user-agent', b'testclient')], ...} receive = .receive at 0x7f8701056160> send = ._send at 0x7f870023ba60> async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None: if scope["type"] != "http": await self.app(scope, receive, send) return request = _CachedRequest(scope, receive) wrapped_receive = request.wrapped_receive response_sent = anyio.Event() async def call_next(request: Request) -> Response: app_exc: Exception | None = None async def receive_or_disconnect() -> Message: if response_sent.is_set(): return {"type": "http.disconnect"} async with anyio.create_task_group() as task_group: async def wrap(func: typing.Callable[[], typing.Awaitable[T]]) -> T: result = await func() task_group.cancel_scope.cancel() return result task_group.start_soon(wrap, response_sent.wait) message = await wrap(wrapped_receive) if response_sent.is_set(): return {"type": "http.disconnect"} return message async def send_no_error(message: Message) -> None: try: await send_stream.send(message) except anyio.BrokenResourceError: # recv_stream has been closed, i.e. response_sent has been set. return async def coro() -> None: nonlocal app_exc with send_stream: try: await self.app(scope, receive_or_disconnect, send_no_error) except Exception as exc: app_exc = exc task_group.start_soon(coro) try: message = await recv_stream.receive() info = message.get("info", None) if message["type"] == "http.response.debug" and info is not None: message = await recv_stream.receive() except anyio.EndOfStream: if app_exc is not None: raise app_exc raise RuntimeError("No response returned.") assert message["type"] == "http.response.start" async def body_stream() -> typing.AsyncGenerator[bytes, None]: async for message in recv_stream: assert message["type"] == "http.response.body" body = message.get("body", b"") if body: yield body if not message.get("more_body", False): break if app_exc is not None: raise app_exc response = _StreamingResponse(status_code=message["status"], content=body_stream(), info=info) response.raw_headers = message["headers"] return response > send_stream, recv_stream = anyio.create_memory_object_stream[Message]() E TypeError: 'function' object is not subscriptable starlette/middleware/base.py:175: TypeError ________________ test_use_testclient_as_contextmanager[asyncio] ________________ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) anyio_backend_name = 'asyncio' def test_use_testclient_as_contextmanager(test_client_factory: TestClientFactory, anyio_backend_name: str) -> None: """ This test asserts a number of properties that are important for an app level task_group """ counter = itertools.count() identity_runvar = anyio.lowlevel.RunVar[int]("identity_runvar") def get_identity() -> int: try: return identity_runvar.get() except LookupError: token = next(counter) identity_runvar.set(token) return token startup_task = object() startup_loop = None shutdown_task = object() shutdown_loop = None @asynccontextmanager async def lifespan_context(app: Starlette) -> AsyncGenerator[None, None]: nonlocal startup_task, startup_loop, shutdown_task, shutdown_loop startup_task = current_task() startup_loop = get_identity() async with anyio.create_task_group(): yield shutdown_task = current_task() shutdown_loop = get_identity() async def loop_id(request: Request) -> JSONResponse: return JSONResponse(get_identity()) app = Starlette( lifespan=lifespan_context, routes=[Route("/loop_id", endpoint=loop_id)], ) client = test_client_factory(app) > with client: tests/test_testclient.py:134: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __enter__(self) -> TestClient: with contextlib.ExitStack() as stack: self.portal = portal = stack.enter_context(anyio.from_thread.start_blocking_portal(**self.async_backend)) @stack.callback def reset_portal() -> None: self.portal = None > send1, receive1 = anyio.create_memory_object_stream[ typing.Union[typing.MutableMapping[str, typing.Any], None] ](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:660: TypeError _________________ test_use_testclient_as_contextmanager[trio] __________________ test_client_factory = functools.partial(, backend='trio', backend_options={}) anyio_backend_name = 'trio' def test_use_testclient_as_contextmanager(test_client_factory: TestClientFactory, anyio_backend_name: str) -> None: """ This test asserts a number of properties that are important for an app level task_group """ counter = itertools.count() identity_runvar = anyio.lowlevel.RunVar[int]("identity_runvar") def get_identity() -> int: try: return identity_runvar.get() except LookupError: token = next(counter) identity_runvar.set(token) return token startup_task = object() startup_loop = None shutdown_task = object() shutdown_loop = None @asynccontextmanager async def lifespan_context(app: Starlette) -> AsyncGenerator[None, None]: nonlocal startup_task, startup_loop, shutdown_task, shutdown_loop startup_task = current_task() startup_loop = get_identity() async with anyio.create_task_group(): yield shutdown_task = current_task() shutdown_loop = get_identity() async def loop_id(request: Request) -> JSONResponse: return JSONResponse(get_identity()) app = Starlette( lifespan=lifespan_context, routes=[Route("/loop_id", endpoint=loop_id)], ) client = test_client_factory(app) > with client: tests/test_testclient.py:134: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __enter__(self) -> TestClient: with contextlib.ExitStack() as stack: self.portal = portal = stack.enter_context(anyio.from_thread.start_blocking_portal(**self.async_backend)) @stack.callback def reset_portal() -> None: self.portal = None > send1, receive1 = anyio.create_memory_object_stream[ typing.Union[typing.MutableMapping[str, typing.Any], None] ](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:660: TypeError ________________________ test_error_on_startup[asyncio] ________________________ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) def test_error_on_startup(test_client_factory: TestClientFactory) -> None: with pytest.deprecated_call(match="The on_startup and on_shutdown parameters are deprecated"): startup_error_app = Starlette(on_startup=[startup]) with pytest.raises(RuntimeError): > with test_client_factory(startup_error_app): tests/test_testclient.py:175: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __enter__(self) -> TestClient: with contextlib.ExitStack() as stack: self.portal = portal = stack.enter_context(anyio.from_thread.start_blocking_portal(**self.async_backend)) @stack.callback def reset_portal() -> None: self.portal = None > send1, receive1 = anyio.create_memory_object_stream[ typing.Union[typing.MutableMapping[str, typing.Any], None] ](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:660: TypeError _________________________ test_error_on_startup[trio] __________________________ test_client_factory = functools.partial(, backend='trio', backend_options={}) def test_error_on_startup(test_client_factory: TestClientFactory) -> None: with pytest.deprecated_call(match="The on_startup and on_shutdown parameters are deprecated"): startup_error_app = Starlette(on_startup=[startup]) with pytest.raises(RuntimeError): > with test_client_factory(startup_error_app): tests/test_testclient.py:175: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __enter__(self) -> TestClient: with contextlib.ExitStack() as stack: self.portal = portal = stack.enter_context(anyio.from_thread.start_blocking_portal(**self.async_backend)) @stack.callback def reset_portal() -> None: self.portal = None > send1, receive1 = anyio.create_memory_object_stream[ typing.Union[typing.MutableMapping[str, typing.Any], None] ](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:660: TypeError ____________________ test_exception_in_middleware[asyncio] _____________________ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) def test_exception_in_middleware(test_client_factory: TestClientFactory) -> None: class MiddlewareException(Exception): pass class BrokenMiddleware: def __init__(self, app: ASGIApp): self.app = app async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None: raise MiddlewareException() broken_middleware = Starlette(middleware=[Middleware(BrokenMiddleware)]) with pytest.raises(MiddlewareException): > with test_client_factory(broken_middleware): tests/test_testclient.py:193: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __enter__(self) -> TestClient: with contextlib.ExitStack() as stack: self.portal = portal = stack.enter_context(anyio.from_thread.start_blocking_portal(**self.async_backend)) @stack.callback def reset_portal() -> None: self.portal = None > send1, receive1 = anyio.create_memory_object_stream[ typing.Union[typing.MutableMapping[str, typing.Any], None] ](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:660: TypeError ______________________ test_exception_in_middleware[trio] ______________________ test_client_factory = functools.partial(, backend='trio', backend_options={}) def test_exception_in_middleware(test_client_factory: TestClientFactory) -> None: class MiddlewareException(Exception): pass class BrokenMiddleware: def __init__(self, app: ASGIApp): self.app = app async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None: raise MiddlewareException() broken_middleware = Starlette(middleware=[Middleware(BrokenMiddleware)]) with pytest.raises(MiddlewareException): > with test_client_factory(broken_middleware): tests/test_testclient.py:193: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __enter__(self) -> TestClient: with contextlib.ExitStack() as stack: self.portal = portal = stack.enter_context(anyio.from_thread.start_blocking_portal(**self.async_backend)) @stack.callback def reset_portal() -> None: self.portal = None > send1, receive1 = anyio.create_memory_object_stream[ typing.Union[typing.MutableMapping[str, typing.Any], None] ](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:660: TypeError ___________________ test_websocket_blocking_receive[asyncio] ___________________ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) def test_websocket_blocking_receive(test_client_factory: TestClientFactory) -> None: def app(scope: Scope) -> ASGIInstance: async def respond(websocket: WebSocket) -> None: await websocket.send_json({"message": "test"}) async def asgi(receive: Receive, send: Send) -> None: websocket = WebSocket(scope, receive=receive, send=send) await websocket.accept() async with anyio.create_task_group() as task_group: task_group.start_soon(respond, websocket) try: # this will block as the client does not send us data # it should not prevent `respond` from executing though await websocket.receive_json() except WebSocketDisconnect: pass return asgi client = test_client_factory(app) # type: ignore > with client.websocket_connect("/") as websocket: tests/test_testclient.py:252: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:101: in __enter__ fut, cs = portal.start_task(self._run) /usr/lib/python3.13/site-packages/anyio/from_thread.py:405: in start_task return f, task_status_future.result() /usr/lib64/python3.13/concurrent/futures/_base.py:456: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = async def _run(self, *, task_status: anyio.abc.TaskStatus[anyio.CancelScope]) -> None: """ The sub-thread in which the websocket session runs. """ > send_tx, send_rx = anyio.create_memory_object_stream[Message](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:120: TypeError ____________________ test_websocket_blocking_receive[trio] _____________________ test_client_factory = functools.partial(, backend='trio', backend_options={}) def test_websocket_blocking_receive(test_client_factory: TestClientFactory) -> None: def app(scope: Scope) -> ASGIInstance: async def respond(websocket: WebSocket) -> None: await websocket.send_json({"message": "test"}) async def asgi(receive: Receive, send: Send) -> None: websocket = WebSocket(scope, receive=receive, send=send) await websocket.accept() async with anyio.create_task_group() as task_group: task_group.start_soon(respond, websocket) try: # this will block as the client does not send us data # it should not prevent `respond` from executing though await websocket.receive_json() except WebSocketDisconnect: pass return asgi client = test_client_factory(app) # type: ignore > with client.websocket_connect("/") as websocket: tests/test_testclient.py:252: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:101: in __enter__ fut, cs = portal.start_task(self._run) /usr/lib/python3.13/site-packages/anyio/from_thread.py:405: in start_task return f, task_status_future.result() /usr/lib64/python3.13/concurrent/futures/_base.py:449: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = async def _run(self, *, task_status: anyio.abc.TaskStatus[anyio.CancelScope]) -> None: """ The sub-thread in which the websocket session runs. """ > send_tx, send_rx = anyio.create_memory_object_stream[Message](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:120: TypeError __________________ test_websocket_not_block_on_close[asyncio] __________________ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) def test_websocket_not_block_on_close(test_client_factory: TestClientFactory) -> None: cancelled = False def app(scope: Scope) -> ASGIInstance: async def asgi(receive: Receive, send: Send) -> None: nonlocal cancelled try: websocket = WebSocket(scope, receive=receive, send=send) await websocket.accept() await anyio.sleep_forever() except anyio.get_cancelled_exc_class(): cancelled = True raise return asgi client = test_client_factory(app) # type: ignore > with client.websocket_connect("/"): tests/test_testclient.py:274: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:101: in __enter__ fut, cs = portal.start_task(self._run) /usr/lib/python3.13/site-packages/anyio/from_thread.py:405: in start_task return f, task_status_future.result() /usr/lib64/python3.13/concurrent/futures/_base.py:456: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = async def _run(self, *, task_status: anyio.abc.TaskStatus[anyio.CancelScope]) -> None: """ The sub-thread in which the websocket session runs. """ > send_tx, send_rx = anyio.create_memory_object_stream[Message](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:120: TypeError ___________________ test_websocket_not_block_on_close[trio] ____________________ test_client_factory = functools.partial(, backend='trio', backend_options={}) def test_websocket_not_block_on_close(test_client_factory: TestClientFactory) -> None: cancelled = False def app(scope: Scope) -> ASGIInstance: async def asgi(receive: Receive, send: Send) -> None: nonlocal cancelled try: websocket = WebSocket(scope, receive=receive, send=send) await websocket.accept() await anyio.sleep_forever() except anyio.get_cancelled_exc_class(): cancelled = True raise return asgi client = test_client_factory(app) # type: ignore > with client.websocket_connect("/"): tests/test_testclient.py:274: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:101: in __enter__ fut, cs = portal.start_task(self._run) /usr/lib/python3.13/site-packages/anyio/from_thread.py:405: in start_task return f, task_status_future.result() /usr/lib64/python3.13/concurrent/futures/_base.py:449: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = async def _run(self, *, task_status: anyio.abc.TaskStatus[anyio.CancelScope]) -> None: """ The sub-thread in which the websocket session runs. """ > send_tx, send_rx = anyio.create_memory_object_stream[Message](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:120: TypeError _______________ test_websocket_raw_path_without_params[asyncio] ________________ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) def test_websocket_raw_path_without_params(test_client_factory: TestClientFactory) -> None: async def app(scope: Scope, receive: Receive, send: Send) -> None: websocket = WebSocket(scope, receive=receive, send=send) await websocket.accept() raw_path = scope.get("raw_path") assert raw_path is not None await websocket.send_bytes(raw_path) client = test_client_factory(app) > with client.websocket_connect("/hello-world", params={"foo": "bar"}) as websocket: tests/test_testclient.py:422: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:101: in __enter__ fut, cs = portal.start_task(self._run) /usr/lib/python3.13/site-packages/anyio/from_thread.py:405: in start_task return f, task_status_future.result() /usr/lib64/python3.13/concurrent/futures/_base.py:456: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = async def _run(self, *, task_status: anyio.abc.TaskStatus[anyio.CancelScope]) -> None: """ The sub-thread in which the websocket session runs. """ > send_tx, send_rx = anyio.create_memory_object_stream[Message](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:120: TypeError _________________ test_websocket_raw_path_without_params[trio] _________________ test_client_factory = functools.partial(, backend='trio', backend_options={}) def test_websocket_raw_path_without_params(test_client_factory: TestClientFactory) -> None: async def app(scope: Scope, receive: Receive, send: Send) -> None: websocket = WebSocket(scope, receive=receive, send=send) await websocket.accept() raw_path = scope.get("raw_path") assert raw_path is not None await websocket.send_bytes(raw_path) client = test_client_factory(app) > with client.websocket_connect("/hello-world", params={"foo": "bar"}) as websocket: tests/test_testclient.py:422: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:101: in __enter__ fut, cs = portal.start_task(self._run) /usr/lib/python3.13/site-packages/anyio/from_thread.py:405: in start_task return f, task_status_future.result() /usr/lib64/python3.13/concurrent/futures/_base.py:449: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = async def _run(self, *, task_status: anyio.abc.TaskStatus[anyio.CancelScope]) -> None: """ The sub-thread in which the websocket session runs. """ > send_tx, send_rx = anyio.create_memory_object_stream[Message](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:120: TypeError _________________________ test_websocket_url[asyncio] __________________________ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) def test_websocket_url(test_client_factory: TestClientFactory) -> None: async def app(scope: Scope, receive: Receive, send: Send) -> None: websocket = WebSocket(scope, receive=receive, send=send) await websocket.accept() await websocket.send_json({"url": str(websocket.url)}) await websocket.close() client = test_client_factory(app) > with client.websocket_connect("/123?a=abc") as websocket: tests/test_websockets.py:25: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:101: in __enter__ fut, cs = portal.start_task(self._run) /usr/lib/python3.13/site-packages/anyio/from_thread.py:405: in start_task return f, task_status_future.result() /usr/lib64/python3.13/concurrent/futures/_base.py:456: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = async def _run(self, *, task_status: anyio.abc.TaskStatus[anyio.CancelScope]) -> None: """ The sub-thread in which the websocket session runs. """ > send_tx, send_rx = anyio.create_memory_object_stream[Message](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:120: TypeError ___________________________ test_websocket_url[trio] ___________________________ test_client_factory = functools.partial(, backend='trio', backend_options={}) def test_websocket_url(test_client_factory: TestClientFactory) -> None: async def app(scope: Scope, receive: Receive, send: Send) -> None: websocket = WebSocket(scope, receive=receive, send=send) await websocket.accept() await websocket.send_json({"url": str(websocket.url)}) await websocket.close() client = test_client_factory(app) > with client.websocket_connect("/123?a=abc") as websocket: tests/test_websockets.py:25: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:101: in __enter__ fut, cs = portal.start_task(self._run) /usr/lib/python3.13/site-packages/anyio/from_thread.py:405: in start_task return f, task_status_future.result() /usr/lib64/python3.13/concurrent/futures/_base.py:449: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = async def _run(self, *, task_status: anyio.abc.TaskStatus[anyio.CancelScope]) -> None: """ The sub-thread in which the websocket session runs. """ > send_tx, send_rx = anyio.create_memory_object_stream[Message](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:120: TypeError _____________________ test_websocket_binary_json[asyncio] ______________________ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) def test_websocket_binary_json(test_client_factory: TestClientFactory) -> None: async def app(scope: Scope, receive: Receive, send: Send) -> None: websocket = WebSocket(scope, receive=receive, send=send) await websocket.accept() message = await websocket.receive_json(mode="binary") await websocket.send_json(message, mode="binary") await websocket.close() client = test_client_factory(app) > with client.websocket_connect("/123?a=abc") as websocket: tests/test_websockets.py:39: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:101: in __enter__ fut, cs = portal.start_task(self._run) /usr/lib/python3.13/site-packages/anyio/from_thread.py:405: in start_task return f, task_status_future.result() /usr/lib64/python3.13/concurrent/futures/_base.py:456: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = async def _run(self, *, task_status: anyio.abc.TaskStatus[anyio.CancelScope]) -> None: """ The sub-thread in which the websocket session runs. """ > send_tx, send_rx = anyio.create_memory_object_stream[Message](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:120: TypeError _______________________ test_websocket_binary_json[trio] _______________________ test_client_factory = functools.partial(, backend='trio', backend_options={}) def test_websocket_binary_json(test_client_factory: TestClientFactory) -> None: async def app(scope: Scope, receive: Receive, send: Send) -> None: websocket = WebSocket(scope, receive=receive, send=send) await websocket.accept() message = await websocket.receive_json(mode="binary") await websocket.send_json(message, mode="binary") await websocket.close() client = test_client_factory(app) > with client.websocket_connect("/123?a=abc") as websocket: tests/test_websockets.py:39: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:101: in __enter__ fut, cs = portal.start_task(self._run) /usr/lib/python3.13/site-packages/anyio/from_thread.py:405: in start_task return f, task_status_future.result() /usr/lib64/python3.13/concurrent/futures/_base.py:449: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = async def _run(self, *, task_status: anyio.abc.TaskStatus[anyio.CancelScope]) -> None: """ The sub-thread in which the websocket session runs. """ > send_tx, send_rx = anyio.create_memory_object_stream[Message](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:120: TypeError _____________ test_websocket_ensure_unicode_on_send_json[asyncio] ______________ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) def test_websocket_ensure_unicode_on_send_json( test_client_factory: TestClientFactory, ) -> None: async def app(scope: Scope, receive: Receive, send: Send) -> None: websocket = WebSocket(scope, receive=receive, send=send) await websocket.accept() message = await websocket.receive_json(mode="text") await websocket.send_json(message, mode="text") await websocket.close() client = test_client_factory(app) > with client.websocket_connect("/123?a=abc") as websocket: tests/test_websockets.py:57: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:101: in __enter__ fut, cs = portal.start_task(self._run) /usr/lib/python3.13/site-packages/anyio/from_thread.py:405: in start_task return f, task_status_future.result() /usr/lib64/python3.13/concurrent/futures/_base.py:456: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = async def _run(self, *, task_status: anyio.abc.TaskStatus[anyio.CancelScope]) -> None: """ The sub-thread in which the websocket session runs. """ > send_tx, send_rx = anyio.create_memory_object_stream[Message](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:120: TypeError _______________ test_websocket_ensure_unicode_on_send_json[trio] _______________ test_client_factory = functools.partial(, backend='trio', backend_options={}) def test_websocket_ensure_unicode_on_send_json( test_client_factory: TestClientFactory, ) -> None: async def app(scope: Scope, receive: Receive, send: Send) -> None: websocket = WebSocket(scope, receive=receive, send=send) await websocket.accept() message = await websocket.receive_json(mode="text") await websocket.send_json(message, mode="text") await websocket.close() client = test_client_factory(app) > with client.websocket_connect("/123?a=abc") as websocket: tests/test_websockets.py:57: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:101: in __enter__ fut, cs = portal.start_task(self._run) /usr/lib/python3.13/site-packages/anyio/from_thread.py:405: in start_task return f, task_status_future.result() /usr/lib64/python3.13/concurrent/futures/_base.py:449: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = async def _run(self, *, task_status: anyio.abc.TaskStatus[anyio.CancelScope]) -> None: """ The sub-thread in which the websocket session runs. """ > send_tx, send_rx = anyio.create_memory_object_stream[Message](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:120: TypeError _____________________ test_websocket_query_params[asyncio] _____________________ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) def test_websocket_query_params(test_client_factory: TestClientFactory) -> None: async def app(scope: Scope, receive: Receive, send: Send) -> None: websocket = WebSocket(scope, receive=receive, send=send) query_params = dict(websocket.query_params) await websocket.accept() await websocket.send_json({"params": query_params}) await websocket.close() client = test_client_factory(app) > with client.websocket_connect("/?a=abc&b=456") as websocket: tests/test_websockets.py:72: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:101: in __enter__ fut, cs = portal.start_task(self._run) /usr/lib/python3.13/site-packages/anyio/from_thread.py:405: in start_task return f, task_status_future.result() /usr/lib64/python3.13/concurrent/futures/_base.py:456: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = async def _run(self, *, task_status: anyio.abc.TaskStatus[anyio.CancelScope]) -> None: """ The sub-thread in which the websocket session runs. """ > send_tx, send_rx = anyio.create_memory_object_stream[Message](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:120: TypeError ______________________ test_websocket_query_params[trio] _______________________ test_client_factory = functools.partial(, backend='trio', backend_options={}) def test_websocket_query_params(test_client_factory: TestClientFactory) -> None: async def app(scope: Scope, receive: Receive, send: Send) -> None: websocket = WebSocket(scope, receive=receive, send=send) query_params = dict(websocket.query_params) await websocket.accept() await websocket.send_json({"params": query_params}) await websocket.close() client = test_client_factory(app) > with client.websocket_connect("/?a=abc&b=456") as websocket: tests/test_websockets.py:72: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:101: in __enter__ fut, cs = portal.start_task(self._run) /usr/lib/python3.13/site-packages/anyio/from_thread.py:405: in start_task return f, task_status_future.result() /usr/lib64/python3.13/concurrent/futures/_base.py:449: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = async def _run(self, *, task_status: anyio.abc.TaskStatus[anyio.CancelScope]) -> None: """ The sub-thread in which the websocket session runs. """ > send_tx, send_rx = anyio.create_memory_object_stream[Message](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:120: TypeError _______________________ test_websocket_headers[asyncio] ________________________ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) @pytest.mark.skipif( any(module in sys.modules for module in ("brotli", "brotlicffi")), reason='urllib3 includes "br" to the "accept-encoding" headers.', ) def test_websocket_headers(test_client_factory: TestClientFactory) -> None: async def app(scope: Scope, receive: Receive, send: Send) -> None: websocket = WebSocket(scope, receive=receive, send=send) headers = dict(websocket.headers) await websocket.accept() await websocket.send_json({"headers": headers}) await websocket.close() client = test_client_factory(app) > with client.websocket_connect("/") as websocket: tests/test_websockets.py:90: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:101: in __enter__ fut, cs = portal.start_task(self._run) /usr/lib/python3.13/site-packages/anyio/from_thread.py:405: in start_task return f, task_status_future.result() /usr/lib64/python3.13/concurrent/futures/_base.py:456: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = async def _run(self, *, task_status: anyio.abc.TaskStatus[anyio.CancelScope]) -> None: """ The sub-thread in which the websocket session runs. """ > send_tx, send_rx = anyio.create_memory_object_stream[Message](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:120: TypeError _________________________ test_websocket_headers[trio] _________________________ test_client_factory = functools.partial(, backend='trio', backend_options={}) @pytest.mark.skipif( any(module in sys.modules for module in ("brotli", "brotlicffi")), reason='urllib3 includes "br" to the "accept-encoding" headers.', ) def test_websocket_headers(test_client_factory: TestClientFactory) -> None: async def app(scope: Scope, receive: Receive, send: Send) -> None: websocket = WebSocket(scope, receive=receive, send=send) headers = dict(websocket.headers) await websocket.accept() await websocket.send_json({"headers": headers}) await websocket.close() client = test_client_factory(app) > with client.websocket_connect("/") as websocket: tests/test_websockets.py:90: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:101: in __enter__ fut, cs = portal.start_task(self._run) /usr/lib/python3.13/site-packages/anyio/from_thread.py:405: in start_task return f, task_status_future.result() /usr/lib64/python3.13/concurrent/futures/_base.py:449: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = async def _run(self, *, task_status: anyio.abc.TaskStatus[anyio.CancelScope]) -> None: """ The sub-thread in which the websocket session runs. """ > send_tx, send_rx = anyio.create_memory_object_stream[Message](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:120: TypeError _________________________ test_websocket_port[asyncio] _________________________ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) def test_websocket_port(test_client_factory: TestClientFactory) -> None: async def app(scope: Scope, receive: Receive, send: Send) -> None: websocket = WebSocket(scope, receive=receive, send=send) await websocket.accept() await websocket.send_json({"port": websocket.url.port}) await websocket.close() client = test_client_factory(app) > with client.websocket_connect("ws://example.com:123/123?a=abc") as websocket: tests/test_websockets.py:112: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:101: in __enter__ fut, cs = portal.start_task(self._run) /usr/lib/python3.13/site-packages/anyio/from_thread.py:405: in start_task return f, task_status_future.result() /usr/lib64/python3.13/concurrent/futures/_base.py:456: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = async def _run(self, *, task_status: anyio.abc.TaskStatus[anyio.CancelScope]) -> None: """ The sub-thread in which the websocket session runs. """ > send_tx, send_rx = anyio.create_memory_object_stream[Message](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:120: TypeError __________________________ test_websocket_port[trio] ___________________________ test_client_factory = functools.partial(, backend='trio', backend_options={}) def test_websocket_port(test_client_factory: TestClientFactory) -> None: async def app(scope: Scope, receive: Receive, send: Send) -> None: websocket = WebSocket(scope, receive=receive, send=send) await websocket.accept() await websocket.send_json({"port": websocket.url.port}) await websocket.close() client = test_client_factory(app) > with client.websocket_connect("ws://example.com:123/123?a=abc") as websocket: tests/test_websockets.py:112: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:101: in __enter__ fut, cs = portal.start_task(self._run) /usr/lib/python3.13/site-packages/anyio/from_thread.py:405: in start_task return f, task_status_future.result() /usr/lib64/python3.13/concurrent/futures/_base.py:449: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = async def _run(self, *, task_status: anyio.abc.TaskStatus[anyio.CancelScope]) -> None: """ The sub-thread in which the websocket session runs. """ > send_tx, send_rx = anyio.create_memory_object_stream[Message](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:120: TypeError ________________ test_websocket_send_and_receive_text[asyncio] _________________ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) def test_websocket_send_and_receive_text( test_client_factory: TestClientFactory, ) -> None: async def app(scope: Scope, receive: Receive, send: Send) -> None: websocket = WebSocket(scope, receive=receive, send=send) await websocket.accept() data = await websocket.receive_text() await websocket.send_text("Message was: " + data) await websocket.close() client = test_client_factory(app) > with client.websocket_connect("/") as websocket: tests/test_websockets.py:128: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:101: in __enter__ fut, cs = portal.start_task(self._run) /usr/lib/python3.13/site-packages/anyio/from_thread.py:405: in start_task return f, task_status_future.result() /usr/lib64/python3.13/concurrent/futures/_base.py:456: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = async def _run(self, *, task_status: anyio.abc.TaskStatus[anyio.CancelScope]) -> None: """ The sub-thread in which the websocket session runs. """ > send_tx, send_rx = anyio.create_memory_object_stream[Message](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:120: TypeError __________________ test_websocket_send_and_receive_text[trio] __________________ test_client_factory = functools.partial(, backend='trio', backend_options={}) def test_websocket_send_and_receive_text( test_client_factory: TestClientFactory, ) -> None: async def app(scope: Scope, receive: Receive, send: Send) -> None: websocket = WebSocket(scope, receive=receive, send=send) await websocket.accept() data = await websocket.receive_text() await websocket.send_text("Message was: " + data) await websocket.close() client = test_client_factory(app) > with client.websocket_connect("/") as websocket: tests/test_websockets.py:128: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:101: in __enter__ fut, cs = portal.start_task(self._run) /usr/lib/python3.13/site-packages/anyio/from_thread.py:405: in start_task return f, task_status_future.result() /usr/lib64/python3.13/concurrent/futures/_base.py:456: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = async def _run(self, *, task_status: anyio.abc.TaskStatus[anyio.CancelScope]) -> None: """ The sub-thread in which the websocket session runs. """ > send_tx, send_rx = anyio.create_memory_object_stream[Message](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:120: TypeError ________________ test_websocket_send_and_receive_bytes[asyncio] ________________ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) def test_websocket_send_and_receive_bytes( test_client_factory: TestClientFactory, ) -> None: async def app(scope: Scope, receive: Receive, send: Send) -> None: websocket = WebSocket(scope, receive=receive, send=send) await websocket.accept() data = await websocket.receive_bytes() await websocket.send_bytes(b"Message was: " + data) await websocket.close() client = test_client_factory(app) > with client.websocket_connect("/") as websocket: tests/test_websockets.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:101: in __enter__ fut, cs = portal.start_task(self._run) /usr/lib/python3.13/site-packages/anyio/from_thread.py:405: in start_task return f, task_status_future.result() /usr/lib64/python3.13/concurrent/futures/_base.py:456: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = async def _run(self, *, task_status: anyio.abc.TaskStatus[anyio.CancelScope]) -> None: """ The sub-thread in which the websocket session runs. """ > send_tx, send_rx = anyio.create_memory_object_stream[Message](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:120: TypeError _________________ test_websocket_send_and_receive_bytes[trio] __________________ test_client_factory = functools.partial(, backend='trio', backend_options={}) def test_websocket_send_and_receive_bytes( test_client_factory: TestClientFactory, ) -> None: async def app(scope: Scope, receive: Receive, send: Send) -> None: websocket = WebSocket(scope, receive=receive, send=send) await websocket.accept() data = await websocket.receive_bytes() await websocket.send_bytes(b"Message was: " + data) await websocket.close() client = test_client_factory(app) > with client.websocket_connect("/") as websocket: tests/test_websockets.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:101: in __enter__ fut, cs = portal.start_task(self._run) /usr/lib/python3.13/site-packages/anyio/from_thread.py:405: in start_task return f, task_status_future.result() /usr/lib64/python3.13/concurrent/futures/_base.py:449: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = async def _run(self, *, task_status: anyio.abc.TaskStatus[anyio.CancelScope]) -> None: """ The sub-thread in which the websocket session runs. """ > send_tx, send_rx = anyio.create_memory_object_stream[Message](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:120: TypeError ________________ test_websocket_send_and_receive_json[asyncio] _________________ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) def test_websocket_send_and_receive_json( test_client_factory: TestClientFactory, ) -> None: async def app(scope: Scope, receive: Receive, send: Send) -> None: websocket = WebSocket(scope, receive=receive, send=send) await websocket.accept() data = await websocket.receive_json() await websocket.send_json({"message": data}) await websocket.close() client = test_client_factory(app) > with client.websocket_connect("/") as websocket: tests/test_websockets.py:162: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:101: in __enter__ fut, cs = portal.start_task(self._run) /usr/lib/python3.13/site-packages/anyio/from_thread.py:405: in start_task return f, task_status_future.result() /usr/lib64/python3.13/concurrent/futures/_base.py:456: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = async def _run(self, *, task_status: anyio.abc.TaskStatus[anyio.CancelScope]) -> None: """ The sub-thread in which the websocket session runs. """ > send_tx, send_rx = anyio.create_memory_object_stream[Message](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:120: TypeError __________________ test_websocket_send_and_receive_json[trio] __________________ test_client_factory = functools.partial(, backend='trio', backend_options={}) def test_websocket_send_and_receive_json( test_client_factory: TestClientFactory, ) -> None: async def app(scope: Scope, receive: Receive, send: Send) -> None: websocket = WebSocket(scope, receive=receive, send=send) await websocket.accept() data = await websocket.receive_json() await websocket.send_json({"message": data}) await websocket.close() client = test_client_factory(app) > with client.websocket_connect("/") as websocket: tests/test_websockets.py:162: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:101: in __enter__ fut, cs = portal.start_task(self._run) /usr/lib/python3.13/site-packages/anyio/from_thread.py:405: in start_task return f, task_status_future.result() /usr/lib64/python3.13/concurrent/futures/_base.py:449: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = async def _run(self, *, task_status: anyio.abc.TaskStatus[anyio.CancelScope]) -> None: """ The sub-thread in which the websocket session runs. """ > send_tx, send_rx = anyio.create_memory_object_stream[Message](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:120: TypeError ______________________ test_websocket_iter_text[asyncio] _______________________ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) def test_websocket_iter_text(test_client_factory: TestClientFactory) -> None: async def app(scope: Scope, receive: Receive, send: Send) -> None: websocket = WebSocket(scope, receive=receive, send=send) await websocket.accept() async for data in websocket.iter_text(): await websocket.send_text("Message was: " + data) client = test_client_factory(app) > with client.websocket_connect("/") as websocket: tests/test_websockets.py:176: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:101: in __enter__ fut, cs = portal.start_task(self._run) /usr/lib/python3.13/site-packages/anyio/from_thread.py:405: in start_task return f, task_status_future.result() /usr/lib64/python3.13/concurrent/futures/_base.py:456: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = async def _run(self, *, task_status: anyio.abc.TaskStatus[anyio.CancelScope]) -> None: """ The sub-thread in which the websocket session runs. """ > send_tx, send_rx = anyio.create_memory_object_stream[Message](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:120: TypeError ________________________ test_websocket_iter_text[trio] ________________________ test_client_factory = functools.partial(, backend='trio', backend_options={}) def test_websocket_iter_text(test_client_factory: TestClientFactory) -> None: async def app(scope: Scope, receive: Receive, send: Send) -> None: websocket = WebSocket(scope, receive=receive, send=send) await websocket.accept() async for data in websocket.iter_text(): await websocket.send_text("Message was: " + data) client = test_client_factory(app) > with client.websocket_connect("/") as websocket: tests/test_websockets.py:176: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:101: in __enter__ fut, cs = portal.start_task(self._run) /usr/lib/python3.13/site-packages/anyio/from_thread.py:405: in start_task return f, task_status_future.result() /usr/lib64/python3.13/concurrent/futures/_base.py:456: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = async def _run(self, *, task_status: anyio.abc.TaskStatus[anyio.CancelScope]) -> None: """ The sub-thread in which the websocket session runs. """ > send_tx, send_rx = anyio.create_memory_object_stream[Message](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:120: TypeError ______________________ test_websocket_iter_bytes[asyncio] ______________________ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) def test_websocket_iter_bytes(test_client_factory: TestClientFactory) -> None: async def app(scope: Scope, receive: Receive, send: Send) -> None: websocket = WebSocket(scope, receive=receive, send=send) await websocket.accept() async for data in websocket.iter_bytes(): await websocket.send_bytes(b"Message was: " + data) client = test_client_factory(app) > with client.websocket_connect("/") as websocket: tests/test_websockets.py:190: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:101: in __enter__ fut, cs = portal.start_task(self._run) /usr/lib/python3.13/site-packages/anyio/from_thread.py:405: in start_task return f, task_status_future.result() /usr/lib64/python3.13/concurrent/futures/_base.py:456: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = async def _run(self, *, task_status: anyio.abc.TaskStatus[anyio.CancelScope]) -> None: """ The sub-thread in which the websocket session runs. """ > send_tx, send_rx = anyio.create_memory_object_stream[Message](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:120: TypeError _______________________ test_websocket_iter_bytes[trio] ________________________ test_client_factory = functools.partial(, backend='trio', backend_options={}) def test_websocket_iter_bytes(test_client_factory: TestClientFactory) -> None: async def app(scope: Scope, receive: Receive, send: Send) -> None: websocket = WebSocket(scope, receive=receive, send=send) await websocket.accept() async for data in websocket.iter_bytes(): await websocket.send_bytes(b"Message was: " + data) client = test_client_factory(app) > with client.websocket_connect("/") as websocket: tests/test_websockets.py:190: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:101: in __enter__ fut, cs = portal.start_task(self._run) /usr/lib/python3.13/site-packages/anyio/from_thread.py:405: in start_task return f, task_status_future.result() /usr/lib64/python3.13/concurrent/futures/_base.py:449: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = async def _run(self, *, task_status: anyio.abc.TaskStatus[anyio.CancelScope]) -> None: """ The sub-thread in which the websocket session runs. """ > send_tx, send_rx = anyio.create_memory_object_stream[Message](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:120: TypeError ______________________ test_websocket_iter_json[asyncio] _______________________ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) def test_websocket_iter_json(test_client_factory: TestClientFactory) -> None: async def app(scope: Scope, receive: Receive, send: Send) -> None: websocket = WebSocket(scope, receive=receive, send=send) await websocket.accept() async for data in websocket.iter_json(): await websocket.send_json({"message": data}) client = test_client_factory(app) > with client.websocket_connect("/") as websocket: tests/test_websockets.py:204: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:101: in __enter__ fut, cs = portal.start_task(self._run) /usr/lib/python3.13/site-packages/anyio/from_thread.py:405: in start_task return f, task_status_future.result() /usr/lib64/python3.13/concurrent/futures/_base.py:456: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = async def _run(self, *, task_status: anyio.abc.TaskStatus[anyio.CancelScope]) -> None: """ The sub-thread in which the websocket session runs. """ > send_tx, send_rx = anyio.create_memory_object_stream[Message](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:120: TypeError ________________________ test_websocket_iter_json[trio] ________________________ test_client_factory = functools.partial(, backend='trio', backend_options={}) def test_websocket_iter_json(test_client_factory: TestClientFactory) -> None: async def app(scope: Scope, receive: Receive, send: Send) -> None: websocket = WebSocket(scope, receive=receive, send=send) await websocket.accept() async for data in websocket.iter_json(): await websocket.send_json({"message": data}) client = test_client_factory(app) > with client.websocket_connect("/") as websocket: tests/test_websockets.py:204: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:101: in __enter__ fut, cs = portal.start_task(self._run) /usr/lib/python3.13/site-packages/anyio/from_thread.py:405: in start_task return f, task_status_future.result() /usr/lib64/python3.13/concurrent/futures/_base.py:449: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = async def _run(self, *, task_status: anyio.abc.TaskStatus[anyio.CancelScope]) -> None: """ The sub-thread in which the websocket session runs. """ > send_tx, send_rx = anyio.create_memory_object_stream[Message](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:120: TypeError _________________ test_websocket_concurrency_pattern[asyncio] __________________ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) def test_websocket_concurrency_pattern(test_client_factory: TestClientFactory) -> None: stream_send: ObjectSendStream[MutableMapping[str, Any]] stream_receive: ObjectReceiveStream[MutableMapping[str, Any]] stream_send, stream_receive = anyio.create_memory_object_stream() async def reader(websocket: WebSocket) -> None: async with stream_send: async for data in websocket.iter_json(): await stream_send.send(data) async def writer(websocket: WebSocket) -> None: async with stream_receive: async for message in stream_receive: await websocket.send_json(message) async def app(scope: Scope, receive: Receive, send: Send) -> None: websocket = WebSocket(scope, receive=receive, send=send) await websocket.accept() async with anyio.create_task_group() as task_group: task_group.start_soon(reader, websocket) await writer(websocket) await websocket.close() client = test_client_factory(app) > with client.websocket_connect("/") as websocket: tests/test_websockets.py:234: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:101: in __enter__ fut, cs = portal.start_task(self._run) /usr/lib/python3.13/site-packages/anyio/from_thread.py:405: in start_task return f, task_status_future.result() /usr/lib64/python3.13/concurrent/futures/_base.py:449: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = async def _run(self, *, task_status: anyio.abc.TaskStatus[anyio.CancelScope]) -> None: """ The sub-thread in which the websocket session runs. """ > send_tx, send_rx = anyio.create_memory_object_stream[Message](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:120: TypeError ___________________ test_websocket_concurrency_pattern[trio] ___________________ test_client_factory = functools.partial(, backend='trio', backend_options={}) def test_websocket_concurrency_pattern(test_client_factory: TestClientFactory) -> None: stream_send: ObjectSendStream[MutableMapping[str, Any]] stream_receive: ObjectReceiveStream[MutableMapping[str, Any]] stream_send, stream_receive = anyio.create_memory_object_stream() async def reader(websocket: WebSocket) -> None: async with stream_send: async for data in websocket.iter_json(): await stream_send.send(data) async def writer(websocket: WebSocket) -> None: async with stream_receive: async for message in stream_receive: await websocket.send_json(message) async def app(scope: Scope, receive: Receive, send: Send) -> None: websocket = WebSocket(scope, receive=receive, send=send) await websocket.accept() async with anyio.create_task_group() as task_group: task_group.start_soon(reader, websocket) await writer(websocket) await websocket.close() client = test_client_factory(app) > with client.websocket_connect("/") as websocket: tests/test_websockets.py:234: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:101: in __enter__ fut, cs = portal.start_task(self._run) /usr/lib/python3.13/site-packages/anyio/from_thread.py:405: in start_task return f, task_status_future.result() /usr/lib64/python3.13/concurrent/futures/_base.py:456: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = async def _run(self, *, task_status: anyio.abc.TaskStatus[anyio.CancelScope]) -> None: """ The sub-thread in which the websocket session runs. """ > send_tx, send_rx = anyio.create_memory_object_stream[Message](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:120: TypeError __________________________ test_client_close[asyncio] __________________________ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) def test_client_close(test_client_factory: TestClientFactory) -> None: close_code = None close_reason = None async def app(scope: Scope, receive: Receive, send: Send) -> None: nonlocal close_code, close_reason websocket = WebSocket(scope, receive=receive, send=send) await websocket.accept() try: await websocket.receive_text() except WebSocketDisconnect as exc: close_code = exc.code close_reason = exc.reason client = test_client_factory(app) > with client.websocket_connect("/") as websocket: tests/test_websockets.py:255: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:101: in __enter__ fut, cs = portal.start_task(self._run) /usr/lib/python3.13/site-packages/anyio/from_thread.py:405: in start_task return f, task_status_future.result() /usr/lib64/python3.13/concurrent/futures/_base.py:456: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = async def _run(self, *, task_status: anyio.abc.TaskStatus[anyio.CancelScope]) -> None: """ The sub-thread in which the websocket session runs. """ > send_tx, send_rx = anyio.create_memory_object_stream[Message](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:120: TypeError ___________________________ test_client_close[trio] ____________________________ test_client_factory = functools.partial(, backend='trio', backend_options={}) def test_client_close(test_client_factory: TestClientFactory) -> None: close_code = None close_reason = None async def app(scope: Scope, receive: Receive, send: Send) -> None: nonlocal close_code, close_reason websocket = WebSocket(scope, receive=receive, send=send) await websocket.accept() try: await websocket.receive_text() except WebSocketDisconnect as exc: close_code = exc.code close_reason = exc.reason client = test_client_factory(app) > with client.websocket_connect("/") as websocket: tests/test_websockets.py:255: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:101: in __enter__ fut, cs = portal.start_task(self._run) /usr/lib/python3.13/site-packages/anyio/from_thread.py:405: in start_task return f, task_status_future.result() /usr/lib64/python3.13/concurrent/futures/_base.py:449: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = async def _run(self, *, task_status: anyio.abc.TaskStatus[anyio.CancelScope]) -> None: """ The sub-thread in which the websocket session runs. """ > send_tx, send_rx = anyio.create_memory_object_stream[Message](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:120: TypeError _______________________ test_application_close[asyncio] ________________________ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) def test_application_close(test_client_factory: TestClientFactory) -> None: async def app(scope: Scope, receive: Receive, send: Send) -> None: websocket = WebSocket(scope, receive=receive, send=send) await websocket.accept() await websocket.close(status.WS_1001_GOING_AWAY) client = test_client_factory(app) > with client.websocket_connect("/") as websocket: tests/test_websockets.py:289: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:101: in __enter__ fut, cs = portal.start_task(self._run) /usr/lib/python3.13/site-packages/anyio/from_thread.py:405: in start_task return f, task_status_future.result() /usr/lib64/python3.13/concurrent/futures/_base.py:456: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = async def _run(self, *, task_status: anyio.abc.TaskStatus[anyio.CancelScope]) -> None: """ The sub-thread in which the websocket session runs. """ > send_tx, send_rx = anyio.create_memory_object_stream[Message](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:120: TypeError _________________________ test_application_close[trio] _________________________ test_client_factory = functools.partial(, backend='trio', backend_options={}) def test_application_close(test_client_factory: TestClientFactory) -> None: async def app(scope: Scope, receive: Receive, send: Send) -> None: websocket = WebSocket(scope, receive=receive, send=send) await websocket.accept() await websocket.close(status.WS_1001_GOING_AWAY) client = test_client_factory(app) > with client.websocket_connect("/") as websocket: tests/test_websockets.py:289: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:101: in __enter__ fut, cs = portal.start_task(self._run) /usr/lib/python3.13/site-packages/anyio/from_thread.py:405: in start_task return f, task_status_future.result() /usr/lib64/python3.13/concurrent/futures/_base.py:449: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = async def _run(self, *, task_status: anyio.abc.TaskStatus[anyio.CancelScope]) -> None: """ The sub-thread in which the websocket session runs. """ > send_tx, send_rx = anyio.create_memory_object_stream[Message](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:120: TypeError ______________________ test_rejected_connection[asyncio] _______________________ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) def test_rejected_connection(test_client_factory: TestClientFactory) -> None: async def app(scope: Scope, receive: Receive, send: Send) -> None: websocket = WebSocket(scope, receive=receive, send=send) msg = await websocket.receive() assert msg == {"type": "websocket.connect"} await websocket.close(status.WS_1001_GOING_AWAY) client = test_client_factory(app) with pytest.raises(WebSocketDisconnect) as exc: > with client.websocket_connect("/"): tests/test_websockets.py:304: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:101: in __enter__ fut, cs = portal.start_task(self._run) /usr/lib/python3.13/site-packages/anyio/from_thread.py:405: in start_task return f, task_status_future.result() /usr/lib64/python3.13/concurrent/futures/_base.py:449: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = async def _run(self, *, task_status: anyio.abc.TaskStatus[anyio.CancelScope]) -> None: """ The sub-thread in which the websocket session runs. """ > send_tx, send_rx = anyio.create_memory_object_stream[Message](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:120: TypeError ________________________ test_rejected_connection[trio] ________________________ test_client_factory = functools.partial(, backend='trio', backend_options={}) def test_rejected_connection(test_client_factory: TestClientFactory) -> None: async def app(scope: Scope, receive: Receive, send: Send) -> None: websocket = WebSocket(scope, receive=receive, send=send) msg = await websocket.receive() assert msg == {"type": "websocket.connect"} await websocket.close(status.WS_1001_GOING_AWAY) client = test_client_factory(app) with pytest.raises(WebSocketDisconnect) as exc: > with client.websocket_connect("/"): tests/test_websockets.py:304: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:101: in __enter__ fut, cs = portal.start_task(self._run) /usr/lib/python3.13/site-packages/anyio/from_thread.py:405: in start_task return f, task_status_future.result() /usr/lib64/python3.13/concurrent/futures/_base.py:449: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = async def _run(self, *, task_status: anyio.abc.TaskStatus[anyio.CancelScope]) -> None: """ The sub-thread in which the websocket session runs. """ > send_tx, send_rx = anyio.create_memory_object_stream[Message](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:120: TypeError ______________________ test_send_denial_response[asyncio] ______________________ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) def test_send_denial_response(test_client_factory: TestClientFactory) -> None: async def app(scope: Scope, receive: Receive, send: Send) -> None: websocket = WebSocket(scope, receive=receive, send=send) msg = await websocket.receive() assert msg == {"type": "websocket.connect"} response = Response(status_code=404, content="foo") await websocket.send_denial_response(response) client = test_client_factory(app) with pytest.raises(WebSocketDenialResponse) as exc: > with client.websocket_connect("/"): tests/test_websockets.py:319: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:101: in __enter__ fut, cs = portal.start_task(self._run) /usr/lib/python3.13/site-packages/anyio/from_thread.py:405: in start_task return f, task_status_future.result() /usr/lib64/python3.13/concurrent/futures/_base.py:456: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = async def _run(self, *, task_status: anyio.abc.TaskStatus[anyio.CancelScope]) -> None: """ The sub-thread in which the websocket session runs. """ > send_tx, send_rx = anyio.create_memory_object_stream[Message](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:120: TypeError _______________________ test_send_denial_response[trio] ________________________ test_client_factory = functools.partial(, backend='trio', backend_options={}) def test_send_denial_response(test_client_factory: TestClientFactory) -> None: async def app(scope: Scope, receive: Receive, send: Send) -> None: websocket = WebSocket(scope, receive=receive, send=send) msg = await websocket.receive() assert msg == {"type": "websocket.connect"} response = Response(status_code=404, content="foo") await websocket.send_denial_response(response) client = test_client_factory(app) with pytest.raises(WebSocketDenialResponse) as exc: > with client.websocket_connect("/"): tests/test_websockets.py:319: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:101: in __enter__ fut, cs = portal.start_task(self._run) /usr/lib/python3.13/site-packages/anyio/from_thread.py:405: in start_task return f, task_status_future.result() /usr/lib64/python3.13/concurrent/futures/_base.py:449: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = async def _run(self, *, task_status: anyio.abc.TaskStatus[anyio.CancelScope]) -> None: """ The sub-thread in which the websocket session runs. """ > send_tx, send_rx = anyio.create_memory_object_stream[Message](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:120: TypeError ______________________ test_send_response_multi[asyncio] _______________________ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) def test_send_response_multi(test_client_factory: TestClientFactory) -> None: async def app(scope: Scope, receive: Receive, send: Send) -> None: websocket = WebSocket(scope, receive=receive, send=send) msg = await websocket.receive() assert msg == {"type": "websocket.connect"} await websocket.send( { "type": "websocket.http.response.start", "status": 404, "headers": [(b"content-type", b"text/plain"), (b"foo", b"bar")], } ) await websocket.send({"type": "websocket.http.response.body", "body": b"hard", "more_body": True}) await websocket.send({"type": "websocket.http.response.body", "body": b"body"}) client = test_client_factory(app) with pytest.raises(WebSocketDenialResponse) as exc: > with client.websocket_connect("/"): tests/test_websockets.py:342: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:101: in __enter__ fut, cs = portal.start_task(self._run) /usr/lib/python3.13/site-packages/anyio/from_thread.py:405: in start_task return f, task_status_future.result() /usr/lib64/python3.13/concurrent/futures/_base.py:456: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = async def _run(self, *, task_status: anyio.abc.TaskStatus[anyio.CancelScope]) -> None: """ The sub-thread in which the websocket session runs. """ > send_tx, send_rx = anyio.create_memory_object_stream[Message](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:120: TypeError ________________________ test_send_response_multi[trio] ________________________ test_client_factory = functools.partial(, backend='trio', backend_options={}) def test_send_response_multi(test_client_factory: TestClientFactory) -> None: async def app(scope: Scope, receive: Receive, send: Send) -> None: websocket = WebSocket(scope, receive=receive, send=send) msg = await websocket.receive() assert msg == {"type": "websocket.connect"} await websocket.send( { "type": "websocket.http.response.start", "status": 404, "headers": [(b"content-type", b"text/plain"), (b"foo", b"bar")], } ) await websocket.send({"type": "websocket.http.response.body", "body": b"hard", "more_body": True}) await websocket.send({"type": "websocket.http.response.body", "body": b"body"}) client = test_client_factory(app) with pytest.raises(WebSocketDenialResponse) as exc: > with client.websocket_connect("/"): tests/test_websockets.py:342: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:101: in __enter__ fut, cs = portal.start_task(self._run) /usr/lib/python3.13/site-packages/anyio/from_thread.py:405: in start_task return f, task_status_future.result() /usr/lib64/python3.13/concurrent/futures/_base.py:449: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = async def _run(self, *, task_status: anyio.abc.TaskStatus[anyio.CancelScope]) -> None: """ The sub-thread in which the websocket session runs. """ > send_tx, send_rx = anyio.create_memory_object_stream[Message](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:120: TypeError ___________________ test_send_response_unsupported[asyncio] ____________________ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) def test_send_response_unsupported(test_client_factory: TestClientFactory) -> None: async def app(scope: Scope, receive: Receive, send: Send) -> None: del scope["extensions"]["websocket.http.response"] websocket = WebSocket(scope, receive=receive, send=send) msg = await websocket.receive() assert msg == {"type": "websocket.connect"} response = Response(status_code=404, content="foo") with pytest.raises( RuntimeError, match="The server doesn't support the Websocket Denial Response extension.", ): await websocket.send_denial_response(response) await websocket.close() client = test_client_factory(app) with pytest.raises(WebSocketDisconnect) as exc: > with client.websocket_connect("/"): tests/test_websockets.py:365: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:101: in __enter__ fut, cs = portal.start_task(self._run) /usr/lib/python3.13/site-packages/anyio/from_thread.py:405: in start_task return f, task_status_future.result() /usr/lib64/python3.13/concurrent/futures/_base.py:456: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = async def _run(self, *, task_status: anyio.abc.TaskStatus[anyio.CancelScope]) -> None: """ The sub-thread in which the websocket session runs. """ > send_tx, send_rx = anyio.create_memory_object_stream[Message](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:120: TypeError _____________________ test_send_response_unsupported[trio] _____________________ test_client_factory = functools.partial(, backend='trio', backend_options={}) def test_send_response_unsupported(test_client_factory: TestClientFactory) -> None: async def app(scope: Scope, receive: Receive, send: Send) -> None: del scope["extensions"]["websocket.http.response"] websocket = WebSocket(scope, receive=receive, send=send) msg = await websocket.receive() assert msg == {"type": "websocket.connect"} response = Response(status_code=404, content="foo") with pytest.raises( RuntimeError, match="The server doesn't support the Websocket Denial Response extension.", ): await websocket.send_denial_response(response) await websocket.close() client = test_client_factory(app) with pytest.raises(WebSocketDisconnect) as exc: > with client.websocket_connect("/"): tests/test_websockets.py:365: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:101: in __enter__ fut, cs = portal.start_task(self._run) /usr/lib/python3.13/site-packages/anyio/from_thread.py:405: in start_task return f, task_status_future.result() /usr/lib64/python3.13/concurrent/futures/_base.py:449: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = async def _run(self, *, task_status: anyio.abc.TaskStatus[anyio.CancelScope]) -> None: """ The sub-thread in which the websocket session runs. """ > send_tx, send_rx = anyio.create_memory_object_stream[Message](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:120: TypeError _________________ test_send_response_duplicate_start[asyncio] __________________ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) def test_send_response_duplicate_start(test_client_factory: TestClientFactory) -> None: async def app(scope: Scope, receive: Receive, send: Send) -> None: websocket = WebSocket(scope, receive=receive, send=send) msg = await websocket.receive() assert msg == {"type": "websocket.connect"} response = Response(status_code=404, content="foo") await websocket.send( { "type": "websocket.http.response.start", "status": response.status_code, "headers": response.raw_headers, } ) await websocket.send( { "type": "websocket.http.response.start", "status": response.status_code, "headers": response.raw_headers, } ) client = test_client_factory(app) with pytest.raises( RuntimeError, match=("Expected ASGI message \"websocket.http.response.body\", but got 'websocket.http.response.start'"), ): > with client.websocket_connect("/"): tests/test_websockets.py:396: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:101: in __enter__ fut, cs = portal.start_task(self._run) /usr/lib/python3.13/site-packages/anyio/from_thread.py:405: in start_task return f, task_status_future.result() /usr/lib64/python3.13/concurrent/futures/_base.py:456: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = async def _run(self, *, task_status: anyio.abc.TaskStatus[anyio.CancelScope]) -> None: """ The sub-thread in which the websocket session runs. """ > send_tx, send_rx = anyio.create_memory_object_stream[Message](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:120: TypeError ___________________ test_send_response_duplicate_start[trio] ___________________ test_client_factory = functools.partial(, backend='trio', backend_options={}) def test_send_response_duplicate_start(test_client_factory: TestClientFactory) -> None: async def app(scope: Scope, receive: Receive, send: Send) -> None: websocket = WebSocket(scope, receive=receive, send=send) msg = await websocket.receive() assert msg == {"type": "websocket.connect"} response = Response(status_code=404, content="foo") await websocket.send( { "type": "websocket.http.response.start", "status": response.status_code, "headers": response.raw_headers, } ) await websocket.send( { "type": "websocket.http.response.start", "status": response.status_code, "headers": response.raw_headers, } ) client = test_client_factory(app) with pytest.raises( RuntimeError, match=("Expected ASGI message \"websocket.http.response.body\", but got 'websocket.http.response.start'"), ): > with client.websocket_connect("/"): tests/test_websockets.py:396: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:101: in __enter__ fut, cs = portal.start_task(self._run) /usr/lib/python3.13/site-packages/anyio/from_thread.py:405: in start_task return f, task_status_future.result() /usr/lib64/python3.13/concurrent/futures/_base.py:449: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = async def _run(self, *, task_status: anyio.abc.TaskStatus[anyio.CancelScope]) -> None: """ The sub-thread in which the websocket session runs. """ > send_tx, send_rx = anyio.create_memory_object_stream[Message](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:120: TypeError __________________________ test_subprotocol[asyncio] ___________________________ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) def test_subprotocol(test_client_factory: TestClientFactory) -> None: async def app(scope: Scope, receive: Receive, send: Send) -> None: websocket = WebSocket(scope, receive=receive, send=send) assert websocket["subprotocols"] == ["soap", "wamp"] await websocket.accept(subprotocol="wamp") await websocket.close() client = test_client_factory(app) > with client.websocket_connect("/", subprotocols=["soap", "wamp"]) as websocket: tests/test_websockets.py:408: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:101: in __enter__ fut, cs = portal.start_task(self._run) /usr/lib/python3.13/site-packages/anyio/from_thread.py:405: in start_task return f, task_status_future.result() /usr/lib64/python3.13/concurrent/futures/_base.py:456: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = async def _run(self, *, task_status: anyio.abc.TaskStatus[anyio.CancelScope]) -> None: """ The sub-thread in which the websocket session runs. """ > send_tx, send_rx = anyio.create_memory_object_stream[Message](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:120: TypeError ____________________________ test_subprotocol[trio] ____________________________ test_client_factory = functools.partial(, backend='trio', backend_options={}) def test_subprotocol(test_client_factory: TestClientFactory) -> None: async def app(scope: Scope, receive: Receive, send: Send) -> None: websocket = WebSocket(scope, receive=receive, send=send) assert websocket["subprotocols"] == ["soap", "wamp"] await websocket.accept(subprotocol="wamp") await websocket.close() client = test_client_factory(app) > with client.websocket_connect("/", subprotocols=["soap", "wamp"]) as websocket: tests/test_websockets.py:408: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:101: in __enter__ fut, cs = portal.start_task(self._run) /usr/lib/python3.13/site-packages/anyio/from_thread.py:405: in start_task return f, task_status_future.result() /usr/lib64/python3.13/concurrent/futures/_base.py:449: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = async def _run(self, *, task_status: anyio.abc.TaskStatus[anyio.CancelScope]) -> None: """ The sub-thread in which the websocket session runs. """ > send_tx, send_rx = anyio.create_memory_object_stream[Message](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:120: TypeError _______________________ test_additional_headers[asyncio] _______________________ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) def test_additional_headers(test_client_factory: TestClientFactory) -> None: async def app(scope: Scope, receive: Receive, send: Send) -> None: websocket = WebSocket(scope, receive=receive, send=send) await websocket.accept(headers=[(b"additional", b"header")]) await websocket.close() client = test_client_factory(app) > with client.websocket_connect("/") as websocket: tests/test_websockets.py:419: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:101: in __enter__ fut, cs = portal.start_task(self._run) /usr/lib/python3.13/site-packages/anyio/from_thread.py:405: in start_task return f, task_status_future.result() /usr/lib64/python3.13/concurrent/futures/_base.py:456: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = async def _run(self, *, task_status: anyio.abc.TaskStatus[anyio.CancelScope]) -> None: """ The sub-thread in which the websocket session runs. """ > send_tx, send_rx = anyio.create_memory_object_stream[Message](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:120: TypeError ________________________ test_additional_headers[trio] _________________________ test_client_factory = functools.partial(, backend='trio', backend_options={}) def test_additional_headers(test_client_factory: TestClientFactory) -> None: async def app(scope: Scope, receive: Receive, send: Send) -> None: websocket = WebSocket(scope, receive=receive, send=send) await websocket.accept(headers=[(b"additional", b"header")]) await websocket.close() client = test_client_factory(app) > with client.websocket_connect("/") as websocket: tests/test_websockets.py:419: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:101: in __enter__ fut, cs = portal.start_task(self._run) /usr/lib/python3.13/site-packages/anyio/from_thread.py:405: in start_task return f, task_status_future.result() /usr/lib64/python3.13/concurrent/futures/_base.py:456: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = async def _run(self, *, task_status: anyio.abc.TaskStatus[anyio.CancelScope]) -> None: """ The sub-thread in which the websocket session runs. """ > send_tx, send_rx = anyio.create_memory_object_stream[Message](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:120: TypeError _____________________ test_no_additional_headers[asyncio] ______________________ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) def test_no_additional_headers(test_client_factory: TestClientFactory) -> None: async def app(scope: Scope, receive: Receive, send: Send) -> None: websocket = WebSocket(scope, receive=receive, send=send) await websocket.accept() await websocket.close() client = test_client_factory(app) > with client.websocket_connect("/") as websocket: tests/test_websockets.py:430: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:101: in __enter__ fut, cs = portal.start_task(self._run) /usr/lib/python3.13/site-packages/anyio/from_thread.py:405: in start_task return f, task_status_future.result() /usr/lib64/python3.13/concurrent/futures/_base.py:456: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = async def _run(self, *, task_status: anyio.abc.TaskStatus[anyio.CancelScope]) -> None: """ The sub-thread in which the websocket session runs. """ > send_tx, send_rx = anyio.create_memory_object_stream[Message](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:120: TypeError _______________________ test_no_additional_headers[trio] _______________________ test_client_factory = functools.partial(, backend='trio', backend_options={}) def test_no_additional_headers(test_client_factory: TestClientFactory) -> None: async def app(scope: Scope, receive: Receive, send: Send) -> None: websocket = WebSocket(scope, receive=receive, send=send) await websocket.accept() await websocket.close() client = test_client_factory(app) > with client.websocket_connect("/") as websocket: tests/test_websockets.py:430: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:101: in __enter__ fut, cs = portal.start_task(self._run) /usr/lib/python3.13/site-packages/anyio/from_thread.py:405: in start_task return f, task_status_future.result() /usr/lib64/python3.13/concurrent/futures/_base.py:449: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = async def _run(self, *, task_status: anyio.abc.TaskStatus[anyio.CancelScope]) -> None: """ The sub-thread in which the websocket session runs. """ > send_tx, send_rx = anyio.create_memory_object_stream[Message](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:120: TypeError ______________________ test_websocket_exception[asyncio] _______________________ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) def test_websocket_exception(test_client_factory: TestClientFactory) -> None: async def app(scope: Scope, receive: Receive, send: Send) -> None: assert False client = test_client_factory(app) with pytest.raises(AssertionError): > with client.websocket_connect("/123?a=abc"): tests/test_websockets.py:440: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:101: in __enter__ fut, cs = portal.start_task(self._run) /usr/lib/python3.13/site-packages/anyio/from_thread.py:405: in start_task return f, task_status_future.result() /usr/lib64/python3.13/concurrent/futures/_base.py:456: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = async def _run(self, *, task_status: anyio.abc.TaskStatus[anyio.CancelScope]) -> None: """ The sub-thread in which the websocket session runs. """ > send_tx, send_rx = anyio.create_memory_object_stream[Message](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:120: TypeError ________________________ test_websocket_exception[trio] ________________________ test_client_factory = functools.partial(, backend='trio', backend_options={}) def test_websocket_exception(test_client_factory: TestClientFactory) -> None: async def app(scope: Scope, receive: Receive, send: Send) -> None: assert False client = test_client_factory(app) with pytest.raises(AssertionError): > with client.websocket_connect("/123?a=abc"): tests/test_websockets.py:440: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:101: in __enter__ fut, cs = portal.start_task(self._run) /usr/lib/python3.13/site-packages/anyio/from_thread.py:405: in start_task return f, task_status_future.result() /usr/lib64/python3.13/concurrent/futures/_base.py:449: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = async def _run(self, *, task_status: anyio.abc.TaskStatus[anyio.CancelScope]) -> None: """ The sub-thread in which the websocket session runs. """ > send_tx, send_rx = anyio.create_memory_object_stream[Message](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:120: TypeError ________________________ test_duplicate_close[asyncio] _________________________ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) def test_duplicate_close(test_client_factory: TestClientFactory) -> None: async def app(scope: Scope, receive: Receive, send: Send) -> None: websocket = WebSocket(scope, receive=receive, send=send) await websocket.accept() await websocket.close() await websocket.close() client = test_client_factory(app) with pytest.raises(RuntimeError): > with client.websocket_connect("/"): tests/test_websockets.py:453: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:101: in __enter__ fut, cs = portal.start_task(self._run) /usr/lib/python3.13/site-packages/anyio/from_thread.py:405: in start_task return f, task_status_future.result() /usr/lib64/python3.13/concurrent/futures/_base.py:456: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = async def _run(self, *, task_status: anyio.abc.TaskStatus[anyio.CancelScope]) -> None: """ The sub-thread in which the websocket session runs. """ > send_tx, send_rx = anyio.create_memory_object_stream[Message](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:120: TypeError __________________________ test_duplicate_close[trio] __________________________ test_client_factory = functools.partial(, backend='trio', backend_options={}) def test_duplicate_close(test_client_factory: TestClientFactory) -> None: async def app(scope: Scope, receive: Receive, send: Send) -> None: websocket = WebSocket(scope, receive=receive, send=send) await websocket.accept() await websocket.close() await websocket.close() client = test_client_factory(app) with pytest.raises(RuntimeError): > with client.websocket_connect("/"): tests/test_websockets.py:453: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:101: in __enter__ fut, cs = portal.start_task(self._run) /usr/lib/python3.13/site-packages/anyio/from_thread.py:405: in start_task return f, task_status_future.result() /usr/lib64/python3.13/concurrent/futures/_base.py:449: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = async def _run(self, *, task_status: anyio.abc.TaskStatus[anyio.CancelScope]) -> None: """ The sub-thread in which the websocket session runs. """ > send_tx, send_rx = anyio.create_memory_object_stream[Message](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:120: TypeError ______________________ test_duplicate_disconnect[asyncio] ______________________ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) def test_duplicate_disconnect(test_client_factory: TestClientFactory) -> None: async def app(scope: Scope, receive: Receive, send: Send) -> None: websocket = WebSocket(scope, receive=receive, send=send) await websocket.accept() message = await websocket.receive() assert message["type"] == "websocket.disconnect" message = await websocket.receive() client = test_client_factory(app) with pytest.raises(RuntimeError): > with client.websocket_connect("/") as websocket: tests/test_websockets.py:467: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:101: in __enter__ fut, cs = portal.start_task(self._run) /usr/lib/python3.13/site-packages/anyio/from_thread.py:405: in start_task return f, task_status_future.result() /usr/lib64/python3.13/concurrent/futures/_base.py:456: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = async def _run(self, *, task_status: anyio.abc.TaskStatus[anyio.CancelScope]) -> None: """ The sub-thread in which the websocket session runs. """ > send_tx, send_rx = anyio.create_memory_object_stream[Message](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:120: TypeError _______________________ test_duplicate_disconnect[trio] ________________________ test_client_factory = functools.partial(, backend='trio', backend_options={}) def test_duplicate_disconnect(test_client_factory: TestClientFactory) -> None: async def app(scope: Scope, receive: Receive, send: Send) -> None: websocket = WebSocket(scope, receive=receive, send=send) await websocket.accept() message = await websocket.receive() assert message["type"] == "websocket.disconnect" message = await websocket.receive() client = test_client_factory(app) with pytest.raises(RuntimeError): > with client.websocket_connect("/") as websocket: tests/test_websockets.py:467: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:101: in __enter__ fut, cs = portal.start_task(self._run) /usr/lib/python3.13/site-packages/anyio/from_thread.py:405: in start_task return f, task_status_future.result() /usr/lib64/python3.13/concurrent/futures/_base.py:449: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = async def _run(self, *, task_status: anyio.abc.TaskStatus[anyio.CancelScope]) -> None: """ The sub-thread in which the websocket session runs. """ > send_tx, send_rx = anyio.create_memory_object_stream[Message](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:120: TypeError _____________________ test_websocket_close_reason[asyncio] _____________________ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) def test_websocket_close_reason(test_client_factory: TestClientFactory) -> None: async def app(scope: Scope, receive: Receive, send: Send) -> None: websocket = WebSocket(scope, receive=receive, send=send) await websocket.accept() await websocket.close(code=status.WS_1001_GOING_AWAY, reason="Going Away") client = test_client_factory(app) > with client.websocket_connect("/") as websocket: tests/test_websockets.py:505: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:101: in __enter__ fut, cs = portal.start_task(self._run) /usr/lib/python3.13/site-packages/anyio/from_thread.py:405: in start_task return f, task_status_future.result() /usr/lib64/python3.13/concurrent/futures/_base.py:456: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = async def _run(self, *, task_status: anyio.abc.TaskStatus[anyio.CancelScope]) -> None: """ The sub-thread in which the websocket session runs. """ > send_tx, send_rx = anyio.create_memory_object_stream[Message](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:120: TypeError ______________________ test_websocket_close_reason[trio] _______________________ test_client_factory = functools.partial(, backend='trio', backend_options={}) def test_websocket_close_reason(test_client_factory: TestClientFactory) -> None: async def app(scope: Scope, receive: Receive, send: Send) -> None: websocket = WebSocket(scope, receive=receive, send=send) await websocket.accept() await websocket.close(code=status.WS_1001_GOING_AWAY, reason="Going Away") client = test_client_factory(app) > with client.websocket_connect("/") as websocket: tests/test_websockets.py:505: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:101: in __enter__ fut, cs = portal.start_task(self._run) /usr/lib/python3.13/site-packages/anyio/from_thread.py:405: in start_task return f, task_status_future.result() /usr/lib64/python3.13/concurrent/futures/_base.py:449: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = async def _run(self, *, task_status: anyio.abc.TaskStatus[anyio.CancelScope]) -> None: """ The sub-thread in which the websocket session runs. """ > send_tx, send_rx = anyio.create_memory_object_stream[Message](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:120: TypeError _____________________ test_send_json_invalid_mode[asyncio] _____________________ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) def test_send_json_invalid_mode(test_client_factory: TestClientFactory) -> None: async def app(scope: Scope, receive: Receive, send: Send) -> None: websocket = WebSocket(scope, receive=receive, send=send) await websocket.accept() await websocket.send_json({}, mode="invalid") client = test_client_factory(app) with pytest.raises(RuntimeError): > with client.websocket_connect("/"): tests/test_websockets.py:520: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:101: in __enter__ fut, cs = portal.start_task(self._run) /usr/lib/python3.13/site-packages/anyio/from_thread.py:405: in start_task return f, task_status_future.result() /usr/lib64/python3.13/concurrent/futures/_base.py:456: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = async def _run(self, *, task_status: anyio.abc.TaskStatus[anyio.CancelScope]) -> None: """ The sub-thread in which the websocket session runs. """ > send_tx, send_rx = anyio.create_memory_object_stream[Message](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:120: TypeError ______________________ test_send_json_invalid_mode[trio] _______________________ test_client_factory = functools.partial(, backend='trio', backend_options={}) def test_send_json_invalid_mode(test_client_factory: TestClientFactory) -> None: async def app(scope: Scope, receive: Receive, send: Send) -> None: websocket = WebSocket(scope, receive=receive, send=send) await websocket.accept() await websocket.send_json({}, mode="invalid") client = test_client_factory(app) with pytest.raises(RuntimeError): > with client.websocket_connect("/"): tests/test_websockets.py:520: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:101: in __enter__ fut, cs = portal.start_task(self._run) /usr/lib/python3.13/site-packages/anyio/from_thread.py:405: in start_task return f, task_status_future.result() /usr/lib64/python3.13/concurrent/futures/_base.py:456: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = async def _run(self, *, task_status: anyio.abc.TaskStatus[anyio.CancelScope]) -> None: """ The sub-thread in which the websocket session runs. """ > send_tx, send_rx = anyio.create_memory_object_stream[Message](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:120: TypeError ___________________ test_receive_json_invalid_mode[asyncio] ____________________ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) def test_receive_json_invalid_mode(test_client_factory: TestClientFactory) -> None: async def app(scope: Scope, receive: Receive, send: Send) -> None: websocket = WebSocket(scope, receive=receive, send=send) await websocket.accept() await websocket.receive_json(mode="invalid") client = test_client_factory(app) with pytest.raises(RuntimeError): > with client.websocket_connect("/"): tests/test_websockets.py:532: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:101: in __enter__ fut, cs = portal.start_task(self._run) /usr/lib/python3.13/site-packages/anyio/from_thread.py:405: in start_task return f, task_status_future.result() /usr/lib64/python3.13/concurrent/futures/_base.py:456: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = async def _run(self, *, task_status: anyio.abc.TaskStatus[anyio.CancelScope]) -> None: """ The sub-thread in which the websocket session runs. """ > send_tx, send_rx = anyio.create_memory_object_stream[Message](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:120: TypeError _____________________ test_receive_json_invalid_mode[trio] _____________________ test_client_factory = functools.partial(, backend='trio', backend_options={}) def test_receive_json_invalid_mode(test_client_factory: TestClientFactory) -> None: async def app(scope: Scope, receive: Receive, send: Send) -> None: websocket = WebSocket(scope, receive=receive, send=send) await websocket.accept() await websocket.receive_json(mode="invalid") client = test_client_factory(app) with pytest.raises(RuntimeError): > with client.websocket_connect("/"): tests/test_websockets.py:532: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:101: in __enter__ fut, cs = portal.start_task(self._run) /usr/lib/python3.13/site-packages/anyio/from_thread.py:405: in start_task return f, task_status_future.result() /usr/lib64/python3.13/concurrent/futures/_base.py:449: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = async def _run(self, *, task_status: anyio.abc.TaskStatus[anyio.CancelScope]) -> None: """ The sub-thread in which the websocket session runs. """ > send_tx, send_rx = anyio.create_memory_object_stream[Message](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:120: TypeError ___________________ test_receive_text_before_accept[asyncio] ___________________ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) def test_receive_text_before_accept(test_client_factory: TestClientFactory) -> None: async def app(scope: Scope, receive: Receive, send: Send) -> None: websocket = WebSocket(scope, receive=receive, send=send) await websocket.receive_text() client = test_client_factory(app) with pytest.raises(RuntimeError): > with client.websocket_connect("/"): tests/test_websockets.py:543: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:101: in __enter__ fut, cs = portal.start_task(self._run) /usr/lib/python3.13/site-packages/anyio/from_thread.py:405: in start_task return f, task_status_future.result() /usr/lib64/python3.13/concurrent/futures/_base.py:456: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = async def _run(self, *, task_status: anyio.abc.TaskStatus[anyio.CancelScope]) -> None: """ The sub-thread in which the websocket session runs. """ > send_tx, send_rx = anyio.create_memory_object_stream[Message](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:120: TypeError ____________________ test_receive_text_before_accept[trio] _____________________ test_client_factory = functools.partial(, backend='trio', backend_options={}) def test_receive_text_before_accept(test_client_factory: TestClientFactory) -> None: async def app(scope: Scope, receive: Receive, send: Send) -> None: websocket = WebSocket(scope, receive=receive, send=send) await websocket.receive_text() client = test_client_factory(app) with pytest.raises(RuntimeError): > with client.websocket_connect("/"): tests/test_websockets.py:543: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:101: in __enter__ fut, cs = portal.start_task(self._run) /usr/lib/python3.13/site-packages/anyio/from_thread.py:405: in start_task return f, task_status_future.result() /usr/lib64/python3.13/concurrent/futures/_base.py:449: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = async def _run(self, *, task_status: anyio.abc.TaskStatus[anyio.CancelScope]) -> None: """ The sub-thread in which the websocket session runs. """ > send_tx, send_rx = anyio.create_memory_object_stream[Message](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:120: TypeError __________________ test_receive_bytes_before_accept[asyncio] ___________________ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) def test_receive_bytes_before_accept(test_client_factory: TestClientFactory) -> None: async def app(scope: Scope, receive: Receive, send: Send) -> None: websocket = WebSocket(scope, receive=receive, send=send) await websocket.receive_bytes() client = test_client_factory(app) with pytest.raises(RuntimeError): > with client.websocket_connect("/"): tests/test_websockets.py:554: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:101: in __enter__ fut, cs = portal.start_task(self._run) /usr/lib/python3.13/site-packages/anyio/from_thread.py:405: in start_task return f, task_status_future.result() /usr/lib64/python3.13/concurrent/futures/_base.py:456: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = async def _run(self, *, task_status: anyio.abc.TaskStatus[anyio.CancelScope]) -> None: """ The sub-thread in which the websocket session runs. """ > send_tx, send_rx = anyio.create_memory_object_stream[Message](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:120: TypeError ____________________ test_receive_bytes_before_accept[trio] ____________________ test_client_factory = functools.partial(, backend='trio', backend_options={}) def test_receive_bytes_before_accept(test_client_factory: TestClientFactory) -> None: async def app(scope: Scope, receive: Receive, send: Send) -> None: websocket = WebSocket(scope, receive=receive, send=send) await websocket.receive_bytes() client = test_client_factory(app) with pytest.raises(RuntimeError): > with client.websocket_connect("/"): tests/test_websockets.py:554: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:101: in __enter__ fut, cs = portal.start_task(self._run) /usr/lib/python3.13/site-packages/anyio/from_thread.py:405: in start_task return f, task_status_future.result() /usr/lib64/python3.13/concurrent/futures/_base.py:449: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = async def _run(self, *, task_status: anyio.abc.TaskStatus[anyio.CancelScope]) -> None: """ The sub-thread in which the websocket session runs. """ > send_tx, send_rx = anyio.create_memory_object_stream[Message](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:120: TypeError ___________________ test_receive_json_before_accept[asyncio] ___________________ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) def test_receive_json_before_accept(test_client_factory: TestClientFactory) -> None: async def app(scope: Scope, receive: Receive, send: Send) -> None: websocket = WebSocket(scope, receive=receive, send=send) await websocket.receive_json() client = test_client_factory(app) with pytest.raises(RuntimeError): > with client.websocket_connect("/"): tests/test_websockets.py:565: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:101: in __enter__ fut, cs = portal.start_task(self._run) /usr/lib/python3.13/site-packages/anyio/from_thread.py:405: in start_task return f, task_status_future.result() /usr/lib64/python3.13/concurrent/futures/_base.py:456: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = async def _run(self, *, task_status: anyio.abc.TaskStatus[anyio.CancelScope]) -> None: """ The sub-thread in which the websocket session runs. """ > send_tx, send_rx = anyio.create_memory_object_stream[Message](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:120: TypeError ____________________ test_receive_json_before_accept[trio] _____________________ test_client_factory = functools.partial(, backend='trio', backend_options={}) def test_receive_json_before_accept(test_client_factory: TestClientFactory) -> None: async def app(scope: Scope, receive: Receive, send: Send) -> None: websocket = WebSocket(scope, receive=receive, send=send) await websocket.receive_json() client = test_client_factory(app) with pytest.raises(RuntimeError): > with client.websocket_connect("/"): tests/test_websockets.py:565: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:101: in __enter__ fut, cs = portal.start_task(self._run) /usr/lib/python3.13/site-packages/anyio/from_thread.py:405: in start_task return f, task_status_future.result() /usr/lib64/python3.13/concurrent/futures/_base.py:456: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = async def _run(self, *, task_status: anyio.abc.TaskStatus[anyio.CancelScope]) -> None: """ The sub-thread in which the websocket session runs. """ > send_tx, send_rx = anyio.create_memory_object_stream[Message](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:120: TypeError _______________________ test_send_before_accept[asyncio] _______________________ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) def test_send_before_accept(test_client_factory: TestClientFactory) -> None: async def app(scope: Scope, receive: Receive, send: Send) -> None: websocket = WebSocket(scope, receive=receive, send=send) await websocket.send({"type": "websocket.send"}) client = test_client_factory(app) with pytest.raises(RuntimeError): > with client.websocket_connect("/"): tests/test_websockets.py:576: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:101: in __enter__ fut, cs = portal.start_task(self._run) /usr/lib/python3.13/site-packages/anyio/from_thread.py:405: in start_task return f, task_status_future.result() /usr/lib64/python3.13/concurrent/futures/_base.py:456: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = async def _run(self, *, task_status: anyio.abc.TaskStatus[anyio.CancelScope]) -> None: """ The sub-thread in which the websocket session runs. """ > send_tx, send_rx = anyio.create_memory_object_stream[Message](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:120: TypeError ________________________ test_send_before_accept[trio] _________________________ test_client_factory = functools.partial(, backend='trio', backend_options={}) def test_send_before_accept(test_client_factory: TestClientFactory) -> None: async def app(scope: Scope, receive: Receive, send: Send) -> None: websocket = WebSocket(scope, receive=receive, send=send) await websocket.send({"type": "websocket.send"}) client = test_client_factory(app) with pytest.raises(RuntimeError): > with client.websocket_connect("/"): tests/test_websockets.py:576: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:101: in __enter__ fut, cs = portal.start_task(self._run) /usr/lib/python3.13/site-packages/anyio/from_thread.py:405: in start_task return f, task_status_future.result() /usr/lib64/python3.13/concurrent/futures/_base.py:449: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = async def _run(self, *, task_status: anyio.abc.TaskStatus[anyio.CancelScope]) -> None: """ The sub-thread in which the websocket session runs. """ > send_tx, send_rx = anyio.create_memory_object_stream[Message](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:120: TypeError ____________________ test_send_wrong_message_type[asyncio] _____________________ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) def test_send_wrong_message_type(test_client_factory: TestClientFactory) -> None: async def app(scope: Scope, receive: Receive, send: Send) -> None: websocket = WebSocket(scope, receive=receive, send=send) await websocket.send({"type": "websocket.accept"}) await websocket.send({"type": "websocket.accept"}) client = test_client_factory(app) with pytest.raises(RuntimeError): > with client.websocket_connect("/"): tests/test_websockets.py:588: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:101: in __enter__ fut, cs = portal.start_task(self._run) /usr/lib/python3.13/site-packages/anyio/from_thread.py:405: in start_task return f, task_status_future.result() /usr/lib64/python3.13/concurrent/futures/_base.py:456: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = async def _run(self, *, task_status: anyio.abc.TaskStatus[anyio.CancelScope]) -> None: """ The sub-thread in which the websocket session runs. """ > send_tx, send_rx = anyio.create_memory_object_stream[Message](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:120: TypeError ______________________ test_send_wrong_message_type[trio] ______________________ test_client_factory = functools.partial(, backend='trio', backend_options={}) def test_send_wrong_message_type(test_client_factory: TestClientFactory) -> None: async def app(scope: Scope, receive: Receive, send: Send) -> None: websocket = WebSocket(scope, receive=receive, send=send) await websocket.send({"type": "websocket.accept"}) await websocket.send({"type": "websocket.accept"}) client = test_client_factory(app) with pytest.raises(RuntimeError): > with client.websocket_connect("/"): tests/test_websockets.py:588: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:101: in __enter__ fut, cs = portal.start_task(self._run) /usr/lib/python3.13/site-packages/anyio/from_thread.py:405: in start_task return f, task_status_future.result() /usr/lib64/python3.13/concurrent/futures/_base.py:449: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = async def _run(self, *, task_status: anyio.abc.TaskStatus[anyio.CancelScope]) -> None: """ The sub-thread in which the websocket session runs. """ > send_tx, send_rx = anyio.create_memory_object_stream[Message](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:120: TypeError _____________________ test_receive_before_accept[asyncio] ______________________ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) def test_receive_before_accept(test_client_factory: TestClientFactory) -> None: async def app(scope: Scope, receive: Receive, send: Send) -> None: websocket = WebSocket(scope, receive=receive, send=send) await websocket.accept() websocket.client_state = WebSocketState.CONNECTING await websocket.receive() client = test_client_factory(app) with pytest.raises(RuntimeError): > with client.websocket_connect("/") as websocket: tests/test_websockets.py:601: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:101: in __enter__ fut, cs = portal.start_task(self._run) /usr/lib/python3.13/site-packages/anyio/from_thread.py:405: in start_task return f, task_status_future.result() /usr/lib64/python3.13/concurrent/futures/_base.py:456: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = async def _run(self, *, task_status: anyio.abc.TaskStatus[anyio.CancelScope]) -> None: """ The sub-thread in which the websocket session runs. """ > send_tx, send_rx = anyio.create_memory_object_stream[Message](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:120: TypeError _______________________ test_receive_before_accept[trio] _______________________ test_client_factory = functools.partial(, backend='trio', backend_options={}) def test_receive_before_accept(test_client_factory: TestClientFactory) -> None: async def app(scope: Scope, receive: Receive, send: Send) -> None: websocket = WebSocket(scope, receive=receive, send=send) await websocket.accept() websocket.client_state = WebSocketState.CONNECTING await websocket.receive() client = test_client_factory(app) with pytest.raises(RuntimeError): > with client.websocket_connect("/") as websocket: tests/test_websockets.py:601: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:101: in __enter__ fut, cs = portal.start_task(self._run) /usr/lib/python3.13/site-packages/anyio/from_thread.py:405: in start_task return f, task_status_future.result() /usr/lib64/python3.13/concurrent/futures/_base.py:449: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = async def _run(self, *, task_status: anyio.abc.TaskStatus[anyio.CancelScope]) -> None: """ The sub-thread in which the websocket session runs. """ > send_tx, send_rx = anyio.create_memory_object_stream[Message](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:120: TypeError ___________________ test_receive_wrong_message_type[asyncio] ___________________ test_client_factory = functools.partial(, backend='asyncio', backend_options={}) def test_receive_wrong_message_type(test_client_factory: TestClientFactory) -> None: async def app(scope: Scope, receive: Receive, send: Send) -> None: websocket = WebSocket(scope, receive=receive, send=send) await websocket.accept() await websocket.receive() client = test_client_factory(app) with pytest.raises(RuntimeError): > with client.websocket_connect("/") as websocket: tests/test_websockets.py:613: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:101: in __enter__ fut, cs = portal.start_task(self._run) /usr/lib/python3.13/site-packages/anyio/from_thread.py:405: in start_task return f, task_status_future.result() /usr/lib64/python3.13/concurrent/futures/_base.py:456: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = async def _run(self, *, task_status: anyio.abc.TaskStatus[anyio.CancelScope]) -> None: """ The sub-thread in which the websocket session runs. """ > send_tx, send_rx = anyio.create_memory_object_stream[Message](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:120: TypeError ____________________ test_receive_wrong_message_type[trio] _____________________ test_client_factory = functools.partial(, backend='trio', backend_options={}) def test_receive_wrong_message_type(test_client_factory: TestClientFactory) -> None: async def app(scope: Scope, receive: Receive, send: Send) -> None: websocket = WebSocket(scope, receive=receive, send=send) await websocket.accept() await websocket.receive() client = test_client_factory(app) with pytest.raises(RuntimeError): > with client.websocket_connect("/") as websocket: tests/test_websockets.py:613: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ starlette/testclient.py:101: in __enter__ fut, cs = portal.start_task(self._run) /usr/lib/python3.13/site-packages/anyio/from_thread.py:405: in start_task return f, task_status_future.result() /usr/lib64/python3.13/concurrent/futures/_base.py:456: in result return self.__get_result() /usr/lib64/python3.13/concurrent/futures/_base.py:401: in __get_result raise self._exception /usr/lib/python3.13/site-packages/anyio/from_thread.py:217: in _call_func retval = await retval _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = async def _run(self, *, task_status: anyio.abc.TaskStatus[anyio.CancelScope]) -> None: """ The sub-thread in which the websocket session runs. """ > send_tx, send_rx = anyio.create_memory_object_stream[Message](math.inf) E TypeError: 'function' object is not subscriptable starlette/testclient.py:120: TypeError ========== 203 failed, 631 passed, 2 deselected, 52 errors in 16.22s =========== RPM build errors: error: Bad exit status from /var/tmp/rpm-tmp.1dE1Dg (%check) Bad exit status from /var/tmp/rpm-tmp.1dE1Dg (%check) Finish: rpmbuild python-starlette-0.45.1-1.fc42.src.rpm Finish: build phase for python-starlette-0.45.1-1.fc42.src.rpm INFO: chroot_scan: 1 files copied to /var/lib/copr-rpmbuild/results/chroot_scan INFO: /var/lib/mock/fedora-41-x86_64-1735650614.938785/root/var/log/dnf5.log INFO: chroot_scan: creating tarball /var/lib/copr-rpmbuild/results/chroot_scan.tar.gz /bin/tar: Removing leading `/' from member names ERROR: Exception(/var/lib/copr-rpmbuild/results/python-starlette-0.45.1-1.fc42.src.rpm) Config(fedora-41-x86_64) 0 minutes 32 seconds INFO: Results and/or logs in: /var/lib/copr-rpmbuild/results INFO: Cleaning up build root ('cleanup_on_failure=True') Start: clean chroot INFO: unmounting tmpfs. Finish: clean chroot ERROR: Command failed: # /usr/bin/systemd-nspawn -q -M 8a0ed11c5bcb41fc863e67a1ab25317d -D /var/lib/mock/fedora-41-x86_64-1735650614.938785/root -a -u mockbuild --capability=cap_ipc_lock --rlimit=RLIMIT_NOFILE=10240 --capability=cap_ipc_lock --bind=/tmp/mock-resolv.id47vhci:/etc/resolv.conf --bind=/dev/btrfs-control --bind=/dev/mapper/control --bind=/dev/fuse --bind=/dev/loop-control --bind=/dev/loop0 --bind=/dev/loop1 --bind=/dev/loop2 --bind=/dev/loop3 --bind=/dev/loop4 --bind=/dev/loop5 --bind=/dev/loop6 --bind=/dev/loop7 --bind=/dev/loop8 --bind=/dev/loop9 --bind=/dev/loop10 --bind=/dev/loop11 --console=pipe --setenv=TERM=vt100 --setenv=SHELL=/bin/bash --setenv=HOME=/builddir --setenv=HOSTNAME=mock --setenv=PATH=/usr/bin:/bin:/usr/sbin:/sbin '--setenv=PROMPT_COMMAND=printf "\033]0;\007"' '--setenv=PS1= \s-\v\$ ' --setenv=LANG=C.UTF-8 --resolv-conf=off bash --login -c '/usr/bin/rpmbuild -ba --noprep --target x86_64 --nodeps /builddir/build/originals/python-starlette.spec' Copr build error: Build failed