Skip to content

Commit

Permalink
get coverage directly with coverage run
Browse files Browse the repository at this point in the history
  • Loading branch information
richardsheridan committed Oct 20, 2024
1 parent c21c726 commit 28e657f
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 12 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,11 @@ jobs:
uv pip install --system `echo ./dist/*.whl` --no-deps
- name: Run tests
timeout-minutes: ${{ matrix.test-timeout }}
run: coverage run -m pytest trio_parallel
- name: Organize coverage
run: |
pytest trio_parallel --cov-report xml:coverage-${{ matrix.os }}-${{ matrix.python }}.xml
coverage combine
coverage xml -o coverage-${{ matrix.os }}-${{ matrix.python }}.xml
coverage report
mv .coverage .coverage.${{ matrix.os }}-${{ matrix.python }}
shell: bash
Expand Down Expand Up @@ -197,7 +200,7 @@ jobs:
python -m pip install -e . --no-deps
- name: Run tests
run: |
python -m pytest --no-cov docs/source
python -m pytest docs/source
Extras:
name: 'Test [test] extra'
Expand Down
5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,15 @@ underlines = ["-", "~", "^"]
issue_format = "`#{issue} <https://github.com/richardsheridan/trio-parallel/issues/{issue}>`__"

[tool.pytest.ini_options]
addopts = "--pyargs -r a -n auto --verbose --cov --cov-config=pyproject.toml --cov-context=test"
addopts = "--pyargs -r a -n auto --verbose"
filterwarnings = ["error"]
xfail_strict = true
faulthandler_timeout = 60

[tool.coverage.run]
branch = true
concurrency = ["multiprocessing", "thread"]
concurrency= ["multiprocessing"]
dynamic_context = "test_function"
parallel = true
source_pkgs = ["trio_parallel", "_trio_parallel_workers"]
disable_warnings = [
Expand Down
1 change: 0 additions & 1 deletion requirements/test.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
-r install.in
pytest
pytest-trio
pytest-cov
pytest-xdist
coverage[toml]
9 changes: 2 additions & 7 deletions requirements/test.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SHA1:8b82c6850c274e5160fedb09dd88c2c4b26e14dd
# SHA1:aaf15da780d17ea550fdbe592e283360c3413af9
#
# This file is autogenerated by pip-compile-multi
# To update, run:
Expand All @@ -9,9 +9,7 @@
colorama==0.4.6
# via pytest
coverage[toml]==7.6.3
# via
# -r requirements\test.in
# pytest-cov
# via -r requirements\test.in
execnet==2.1.1
# via pytest-xdist
iniconfig==2.0.0
Expand All @@ -23,11 +21,8 @@ pluggy==1.5.0
pytest==8.3.3
# via
# -r requirements\test.in
# pytest-cov
# pytest-trio
# pytest-xdist
pytest-cov==5.0.0
# via -r requirements\test.in
pytest-trio==0.8.0
# via -r requirements\test.in
pytest-xdist==3.6.1
Expand Down

0 comments on commit 28e657f

Please sign in to comment.