diff --git a/package.nix b/package.nix index e447594494..6911ebb7b5 100644 --- a/package.nix +++ b/package.nix @@ -126,17 +126,13 @@ python3.pkgs.buildPythonApplication { with python3.pkgs; [ pytestCheckHook - pytest-cov + pytest-cov-stub versionCheckHook ] ++ runtimeDeps; versionCheckProgramArg = "--version"; - pytestFlagsArray = [ - "--no-cov" - ]; - passthru = { # helpful to easily add these to a nix-shell environment inherit runtimeDeps; diff --git a/pyproject.toml b/pyproject.toml index e73436428d..9bc185a4d1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -43,7 +43,7 @@ dev = [ "atheris>=2.3,<3.0; sys_platform == 'linux' and python_version < '3.12'", "pre-commit>=3.5,<5.0", "pyright>=1.1.349", - "pytest-cov>=3,<7", + "pytest-cov>=7,<8", "pytest>=8.0.0", "pyyaml>=6.0.1", "ruff==0.12.12", @@ -151,7 +151,7 @@ parametrize-names-type = "csv" "attr".msg = "Use `attrs` (with an 's') instead" [tool.pytest.ini_options] -addopts = "--cov=unblob --cov=tests --cov-branch --cov-fail-under=90" +addopts = "--cov --cov-fail-under=90" norecursedirs = """ *.egg *_extract @@ -162,15 +162,10 @@ norecursedirs = """ tests/integration """ -[tool.coverage.paths] -source = ["tests", "unblob"] - [tool.coverage.run] branch = true concurrency = ["multiprocessing"] -parallel = true -sigterm = true -source = ["tests", "unblob"] +source = ["python", "tests"] [tool.coverage.report] fail_under = 90 diff --git a/python/unblob/testing.py b/python/unblob/testing.py index b2bc5d4190..dcda111799 100644 --- a/python/unblob/testing.py +++ b/python/unblob/testing.py @@ -9,7 +9,6 @@ import pytest from lark.lark import Lark from lark.visitors import Discard, Transformer -from pytest_cov.embed import cleanup_on_sigterm from unblob.finder import build_hyperscan_database from unblob.logging import configure_logger @@ -24,9 +23,6 @@ def configure_logging(tmp_path_factory): log_path = tmp_path_factory.mktemp("logs") / "unblob.log" configure_logger(verbosity_level=3, extract_root=extract_root, log_path=log_path) - # https://pytest-cov.readthedocs.io/en/latest/subprocess-support.html#if-you-use-multiprocessing-process - cleanup_on_sigterm() - def gather_integration_tests(test_data_path: Path): # Path.glob() trips on some invalid files diff --git a/uv.lock b/uv.lock index 0e1f8c1e99..e4438b4f13 100644 --- a/uv.lock +++ b/uv.lock @@ -1532,16 +1532,16 @@ wheels = [ [[package]] name = "pytest-cov" -version = "6.3.0" +version = "7.0.0" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "coverage", extra = ["toml"] }, { name = "pluggy" }, { name = "pytest" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/30/4c/f883ab8f0daad69f47efdf95f55a66b51a8b939c430dadce0611508d9e99/pytest_cov-6.3.0.tar.gz", hash = "sha256:35c580e7800f87ce892e687461166e1ac2bcb8fb9e13aea79032518d6e503ff2", size = 70398, upload-time = "2025-09-06T15:40:14.361Z" } +sdist = { url = "https://files.pythonhosted.org/packages/5e/f7/c933acc76f5208b3b00089573cf6a2bc26dc80a8aece8f52bb7d6b1855ca/pytest_cov-7.0.0.tar.gz", hash = "sha256:33c97eda2e049a0c5298e91f519302a1334c26ac65c1a483d6206fd458361af1", size = 54328, upload-time = "2025-09-09T10:57:02.113Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/80/b4/bb7263e12aade3842b938bc5c6958cae79c5ee18992f9b9349019579da0f/pytest_cov-6.3.0-py3-none-any.whl", hash = "sha256:440db28156d2468cafc0415b4f8e50856a0d11faefa38f30906048fe490f1749", size = 25115, upload-time = "2025-09-06T15:40:12.44Z" }, + { url = "https://files.pythonhosted.org/packages/ee/49/1377b49de7d0c1ce41292161ea0f721913fa8722c19fb9c1e3aa0367eecb/pytest_cov-7.0.0-py3-none-any.whl", hash = "sha256:3b8e9558b16cc1479da72058bdecf8073661c7f57f7d3c5f22a1c23507f2d861", size = 22424, upload-time = "2025-09-09T10:57:00.695Z" }, ] [[package]] @@ -2040,7 +2040,7 @@ dev = [ { name = "pre-commit", specifier = ">=3.5,<5.0" }, { name = "pyright", specifier = ">=1.1.349" }, { name = "pytest", specifier = ">=8.0.0" }, - { name = "pytest-cov", specifier = ">=3,<7" }, + { name = "pytest-cov", specifier = ">=7,<8" }, { name = "pyyaml", specifier = ">=6.0.1" }, { name = "ruff", specifier = "==0.12.12" }, { name = "taplo", specifier = ">=0.9.3" },