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 50e761a
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 15 deletions.
8 changes: 0 additions & 8 deletions .coveragerc

This file was deleted.

6 changes: 4 additions & 2 deletions .github/workflows/gating.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox tox-gh-actions
pip install tox
pip install tox-gh-actions
pip install coverage
- name: Test with tox
run: tox
- name: Run coveralls-python
Expand All @@ -39,7 +41,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 50e761a

Please sign in to comment.