Python: Bypass Coverage For @overload Methods
In Python, we can use @overload decorator from typing to mark overloading methods. If project has unit test enabled, you may find that it’s impossible to cover those methods with @overload decorator in coverage reports. In this case we have to bypass coverage checking for those overloading methods.
In setup.cfg:
1 | [coverage:report] |
Or in pyproject.toml:
1 | [tool.coverage.report] |