Skip to content

Commit

Permalink
increase cachi2 coverage
Browse files Browse the repository at this point in the history
Signed-off-by: Michal Šoltis <[email protected]>
  • Loading branch information
slimreaper35 committed Mar 6, 2024
1 parent 18099a6 commit 0c04685
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 14 deletions.
8 changes: 0 additions & 8 deletions .coveragerc

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/gating.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 1 addition & 2 deletions cachi2/core/rooted_path.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
12 changes: 12 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
]
9 changes: 6 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0c04685

Please sign in to comment.