Skip to content

Commit

Permalink
Merge pull request #782 from akx/cov
Browse files Browse the repository at this point in the history
Run tests with coverage reporting
  • Loading branch information
PierreF authored Jan 10, 2024
2 parents 207991c + 79fca65 commit 2eb5350
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 10 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/tox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,6 @@ jobs:
setup.py
- run: pip install tox
- run: tox -e py
- uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
2 changes: 0 additions & 2 deletions requirements.txt

This file was deleted.

1 change: 0 additions & 1 deletion tests/lib/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ def starter(name: str, expected_returncode: int = 0) -> None:
PYTHONPATH=f"{tests_path}{os.pathsep}{os.environ.get('PYTHONPATH', '')}",
)
assert 'PAHO_SERVER_PORT' in env, "PAHO_SERVER_PORT must be set in the environment when starting a client"
# TODO: it would be nice to run this under `coverage` too!
proc = subprocess.Popen([ # noqa: S603
sys.executable,
str(client_path),
Expand Down
11 changes: 4 additions & 7 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,12 @@
envlist = py{37,38,39,310,311,312}

[testenv]
whitelist_externals = echo make
deps =
-rrequirements.txt
ruff==0.1.8
allowlist_externals =
echo
make
pytest
pytest-cov
commands =
pytest {posargs}
pytest --cov=. --cov={envsitepackagesdir}/paho {posargs}
coverage xml -o coverage.xml
env =
PYTHONDEVMODE=1

Expand Down

0 comments on commit 2eb5350

Please sign in to comment.