Skip to content

Commit 67084eb

Browse files
authored
Merge pull request #88 from daroga0002/add-vscode-tests
better testing setup
2 parents 3138d3a + 20f8dec commit 67084eb

5 files changed

Lines changed: 17 additions & 4 deletions

File tree

.github/workflows/tests.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ jobs:
2929
python -m pip install --upgrade pip
3030
pip install -r requirements.txt
3131
pip install -r requirements_test_api.txt
32-
- name: Install dependencies
33-
run: pip install pytest pytest-md pytest-emoji
3432
- name: Run tests
3533
uses: pavelzw/pytest-action@v2
3634
with:

.vscode/settings.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
{
22
"files.associations": {
33
"config/*.yaml": "home-assistant"
4-
}
4+
},
5+
"python.testing.pytestArgs": [
6+
"tests/tests_api",
7+
"--cov-report=term-missing",
8+
"--cov=custom_components.tech.tech",
9+
"tests/"
10+
],
11+
"python.testing.unittestEnabled": false,
12+
"python.testing.pytestEnabled": true
513
}

requirements_test_api.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ pytest-sugar==1.0.0
1717
pytest-timeout==2.2.0
1818
pytest-xdist==3.3.1
1919
pytest==8.0.2
20+
pytest-md==0.2.0
21+
pytest-emoji==0.2.0
2022
requests_mock==1.11.0
2123
responses==0.12.0
2224
stdlib-list==0.7.0

scripts/setup

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ set -e
44

55
cd "$(dirname "$0")/.."
66

7-
python3 -m pip install --requirement requirements.txt
7+
python3 -m pip install --requirement requirements.txt --requirement requirements_test_api.txt

scripts/test

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
5+
pytest tests/tests_api --cov-report=term-missing --cov=custom_components.tech.tech tests/

0 commit comments

Comments
 (0)