On Python 3.8 and older, Coverage.py may not properly respond to the exclude_lines option in pyproject.toml, even if coverage[toml] is installed per the documentation.
One potential solution to this is to individually mark the lines with # pragma: no cov comments. See this change for an example.