Skip to content

Commit ca16eb6

Browse files
committed
Add coverage testing tasks to VS Code and include coverage in requirements
1 parent f8c2abb commit ca16eb6

2 files changed

Lines changed: 60 additions & 0 deletions

File tree

.vscode/tasks.json

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,65 @@
143143
},
144144
"type": "shell",
145145
},
146+
{
147+
"label": "🧪 Coverage tests",
148+
"type": "shell",
149+
"command": "${command:python.interpreterPath}",
150+
"args": [
151+
"scripts/run_with_env.py",
152+
"${command:python.interpreterPath}",
153+
"-m",
154+
"coverage",
155+
"run",
156+
"-m",
157+
"pytest",
158+
"qwt",
159+
],
160+
"options": {
161+
"cwd": "${workspaceFolder}",
162+
"env": {
163+
"COVERAGE_PROCESS_START": "${workspaceFolder}/.coveragerc",
164+
},
165+
"statusbar": {
166+
"hide": true,
167+
},
168+
},
169+
"group": {
170+
"kind": "test",
171+
"isDefault": true,
172+
},
173+
"presentation": {
174+
"panel": "dedicated",
175+
},
176+
"problemMatcher": [],
177+
},
178+
{
179+
"label": "📊 Coverage full",
180+
"type": "shell",
181+
"windows": {
182+
"command": "${command:python.interpreterPath} scripts/run_with_env.py ${command:python.interpreterPath} -m coverage combine; if ($?) { ${command:python.interpreterPath} scripts/run_with_env.py ${command:python.interpreterPath} -m coverage html; if ($?) { start htmlcov\\index.html } }",
183+
},
184+
"linux": {
185+
"command": "${command:python.interpreterPath} scripts/run_with_env.py ${command:python.interpreterPath} -m coverage combine && ${command:python.interpreterPath} scripts/run_with_env.py ${command:python.interpreterPath} -m coverage html && xdg-open htmlcov/index.html",
186+
},
187+
"osx": {
188+
"command": "${command:python.interpreterPath} scripts/run_with_env.py ${command:python.interpreterPath} -m coverage combine && ${command:python.interpreterPath} scripts/run_with_env.py ${command:python.interpreterPath} -m coverage html && open htmlcov/index.html",
189+
},
190+
"options": {
191+
"cwd": "${workspaceFolder}",
192+
"env": {
193+
"COVERAGE_PROCESS_START": "${workspaceFolder}/.coveragerc",
194+
},
195+
},
196+
"presentation": {
197+
"panel": "dedicated",
198+
},
199+
"problemMatcher": [],
200+
"dependsOrder": "sequence",
201+
"dependsOn": [
202+
"🧪 Coverage tests",
203+
],
204+
},
146205
{
147206
"label": "Take screenshots",
148207
"type": "shell",

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ pre-commit
55
pylint
66
pytest
77
pytest-xvfb
8+
coverage
89
ruff

0 commit comments

Comments
 (0)