Repository navigation
refactor(http): move test_start_line and its patterns into the http base module (#1519) - #1525
Merged
Merged
Conversation
…ase module (#1519) - httpv1._test_start_line becomes the public http.test_start_line, listed in http.__all__; HTTP._guess_version calls it directly instead of importing it lazily from httpv1. - _RE_METHOD, _RE_VERSION, _RE_STATUS and _HTTP2_PREFACE_HEADER move with it, and httpv1 imports them from http, so the predicate and the parser keep sharing one copy of each. - Docs: test_start_line is documented on the http page and dropped from the httpv1 page; docstrings and test docstrings that cited the old location now cite http.py. - Tests: the existing predicate tests import it from http, and a new module pins its request-line, status-line, HTTP/2-preface and non-HTTP answers, the shared patterns, and the direct call. No behaviour change: HTTP classification and to_dict() of all 1,616 frames in the 23 sample captures are byte-identical to origin/main.
Owner
Author
|
Verdict: GOOD TO GO at
|
Contributor
|
Coverage: 90.08% (unit tier, Python 3.14,
Per-file detail: the |
This was referenced Oct 9, 2026
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Please follow the guide below
You will be asked some questions, please read them carefully and answer honestly
Put an
xinto all the boxes [ ] relevant to your pull request (like that [x])Use Preview tab to see how your pull request will actually look like
Searched for similar pull requests
Followed the coding style (
make pylint,make mypy,make isort)make testpasses, and a test case covers the changeAdded a changelog entry under
docs/source/changelog/and regeneratedCHANGELOG.md, if the change is user-visible — N/A — centralised in docs(changelog): shared 1.5.0 changelog — long-lived, merges last (#610, #616, #617, #618, #620) #657What is the purpose of your pull request?
Tick the commit type your subject line carries.
fix— corrects a defectfeat— adds a featureperf— changes performance, not behaviourrefactor— changes neither behaviour nor performancetest— tests onlydocs— documentation onlyci— workflows or build toolingrelease— bumps the version or rolls up a distributionchore— anything elseDescription of your pull request and other information
httpv1._test_start_linebecomes the publichttp.test_start_line, listed inhttp.__all__.HTTP._guess_versionnow calls it directly; the lazy import fromhttpv1is gone._RE_METHOD,_RE_VERSION,_RE_STATUSand_HTTP2_PREFACE_HEADERmove with it and stay private.httpv1imports them fromhttp, the direction it already imported in, so there is still one copy of each and no new cycle.test_start_lineis documented on thehttppage and removed from thehttpv1page. Docstrings that cited the old location are updated, including three intests/const/test_const_method_value_lookup_908_unit.py. The existing changelog entries are left as they are.test_http_unit.pynow imports the predicate fromhttp. The newtest_http_test_start_line_1519_unit.py(6 tests) pins request lines, status lines, the HTTP/2 preface refused, non-HTTP refused, the shared pattern objects and the direct call. All 6 fail onorigin/mainand pass here.to_dict()JSON matchorigin/mainexactly. Both snapshots have sha2562bb6b450….Ran one at a time:
tests/protocols/application,tests/project,tests/test_docstring_contract.py,tests/test_tier_guard.py, and the editedtests/constmodule. All green. The Sphinx build reports no warnings from the HTTP pages.Refs #1519