Skip to content

Parametric static type-testing via (buffered) code generation #140

@jorenham

Description

@jorenham

The "manual" type-tests in #139 make it clear that repeating those tests for all scalar-types and flavors will become too much of a mess.

A pytest-based parametric testing framework script could solve this, by feeding generated code to mypy/bpr, and parsing the output. The startup cost of both mypy and bpr is rather big, so it should "buffer" the generated tests into one virtual .pyi file, instead. Mapping the typing-errors back to the original assertions requires some sort of deferral mechanism. Perhaps async/await could be exploited to achieve this, e.g. as assert await assert_assignable(_nt.To1D_intp, [42]) within a async test_to_intp() or something.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions