Skip to content
This repository was archived by the owner on Feb 17, 2021. It is now read-only.

Commit 3843ec4

Browse files
author
Thiago C. D'Ávila
authored
Merge pull request #49 from staticdev/pytest-cov
Remove pytest-cov
2 parents 426082e + ad33305 commit 3843ec4

5 files changed

Lines changed: 25 additions & 62 deletions

File tree

.github/workflows/coverage.yml

Lines changed: 0 additions & 36 deletions
This file was deleted.

.github/workflows/tests.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,12 @@ jobs:
4141
- name: Run Nox
4242
run: |
4343
nox --force-color
44+
45+
- name: Create coverage report
46+
if: always() && matrix.session == 'tests'
47+
run: |
48+
nox --force-color --session=coverage -- xml
49+
50+
- name: Upload coverage report
51+
if: always() && matrix.session == 'tests'
52+
uses: codecov/codecov-action@v1.0.7

noxfile.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,10 +137,20 @@ def mypy(session: Session) -> None:
137137
@nox.session(python=python_versions)
138138
def tests(session: Session) -> None:
139139
"""Run the test suite."""
140-
args = session.posargs or ["--cov"]
141140
install_package(session)
142-
install(session, "coverage[toml]", "pytest", "pytest-cov", "pytest_mock")
143-
session.run("pytest", *args)
141+
install(session, "coverage[toml]", "pytest", "pytest_mock")
142+
session.run("coverage", "run", "--parallel", "-m", "pytest", *session.posargs)
143+
session.notify("coverage")
144+
145+
146+
@nox.session
147+
def coverage(session: Session) -> None:
148+
"""Produce the coverage report."""
149+
args = session.posargs or ["report"]
150+
install(session, "coverage[toml]")
151+
if not session.posargs and any(Path().glob(".coverage.*")):
152+
session.run("coverage", "combine")
153+
session.run("coverage", *args)
144154

145155

146156
@nox.session(python=python_versions)

poetry.lock

Lines changed: 3 additions & 22 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ importlib_metadata = {version = "^1.6.0", python = "<3.8"}
1717
[tool.poetry.dev-dependencies]
1818
pytest = "^5.4.2"
1919
coverage = {extras = ["toml"], version = "^5.0.3"}
20-
pytest-cov = "^2.8.1"
2120
black = "^19.10b0"
2221
flake8 = "^3.8.1"
2322
flake8-bandit = "^2.1.2"

0 commit comments

Comments
 (0)