Skip to content

Exercise HTTP 300 responses in redirect caching tests - #478

Closed
ryanduguid wants to merge 1 commit into
psf:masterfrom
ryanduguid:test-http300-cache-coverage
Closed

ryanduguid wants to merge 1 commit into
psf:masterfrom
ryanduguid:test-http300-cache-coverage

Conversation

@ryanduguid

Copy link
Copy Markdown

Summary

The multiple-choice redirect tests request an undefined route and receive the fixture's default HTTP 200 response. Use the existing HTTP 300 handler with explicit freshness, assert the response status and cached body, and verify the cache is populated before testing no-cache.

- multiple_choices_redirect
+ multiple_choices

Fixes #184.

Evidence

  • Adding HTTP 300 assertions to the original tests produces two failures: both responses are HTTP 200. Removing 300 from the supported cache statuses still passes both original tests; both repaired tests fail.
  • All 115 tests pass on Linux Python 3.10.22, 3.11.17, 3.12.15, 3.13.16 and 3.14.8, and Windows Python 3.14.8. The Python 3.14 coverage runs report 85%.
  • Four isolated controls detect removed 300 support, missing freshness, the wrong route and ignored no-cache requests.
  • Ruff, mypy, formatting, Sphinx and the wheel/source distribution build pass. The source distribution contains the checked test bytes.

Merge danger

Door: two-way. Blast radius: tests.

The change is confined to the HTTP 300 fixture and its existing tests.

Unverified

macOS, Windows Python 3.10 through 3.13 and upstream CI were not run. Codespell reports the same two existing unparseable occurrences in tests/test_cache_control.py on the baseline and candidate. Linux Python 3.13/3.14 emit Cheroot socket shutdown warnings; the same warning also appears in the Python 3.14 baseline.

@woodruffw woodruffw closed this Oct 7, 2026
@psf psf locked as spam and limited conversation to collaborators Oct 7, 2026
@ryanduguid
ryanduguid deleted the test-http300-cache-coverage branch October 9, 2026 10:01
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

multiple_choices vs multiple_choices_redirect

2 participants