Skip to content

Commit 0fdee8a

Browse files
authored
Update workflow and unit tests (#9)
* Update workflow * Update unit test * Update test workflow * Update unit test * Remove pre-commit run
1 parent db33f28 commit 0fdee8a

File tree

4 files changed

+6
-18
lines changed

4 files changed

+6
-18
lines changed

.github/workflows/python-test.yml

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,8 @@ on:
1010
- '**.py'
1111
pull_request:
1212
branches: [ "main" ]
13-
paths:
14-
- '**.py'
1513
workflow_dispatch:
16-
# inputs:
17-
# branch_name:
18-
# description: 'Test against to branch'
19-
# required: true
20-
# default: 'main'
14+
2115

2216
permissions:
2317
contents: read
@@ -33,12 +27,10 @@ jobs:
3327
python-version: "3.10"
3428
- name: Install dependencies
3529
run: |
36-
python -m pip install --upgrade pip
30+
python3 -m pip install --upgrade pip
3731
pip install .
3832
pip install -r requirements-dev.txt
39-
- name: Lint with flake8
40-
run: flake8 --max-line-length=120
41-
- name: Run tests and collect coverage
33+
- name: Collect coverage
4234
run: |
4335
coverage run --source=tests,clang_tools -m pytest
4436
coverage report -m

requirements-dev.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
coverage
22
flake8
3+
pre-commit
34
pytest

tests/test_install.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from clang_tools.install import clang_tools_binary_url
77

88

9-
@pytest.mark.parametrize(('version', 'expected'), (('12', True), ('100', False)))
9+
@pytest.mark.parametrize(('version', 'expected'), (('', True), ('100', False)))
1010
def test_clang_tools_exist(version, expected):
1111
assert clang_format_exist(version) == expected
1212
assert clang_tidy_exist(version) == expected
@@ -18,7 +18,4 @@ def test_clang_tools_binary_url():
1818
os = check_install_os()
1919
for tool in tools:
2020
ret = clang_tools_binary_url(tool, version)
21-
if os == 'windows':
22-
assert(f"{tool}-{version}_{os}-amd64.exe" in ret)
23-
else:
24-
assert(f"{tool}-{version}_{os}-amd64" in ret)
21+
assert(f"{tool}-{version}_{os}-amd64" in ret)

tests/test_main.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,3 @@ def test_main_install(argv, called, response):
1111
if called and not response:
1212
with pytest.raises(SystemExit):
1313
main()
14-
else:
15-
main()

0 commit comments

Comments
 (0)