diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9cb85235..9f0d551d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -160,14 +160,12 @@ repos: hooks: - id: actionlint -# On push to the remote, run all tests. Note that the `COVERAGE_CORE` variable is required -# for Python 3.12+ to make sure Coverage uses the new Python monitoring module. -# See also: https://blog.trailofbits.com/2025/05/01/making-pypis-test-suite-81-faster/#optimizing-coverage-with-python-312s-sysmonitoring +# On push to the remote, run all tests. - repo: local hooks: - id: pytest name: Run unit tests - entry: env COVERAGE_CORE=sysmon pytest --config-file pyproject.toml --cov-config pyproject.toml -m 'not integration and not performance' src/package/ tests/ docs/ + entry: pytest --config-file pyproject.toml --cov-config pyproject.toml -m 'not integration and not performance' src/package/ tests/ docs/ language: python verbose: true always_run: true diff --git a/Makefile b/Makefile index 729531eb..dc213643 100644 --- a/Makefile +++ b/Makefile @@ -171,7 +171,7 @@ check: .PHONY: test test-all test-unit test-integration test-performance test: test-unit test-unit: - COVERAGE_CORE=sysmon python -m pytest --config-file pyproject.toml --cov-config pyproject.toml -m 'not integration and not performance' src/package/ tests/ docs/ + python -m pytest --config-file pyproject.toml --cov-config pyproject.toml -m 'not integration and not performance' src/package/ tests/ docs/ test-integration: python -m pytest --config-file pyproject.toml --no-cov -m integration tests/ test-performance: diff --git a/pyproject.toml b/pyproject.toml index 2788c649..788cc839 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -61,14 +61,13 @@ hooks = [ ] # Note that the `custom_exit_code` and `env` plugins may currently be unmaintained. test = [ - "coverage ==7.6.12; python_version<'3.14'", # https://github.com/pypi/warehouse/pull/17872#issuecomment-2845932281 "faker ==40.19.1", "hypothesis >=6.21.0,<6.152.10", "pytest >=9.0.3,<10.0.0", "pytest-benchmark ==5.2.3", "pytest-cases ==3.10.1", "pytest-custom_exit_code ==0.3.0", - "pytest-cov ==6.3.0", # Uses: coverage[toml] >=7.5 + "pytest-cov ==7.1.0", "pytest-doctestplus ==1.7.1", "pytest-env ==1.2.0", ] @@ -266,10 +265,6 @@ env = [ filterwarnings = [ "error", "always::DeprecationWarning", - # The CoverageWarning warning is issued in two contexts: - # Python 3.10, 3.11: sys.monitoring isn't available in this version, using default core (no-sysmon) - # Python 3.12, 3.13: sys.monitoring can't measure branches in this version, using default core (no-sysmon) - "ignore:sys.monitoring isn't available in this version:coverage.exceptions.CoverageWarning", "always::coverage.exceptions.CoverageWarning", # https://docs.pytest.org/en/latest/how-to/failures.html#warning-about-unraisable-exceptions-and-unhandled-thread-exceptions "error::pytest.PytestUnraisableExceptionWarning",