Skip to content

Commit

Permalink
Fix cov (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
iurisilvio authored Feb 28, 2024
1 parent 8a6a5a3 commit 463bb48
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ pytest-cov = "^4.1.0"
enable = true

[tool.pytest.ini_options]
addopts = "--capture=no --cov --cov-report term --cov-report xml"
addopts = "--capture=no"

[tool.ruff]
line-length = 88
Expand Down
1 change: 1 addition & 0 deletions pytest_ruff.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ def collect(self):
collection.append(RuffFormatItem.from_parent(self, name="ruff::format"))
return [Item.from_parent(self, name=Item.name) for Item in collection]


def check_file(path):
ruff = find_ruff_bin()
command = [ruff, "check", path, "--quiet", "--show-source", "--force-exclude"]
Expand Down
11 changes: 6 additions & 5 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
[tox]
isolated_build = true
envlist = py{38,39,310,311,312}
envlist = py{38,39,310,311,312},lint

[testenv]
allowlist_externals = poetry
commands =
poetry install --no-root --with dev
poetry run pytest -vvv {posargs}
# Disable ruff plugin to generate better coverage results
poetry run pytest -p no:ruff -vvv --cov --cov-append --cov-report term --cov-report xml {posargs}

[testenv:lint]
description = lint source code
deps =
ruff
commands =
ruff check .
ruff format .
ruff check --extend-exclude=tests/assets/ .
ruff format --check --exclude=tests/assets/ .

[gh-actions]
python =
3.8: py38
3.9: py39
3.10: py310
3.11: py311
3.12: py312
3.12: py312,lint

0 comments on commit 463bb48

Please sign in to comment.