lark-parser / lark

Lark is a parsing toolkit for Python, built with a focus on ergonomics, performance and modularity.
MIT License
4.75k stars 401 forks source link

Add exclude in coverage for `if TYPE_CHECKING:` branches #1278

Closed MegaIng closed 1 year ago

MegaIng commented 1 year ago

A small addition to the cleanup PR that should increase coverage by ignoring code that is never supposed to be executed. See https://github.com/nedbat/coveragepy/issues/831

I decided to add the code to pyproject.toml instead of adding another config file. The required tomli lib should be installed by default by pytest

erezsh commented 1 year ago

Good idea!