diff --git a/.coveragerc b/.coveragerc deleted file mode 100644 index b87ef3e2c..000000000 --- a/.coveragerc +++ /dev/null @@ -1,8 +0,0 @@ -[report] -skip_covered = True -show_missing = True -fail_under = 75 -exclude_lines = - pragma: no cover - if __name__ == .__main__.: - def __repr__ diff --git a/.github/workflows/gating.yaml b/.github/workflows/gating.yaml index 3ade3e656..1ff08f2b4 100644 --- a/.github/workflows/gating.yaml +++ b/.github/workflows/gating.yaml @@ -39,7 +39,7 @@ jobs: run: | pip3 install --upgrade pip pip3 install --upgrade setuptools - pip3 install --upgrade coveralls==3.2.0 + pip3 install --upgrade coveralls coveralls --service=github coveralls-finish: diff --git a/cachi2/core/rooted_path.py b/cachi2/core/rooted_path.py index a66da36ba..b15683544 100644 --- a/cachi2/core/rooted_path.py +++ b/cachi2/core/rooted_path.py @@ -70,9 +70,8 @@ def subpath_from_root(self) -> Path: return self._path.relative_to(self._root) def __eq__(self, other: object) -> bool: - # Note: __eq__ is implemented mainly for unit tests that do assert_called_with() or similar if not isinstance(other, RootedPath): - return NotImplemented + raise NotImplementedError(f"__eq__ not implemented for {type(other).__name__}") return self.path == other.path and self.root == other.root def __fspath__(self) -> str: diff --git a/pyproject.toml b/pyproject.toml index f92437e96..7dc55b0e3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -82,3 +82,15 @@ disallow_untyped_decorators = true [[tool.mypy.overrides]] module = ["semver"] ignore_missing_imports = true + +[tool.coverage.report] +skip_covered = true +show_missing = true +fail_under = 80 +exclude_lines = [ + "def __repr__", + "if __name__ == .__main__.:", + "if TYPE_CHECKING:", + "raise AssertionError", + "raise NotImplementedError", +] diff --git a/tox.ini b/tox.ini index 887b05586..ec2607658 100644 --- a/tox.ini +++ b/tox.ini @@ -20,9 +20,12 @@ deps = -rrequirements-extras.txt commands = py.test \ - --ignore tests/integration \ - --cov-config .coveragerc --cov=cachi2 --cov-report term \ - --cov-report xml --cov-report html {posargs} + --ignore=tests/integration \ + --cov=cachi2 \ + --cov-config=pyproject.toml \ + --cov-report=term \ + --cov-report=html \ + --cov-report=xml {posargs} allowlist_externals = make mkdir