ci: fix mypy and pytest-cov after clean
This commit is contained in:
4
.github/workflows/ci.yml
vendored
4
.github/workflows/ci.yml
vendored
@@ -46,8 +46,8 @@ jobs:
|
|||||||
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=200 --statistics
|
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=200 --statistics
|
||||||
- name: Type checking with mypy
|
- name: Type checking with mypy
|
||||||
run: |
|
run: |
|
||||||
mypy --install-types --non-interactive src tests
|
mypy --install-types --non-interactive src/*.py tests/*.py
|
||||||
mypy --strict src tests
|
mypy --strict src/*.py tests/*.py
|
||||||
if: matrix.python-version == '3.x'
|
if: matrix.python-version == '3.x'
|
||||||
- name: Test with pytest
|
- name: Test with pytest
|
||||||
run: pytest
|
run: pytest
|
||||||
|
|||||||
@@ -240,13 +240,13 @@ eval "$cmd"
|
|||||||
|
|
||||||
# Type checking
|
# Type checking
|
||||||
|
|
||||||
cmd="$MYPY --install-types --non-interactive *.py"
|
cmd="$MYPY --install-types --non-interactive src/*.py tests/*.py"
|
||||||
if $interactive ; then askContinueYn "$cmd"; else echo -e "${cyan}$cmd${reset}";fi
|
if $interactive ; then askContinueYn "$cmd"; else echo -e "${cyan}$cmd${reset}";fi
|
||||||
eval "$cmd"
|
eval "$cmd"
|
||||||
|
|
||||||
# change to src as python -m mypy adds the current dir Python sys.path
|
# change to src as python -m mypy adds the current dir Python sys.path
|
||||||
# execute in a subshell in order not to loose the exit code and not to change the dir in the currrent shell
|
# execute in a subshell in order not to loose the exit code and not to change the dir in the currrent shell
|
||||||
cmd="(cd src && $MYPY --strict *.py ../tests)"
|
cmd="$MYPY --strict src/*.py tests/*.py"
|
||||||
if $interactive ; then askContinueYn "$cmd"; else echo -e "${cyan}$cmd${reset}";fi
|
if $interactive ; then askContinueYn "$cmd"; else echo -e "${cyan}$cmd${reset}";fi
|
||||||
eval "$cmd"
|
eval "$cmd"
|
||||||
|
|
||||||
@@ -275,7 +275,7 @@ if $interactive ; then askContinueYn "$cmd"; else echo -e "${cyan}$cmd${reset}";
|
|||||||
eval "$cmd"
|
eval "$cmd"
|
||||||
|
|
||||||
COVERAGE_OUT="tests/reports/pytest-coverage.txt"
|
COVERAGE_OUT="tests/reports/pytest-coverage.txt"
|
||||||
cmd="pytest --cov=test_extract_otp_secret_keys_pytest --junitxml=tests/reports/pytest.xml --cov-report html:tests/reports/html --cov-report=term-missing tests/ | tee $COVERAGE_OUT"
|
cmd="mkdir -p tests/reports; pytest --cov=test_extract_otp_secret_keys_pytest --junitxml=tests/reports/pytest.xml --cov-report html:tests/reports/html --cov-report=term-missing tests/ | tee $COVERAGE_OUT"
|
||||||
if $interactive ; then askContinueYn "$cmd"; else echo -e "${cyan}$cmd${reset}";fi
|
if $interactive ; then askContinueYn "$cmd"; else echo -e "${cyan}$cmd${reset}";fi
|
||||||
eval "$cmd"
|
eval "$cmd"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user