Skip to content

Commit

Permalink
Use local coverage (#105)
Browse files Browse the repository at this point in the history
* use local coverage

* try with coverage run

* add fail_under
  • Loading branch information
blink1073 authored Apr 14, 2023
1 parent cd874a3 commit 2a2a78f
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 17 deletions.
17 changes: 12 additions & 5 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,17 @@ jobs:
timeout-minutes: 15
run: |
hatch run cov:test -s || hatch run test:test -s --lf
- name: Upload coverage
run: |
pip install codecov "coverage[toml]"
codecov
- uses: jupyterlab/maintainer-tools/.github/actions/upload-coverage@v1

coverage:
runs-on: ubuntu-latest
needs:
- build
steps:
- uses: actions/checkout@v3
- uses: jupyterlab/maintainer-tools/.github/actions/report-coverage@v1
with:
fail_under: 75

test_lint:
name: Test Lint
Expand Down Expand Up @@ -136,7 +143,7 @@ jobs:
tests_check: # This job does nothing and is only used for the branch protection
if: always()
needs:
- build
- coverage
- test_lint
- test_minimum_versions
- test_prereleases
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

pytest plugin that checks URLs for HTML-containing files.

[![codecov](https://codecov.io/gh/jupyterlab/pytest-check-links/branch/master/graph/badge.svg)](https://codecov.io/gh/jupyterlab/pytest-check-links)
[![Tests](https://github.com/jupyterlab/pytest-check-links/workflows/Tests/badge.svg)](https://github.com/jupyterlab/pytest-check-links/actions?query=workflow%3ATests+branch%3Amaster)
[![PyPI version](https://badge.fury.io/py/pytest-check-links.svg)](https://badge.fury.io/py/pytest-check-links)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/pytest-check-links)
Expand Down
9 changes: 0 additions & 9 deletions codecov.yml

This file was deleted.

8 changes: 6 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ nowarn = "test -W default {args}"

[tool.hatch.envs.cov]
features = ["test"]
dependencies = ["coverage", "pytest-cov"]
dependencies = ["coverage[toml]"]
[tool.hatch.envs.cov.scripts]
test = "pytest -vv --cov pytest_check_links --cov-branch --cov-report term-missing:skip-covered {args}"
test = "coverage run -m pytest {args}"
nowarn = "test -W default {args}"

[tool.hatch.envs.typing]
Expand Down Expand Up @@ -119,6 +119,10 @@ exclude_lines = [
"@(abc\\.)?abstractmethod",
]

[tool.coverage.run]
relative_files = true
source = ["pytest_check_links"]

[tool.mypy]
check_untyped_defs = true
disallow_subclassing_any = true
Expand Down

0 comments on commit 2a2a78f

Please sign in to comment.