Repository navigation
test: share the vendor crawler test helpers in tests/vendor/_crawler.py (#3148) - #3157
Merged
Merged
Conversation
…py (#3148) - New tests/vendor/_crawler.py holds normalize(), the whitespace pass Vendor.__init__ writes a constant file through; import_from_checkout(), the skip unless the modules come from this checkout; make_crawler(), a crawler with NAME, DOCS and record set but no fetch or write; and defined_crawlers() and is_crawler(), the filesystem crawler discovery. - The batch's vendor modules and test_const_enum_lookup drop their copies for them; every assertion stays. test_const_enum_lookup keeps the _normalize name, which test_const_enum_builtin_parity and the #923 provenance test import from it. - Copies whose meaning differs stay: ftp's count(None) crawler, radiotap's multi-page regeneration, the ipx no-network constructions, and each module's HAS_* dependency gate. Tests: the touched modules, tests/project, the root suites and the vendor and const unittest legs pass; coverage of pcapkit is unchanged.
Owner
Author
|
Good to go at c0cc365, from a Sonnet review.
|
Contributor
|
Coverage: 94.79% (unit tier, Python 3.15,
Per-file detail: the |
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
Put an
xinto every box [ ] that applies to your pull request (like this: [x])Use the Preview tab to see how your pull request will look
Searched for similar pull requests
Followed the coding style (
make pylint,make mypy,make isort)make testpasses, and a test case covers the changeDescribed the user-visible change below and left its changelog entry to the maintainer, keeping
docs/source/changelog/andCHANGELOG.mdout of the diff, if the change is user-visible: N/A — centralisedWhat 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 elseAlso tick if it regenerates constant or registry tables, members keeping their numeric values (the
constlabel)Description of your pull request and other information
Part of #3148 (batch E7, the vendor part of T17). The new
tests/vendor/_crawler.pyholdsnormalize,import_from_checkout,make_crawler,defined_crawlersandis_crawler. The batch's modules use them and keep every assertion (223 lines added, 540 removed)._normalizeand the crawler setup in esp 2294, ieee802_11 2575, ipx packet and socket, radiotap 2576 and 2647, ipv6 925, mh 1848, reference formats 1664rfcsteststextrather thanbare; ieeeControlrenamed; ipx dropsSPX, renamesUnspecified; radiotap rewords the reserved-bit comment, renamesBSS_COLOR; ipv6 renamesIPv6-Route, and an emptycount(therecordthatmake_crawlersets); mhWilcard;split_referenceskeeps the RFC spacesetUpin ftp, reachability and dest_path, and_defined_crawlerslen(line) < 2;vendor.__all__losesMH_HandoverInitiateStatus;_dest_pathdrops theconst/hop (191 subtests red)test_const_enum_lookuptakesnormalizeas_normalize, the name builtin_parity and #923 import from itbinding_ack_flagtemplate back toreturn cls(value)Kept local because their meaning differs: ftp's
count(None)crawler, radiotap 2576's multi-page_assert_regenerates, the ipx no-network constructions, and each module'sHAS_*gate (two or three deps, read per module bytests/_dependency_gates.py). Outside this batch: a further copy intest_vendor_llc_2936_unit.py, and an inline one intest_const_method_case_sensitive_896_unit.py.Coverage: the
coverage reportforpcapkit/vendor/*(43%) andpcapkit/const/*(75%) is byte-identical before and after. Time: no saving. The per-module sum went from 70.1 s to 69.9 s and one-n 4run from 17.9 s to 18.6 s, which is noise.Tests: the batch modules (87 passed),
tests/project(2494 passed), the root suites (266 passed), and thevendorandconstunittest legs all pass.