Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
7 changes: 1 addition & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
]
Expand Down Expand Up @@ -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",
Expand Down
Loading