diff --git a/.coveragerc b/.coveragerc index 26c6762a7..5c0e61cb0 100644 --- a/.coveragerc +++ b/.coveragerc @@ -6,3 +6,20 @@ omit = [report] include = piptools/*, tests/* + +# Regexes for lines to exclude from consideration +exclude_lines = + # Have to re-enable the standard pragma: + pragma: no cover + + # Don't complain about missing debug-only code: + def __repr__ + + # Don't complain if tests don't hit defensive assertion code: + raise AssertionError + raise NotImplementedError + return NotImplemented + + # Don't complain if non-runnable code isn't run: + if (0|False|TYPE_CHECKING): + if __name__ == .__main__.: