Repository navigation
fix(foundation): warn once when an extraction engine is unavailable (#1045) - #1046
Conversation
…1045) Extractor.import_test warned that the engine package was missing and returned None; run()'s else branch then warned again, so one problem raised two EngineWarnings. run() now stays silent there, and import_test's message names the module (engine PyPCAP (`pcap`) is not installed).
|
Cross-review verdict on
Confirmed: per-engine warning counts in fresh processes — Non-blocking: a subclass |
… name (#1045) import_test printed engine foo (`foo`) when called without a display name. The (`module`) suffix is now emitted only when name is given. Adds a regression test (failed before the fix: 2 != 1), a Fixed changelog entry, regenerated CHANGELOG.md, and moves the entry-count pin 162 -> 163.
|
Cross-review verdict on The code, the new test,
Non-blocking: the entry writes Confirmed by probe: named and unnamed text on all three trees; |
Drop the claim that an unnamed import_test call named the module twice (only true in this PR's first commit, never shipped), and narrow who breaks: the surviving text equals the warning run() already emitted on main.
|
Cross-review verdict on The changelog entry no longer claims an unnamed-case fix. Its "only code that matched Nit, not blocking: a direct |
make pylint,make mypy,make isort)make testpasses, and a test case covers the changeWhat is the purpose of your pull request?
fix— corrects a defectfeatperfrefactortestdocscichoreDescription
Closes #1045
A missing engine package raised two
EngineWarnings:Extractor.import_testwarned and returnedNone, thenExtractor.run()'selsebranch warned again.Site chosen:
import_testwarns,run()is silent. The engines' docstrings (pypcap.py,pcap_ct.py,pyshark.py) say the import test reports absence, andimport_testis public API documented as warning.Message:
import_testnow uses the more informative wording naming the module (engine PyPCAP (`pcap`) is not installed). Fallback to the default engine and thelogger.debuglines are unchanged.Tests (
tests/foundation/test_extraction.py): exactly one warning for an absent module and for an engine blocked byunsupported_reason, and the default engine is selected. The absent-module test fails onmain(2 warnings); the blocked test is a regression guard (already one warning onmain).