# Testing signals — encode/starlette

> Canonical page: https://codevetter.com/unpack/starlette/testing-signals

# Testing signals — encode/starlette

Scanned commit 4e7fc04e5f2c69f60e418ff2107d0f6d9a0fe423 (2026-10-01). Generated by codevetter codevetter 1.15.0 on 2026-10-02.

Source inspection; upstream code and tests were not executed.

Tests and CI were inspected, not executed; no passing result or measured coverage is established here. The inspected suite uses pytest, AnyIO backends, in-process TestClient calls, and direct ASGI message tests. Assertions cover lifecycle, body-limit branches, upload cleanup, file containment, ranges, sessions, and background execution. Coverage excludes selected branches, and this bounded inspection does not establish exhaustive scenario or deployment coverage.
- The pytest harness builds TestClient with AnyIO backend fixtures and optionally activates BlockBuster for Starlette blocking-call detection; lifespan tests assert startup inside the client context and teardown after exit. — [tests/conftest.py#L8-L48](https://github.com/encode/starlette/blob/4e7fc04e5f2c69f60e418ff2107d0f6d9a0fe423/tests/conftest.py#L8-L48) [tests/test_applications.py#L390-L409](https://github.com/encode/starlette/blob/4e7fc04e5f2c69f60e418ff2107d0f6d9a0fe423/tests/test_applications.py#L390-L409)
- Test Suite CI defines Ubuntu jobs for Python 3.11–3.15, installs dependencies, builds package/docs, runs scripts/test and scripts/coverage, and skips scripts/check specifically on Python 3.14; these definitions were inspected, not run. — [.github/workflows/main.yml#L14-L47](https://github.com/encode/starlette/blob/4e7fc04e5f2c69f60e418ff2107d0f6d9a0fe423/.github/workflows/main.yml#L14-L47)
- Coverage measures branches in both starlette and tests and scripts/coverage requires 100%; overloads, NotImplementedError, and explicit pragma exclusions limit what that gate measures, so README's coverage statement is not a verified result. — [pyproject.toml#L126-L134](https://github.com/encode/starlette/blob/4e7fc04e5f2c69f60e418ff2107d0f6d9a0fe423/pyproject.toml#L126-L134) [scripts/coverage#L1-L5](https://github.com/encode/starlette/blob/4e7fc04e5f2c69f60e418ff2107d0f6d9a0fe423/scripts/coverage#L1-L5) [starlette/applications.py#L98-L124](https://github.com/encode/starlette/blob/4e7fc04e5f2c69f60e418ff2107d0f6d9a0fe423/starlette/applications.py#L98-L124) [README.md#L35-L46](https://github.com/encode/starlette/blob/4e7fc04e5f2c69f60e418ff2107d0f6d9a0fe423/README.md#L35-L46)
- Upload tests assert spool rollover occurs outside the application thread and temporary files close after stream failure or simulated disk-full OSError; these are executable assertions, not observed successes. — [tests/test_formparsers.py#L349-L365](https://github.com/encode/starlette/blob/4e7fc04e5f2c69f60e418ff2107d0f6d9a0fe423/tests/test_formparsers.py#L349-L365) [tests/test_formparsers.py#L1018-L1040](https://github.com/encode/starlette/blob/4e7fc04e5f2c69f60e418ff2107d0f6d9a0fe423/tests/test_formparsers.py#L1018-L1040) [tests/test_formparsers.py#L1043-L1077](https://github.com/encode/starlette/blob/4e7fc04e5f2c69f60e418ff2107d0f6d9a0fe423/tests/test_formparsers.py#L1043-L1077)
- Body-limit tests exercise rejection before receive, accumulated bytes without reliable Content-Length, failure after response start, enforcement before user middleware, and route limits that raise or lower the application limit. — [tests/middleware/test_body_limit.py#L76-L141](https://github.com/encode/starlette/blob/4e7fc04e5f2c69f60e418ff2107d0f6d9a0fe423/tests/middleware/test_body_limit.py#L76-L141) [tests/middleware/test_body_limit.py#L145-L170](https://github.com/encode/starlette/blob/4e7fc04e5f2c69f60e418ff2107d0f6d9a0fe423/tests/middleware/test_body_limit.py#L145-L170) [tests/middleware/test_body_limit.py#L244-L292](https://github.com/encode/starlette/blob/4e7fc04e5f2c69f60e418ff2107d0f6d9a0fe423/tests/middleware/test_body_limit.py#L244-L292)
- Static-file tests call ASGI helpers directly for traversal because the client normalizes paths; response tests assert 100-range acceptance, over-limit fallback to full 200, malformed-range 400, and unsatisfiable-range 416. — [tests/test_staticfiles.py#L606-L656](https://github.com/encode/starlette/blob/4e7fc04e5f2c69f60e418ff2107d0f6d9a0fe423/tests/test_staticfiles.py#L606-L656) [tests/test_responses.py#L964-L1025](https://github.com/encode/starlette/blob/4e7fc04e5f2c69f60e418ff2107d0f6d9a0fe423/tests/test_responses.py#L964-L1025)
- Session tests distinguish modification-driven Set-Cookie from read-only access and verify Vary: Cookie; background tests assert sequential callbacks and that a failing first task prevents the next task from executing. — [tests/middleware/test_session.py#L248-L329](https://github.com/encode/starlette/blob/4e7fc04e5f2c69f60e418ff2107d0f6d9a0fe423/tests/middleware/test_session.py#L248-L329) [tests/test_background.py#L47-L89](https://github.com/encode/starlette/blob/4e7fc04e5f2c69f60e418ff2107d0f6d9a0fe423/tests/test_background.py#L47-L89)
- CodSpeed CI selects ten benchmark modules in simulation,memory mode on Python 3.14 with fixed allocator/hash settings; routing fixtures compare 20/120-route tables using fresh scopes and status assertions. Neither benchmarks nor CI were executed, and in-process transport evidence does not establish live-server behavior. — [.github/workflows/benchmark.yml#L14-L55](https://github.com/encode/starlette/blob/4e7fc04e5f2c69f60e418ff2107d0f6d9a0fe423/.github/workflows/benchmark.yml#L14-L55) [benchmarks/routing_benchmark.py#L16-L71](https://github.com/encode/starlette/blob/4e7fc04e5f2c69f60e418ff2107d0f6d9a0fe423/benchmarks/routing_benchmark.py#L16-L71) [starlette/testclient.py#L348-L376](https://github.com/encode/starlette/blob/4e7fc04e5f2c69f60e418ff2107d0f6d9a0fe423/starlette/testclient.py#L348-L376)

Every claim links to its cited files at the pinned commit. Citations identify source evidence; they do not establish runtime correctness. Independent CodeVetter scan — not reviewed by upstream maintainers.

## Public product links

- [CodeVetter](https://codevetter.com/)
- [Download](https://codevetter.com/download)
- [Documentation](https://codevetter.com/docs/)
- [Source](https://github.com/Codevetter/codevetter)
