tests/integration/test_engine_runtime.py::EngineRuntimeTests::test_pyshark_engine_currently_breaks_on_modern_asyncio
fails on a clean main on Python 3.14.
> with self.assertRaises(AttributeError):
E AssertionError: AttributeError not raised
Why
The test was written when asking for engine='pyshark' on 3.14 raised out of
pyshark itself — it builds its event loop with
asyncio.get_event_loop_policy().get_event_loop(), and 3.14 refuses to create
an implicit loop. Asserting the AttributeError was an accurate description of
the behaviour at the time.
PyShark.unsupported_reason() (added in #405) now answers that question before
anything is imported, so Extractor declines the engine, warns, and falls back
to pcapkit's own parser. The exception the test waits for can no longer
happen. Visible in the captured log of the failing run:
WARNING pcapkit.utilities.warnings: engine PyShark is not supported on this
interpreter (pyshark does not support Python 3.14; it builds its event loop with
`asyncio.get_event_loop_policy().get_event_loop()`, which raises RuntimeError
from Python 3.14 when no current event loop exists); using default engine instead
So the failure is the test being stale, not a regression in the library — the new
behaviour is the intended one and is strictly better.
Why it went unnoticed
The test lives in tests/integration/, which the CI selection (make test)
excludes because it needs sample captures that are not tracked in the
repository. Nothing on a push runs it.
Fix
Assert what the preflight now does: an EngineWarning naming the engine and the
interpreter, and a successful extraction through the fallback. The pre-3.14
branch of the test is unaffected and still asserts a real pyshark run.
tests/integration/test_engine_runtime.py::EngineRuntimeTests::test_pyshark_engine_currently_breaks_on_modern_asynciofails on a clean
mainon Python 3.14.Why
The test was written when asking for
engine='pyshark'on 3.14 raised out ofpysharkitself — it builds its event loop withasyncio.get_event_loop_policy().get_event_loop(), and 3.14 refuses to createan implicit loop. Asserting the
AttributeErrorwas an accurate description ofthe behaviour at the time.
PyShark.unsupported_reason()(added in #405) now answers that question beforeanything is imported, so
Extractordeclines the engine, warns, and falls backto
pcapkit's own parser. The exception the test waits for can no longerhappen. Visible in the captured log of the failing run:
So the failure is the test being stale, not a regression in the library — the new
behaviour is the intended one and is strictly better.
Why it went unnoticed
The test lives in
tests/integration/, which the CI selection (make test)excludes because it needs sample captures that are not tracked in the
repository. Nothing on a push runs it.
Fix
Assert what the preflight now does: an
EngineWarningnaming the engine and theinterpreter, and a successful extraction through the fallback. The pre-3.14
branch of the test is unaffected and still asserts a real
pysharkrun.