Skip to content

test(project): the #1878 engine-stub tests call ast.unparse, which Python 3.8 lacks #1899

Closed

Description

@JarryShaw

tests/project/test_engine_stubs_1878_unit.py::EngineProtocolTests::test_each_expkg_is_its_own_guarded_protocol and ::test_each_protocol_declares_what_its_engine_reads, added by #1882, fail on the Python 3.8 (KTLO) unit leg with AttributeError: module 'ast' has no attribute 'unparse'. Seen on main in Unit Tests run 39038572601 (d14a1b9), and on #1896.

_guarded_protocols (:93-96) compares ast.unparse(base) against 'Protocol'/'typing.Protocol', but ast.unparse only exists from Python 3.9.

KTLO legs read green even when tests fail (#1679), so this shows only in the annotations and the log.

Fix: match the base node directly, as ast.Name(id='Protocol') or ast.Attribute(value=ast.Name(id='typing'), attr='Protocol'), and check that no other tests/project file calls ast.unparse outside a version gate.

Activity

  1. added
    testPull requests that add or correct tests (test: subject prefix)
    wipWork in flight - a covering PR is open or an agent is actively on it
    on Oct 17, 2026
  2. added a commit that references this issue on Oct 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    testPull requests that add or correct tests (test: subject prefix)wipWork in flight - a covering PR is open or an agent is actively on it

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions