From a14b6cc0e1c44e34cb59d680aa97ff299722bb42 Mon Sep 17 00:00:00 2001 From: Fangchen Li Date: Wed, 23 Nov 2022 17:49:20 -0600 Subject: [PATCH 1/2] CLN: move coverage config to pyproject.toml --- pyproject.toml | 28 ++++++++++++++++++++++++++++ setup.cfg | 35 ----------------------------------- 2 files changed, 28 insertions(+), 35 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 74779e181abc4..210849918d8a0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -306,3 +306,31 @@ reportOptionalOperand = false reportOptionalSubscript = false reportPrivateImportUsage = false reportUnboundVariable = false + +[tool.coverage.run] +branch = true +omit = ["pandas/_typing.py", "pandas/_version.py"] +plugins = ["Cython.Coverage"] +source = ["pandas"] + +[tool.coverage.report] +ignore_errors = false +show_missing = true +omit = ["pandas/_version.py"] +exclude_lines = [ + # Have to re-enable the standard pragma + "pragma: no cover", + # Don't complain about missing debug-only code:s + "def __repr__", + "if self.debug", + # Don't complain if tests don't hit defensive assertion code: + "raise AssertionError", + "raise NotImplementedError", + "AbstractMethodError", + # Don't complain if non-runnable code isn't run: + "if 0:", + "if __name__ == .__main__.:", + "if TYPE_CHECKING:", +] +[tool.coverage.html] +directory = "coverage_html_report" diff --git a/setup.cfg b/setup.cfg index 98c5a27d3e6a0..dbd7cce1874c8 100644 --- a/setup.cfg +++ b/setup.cfg @@ -287,38 +287,3 @@ exclude = [codespell] ignore-words-list = blocs,coo,hist,nd,sav,ser,recuse ignore-regex = https://([\w/\.])+ - -[coverage:run] -branch = True -omit = - pandas/_typing.py - pandas/_version.py -plugins = Cython.Coverage -source = pandas - -[coverage:report] -ignore_errors = False -show_missing = True -omit = - pandas/_version.py -# 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__ - if self\.debug - - # Don't complain if tests don't hit defensive assertion code: - raise AssertionError - raise NotImplementedError - AbstractMethodError - - # Don't complain if non-runnable code isn't run: - if 0: - if __name__ == .__main__.: - if TYPE_CHECKING: - -[coverage:html] -directory = coverage_html_report From 677c6a7d01ed43b4c8f5dfb19d4b363004151e80 Mon Sep 17 00:00:00 2001 From: Fangchen Li Date: Wed, 23 Nov 2022 17:50:02 -0600 Subject: [PATCH 2/2] space --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index 210849918d8a0..7b4c9425d557c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -332,5 +332,6 @@ exclude_lines = [ "if __name__ == .__main__.:", "if TYPE_CHECKING:", ] + [tool.coverage.html] directory = "coverage_html_report"