Skip to content

Commit 1e456e9

Browse files
committed
chore(pytest): update multiprocessing coverage integration
Based on: https://github.com/pytest-dev/pytest-cov/blob/v7.0.0/docs/subprocess-support.rst After fixing the source path entries (`unblob` package moved under the `python/` directory when merged with `unblob-native`), coverage measurement "just works"
1 parent 3e4b498 commit 1e456e9

File tree

2 files changed

+2
-11
lines changed

2 files changed

+2
-11
lines changed

pyproject.toml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ parametrize-names-type = "csv"
151151
"attr".msg = "Use `attrs` (with an 's') instead"
152152

153153
[tool.pytest.ini_options]
154-
addopts = "--cov=unblob --cov=tests --cov-branch --cov-fail-under=90"
154+
addopts = "--cov --cov-fail-under=90"
155155
norecursedirs = """
156156
*.egg
157157
*_extract
@@ -162,15 +162,10 @@ norecursedirs = """
162162
tests/integration
163163
"""
164164

165-
[tool.coverage.paths]
166-
source = ["tests", "unblob"]
167-
168165
[tool.coverage.run]
169166
branch = true
170167
concurrency = ["multiprocessing"]
171-
parallel = true
172-
sigterm = true
173-
source = ["tests", "unblob"]
168+
source = ["python", "tests"]
174169

175170
[tool.coverage.report]
176171
fail_under = 90

python/unblob/testing.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
import pytest
1010
from lark.lark import Lark
1111
from lark.visitors import Discard, Transformer
12-
from pytest_cov.embed import cleanup_on_sigterm
1312

1413
from unblob.finder import build_hyperscan_database
1514
from unblob.logging import configure_logger
@@ -24,9 +23,6 @@ def configure_logging(tmp_path_factory):
2423
log_path = tmp_path_factory.mktemp("logs") / "unblob.log"
2524
configure_logger(verbosity_level=3, extract_root=extract_root, log_path=log_path)
2625

27-
# https://pytest-cov.readthedocs.io/en/latest/subprocess-support.html#if-you-use-multiprocessing-process
28-
cleanup_on_sigterm()
29-
3026

3127
def gather_integration_tests(test_data_path: Path):
3228
# Path.glob() trips on some invalid files

0 commit comments

Comments
 (0)