Skip to content

Commit abc655b

Browse files
committed
Add codecov option to nox -s tests session
1 parent 6f3be1a commit abc655b

3 files changed

Lines changed: 9 additions & 6 deletions

File tree

.github/workflows/codecov.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
pip install .[tests]
4040
4141
- name: Collect coverage
42-
run: nox -s tests
42+
run: nox -s tests -- codecov
4343

4444
- name: Upload to codecov
4545
uses: codecov/codecov-action@v5
@@ -48,6 +48,6 @@ jobs:
4848
verbose: true
4949
flags: unittests
5050
env_vars: OS,PYTHON
51+
files: ./coverage.xml
5152
name: codecov-umbrella
5253
fail_ci_if_error: false
53-
files: ./reports/coverage.xml

noxfile.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,13 +94,19 @@ def run_pytest(session: nox.Session) -> None:
9494
'--cov=ampworks',
9595
'tests/',
9696
]
97+
elif 'codecov' in session.posargs:
98+
command = [
99+
'pytest',
100+
'--cov=ampworks',
101+
'--cov-report=xml',
102+
'tests/',
103+
]
97104
else:
98105
os.makedirs('reports', exist_ok=True)
99106

100107
command = [
101108
'pytest',
102109
'--cov=ampworks',
103-
'--cov-config=pyproject.toml',
104110
'--cov-report=html:reports/htmlcov',
105111
'--cov-report=xml:reports/coverage.xml',
106112
'--junitxml=reports/junit.xml',

pyproject.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,6 @@ ignore = [
7979
[tool.ruff.lint.per-file-ignores]
8080
"tests/**/*" = ["D"]
8181

82-
[tool.coverage.run]
83-
relative_files = true
84-
8582
[project.optional-dependencies]
8683
gui = [
8784
"dash",

0 commit comments

Comments
 (0)