Skip to content

Commit

Permalink
Merge pull request #1073 from saroad2/add_coverage_tests_to_core
Browse files Browse the repository at this point in the history
Add code coverage to Toga
  • Loading branch information
freakboy3742 authored Sep 25, 2020
2 parents e3ca2c1 + 83c0697 commit d8efe03
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 18 deletions.
7 changes: 7 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[run]
source = src/core/toga
omit =
src/core/toga/**/__init__.py

[report]
show_missing = True
21 changes: 11 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,17 @@ jobs:
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade setuptools
python -m pip install pytest-tldr
python -m pip install -e src/core
python -m pip install -e src/dummy
python -m pip install --upgrade tox
- name: Test
run: |
cd src/core
python setup.py test
tox -e py
- name: Check coverage
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
flags: unittests
fail_ci_if_error: true

python-versions:
# Only run this and subsequent steps on branches.
Expand All @@ -76,13 +80,10 @@ jobs:
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade setuptools
python -m pip install pytest-tldr
python -m pip install -e src/core
python -m pip install -e src/dummy
python -m pip install --upgrade tox
- name: Test
run: |
cd src/core
python setup.py test
tox -e py
windows:
name: Winforms backend tests
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*.dist-info
.eggs
.coverage
coverage.xml
dist
build
_build
Expand Down
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ include LICENSE
include README.rst
include release.sh
include tox.ini
include .coveragerc
recursive-exclude attic *
recursive-exclude contrib *
recursive-exclude demo *
Expand Down
20 changes: 12 additions & 8 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,20 @@
# and then run "tox" from this directory.

[tox]
# envlist = flake8,towncrier-check,docs,package,py{35,36,37,38}
envlist = flake8,towncrier-check,docs,package
envlist = flake8,towncrier-check,docs,package,py{35,36,37,38}
skip_missing_interpreters = true

# [testenv]
# deps =
# pytest
# pytest-tldr
# commands =
# pytest -vv tests
[testenv]
skip_install = True
deps =
setuptools
pytest-tldr
pytest-cov
commands:
python -m pip install -e src/core
python -m pip install -e src/dummy
pytest src/core/tests --cov
coverage xml

[testenv:flake8]
skip_install = True
Expand Down

0 comments on commit d8efe03

Please sign in to comment.