@@ -165,20 +165,27 @@ check-actionlint:
165165check :
166166 pre-commit run --all-files
167167
168- # Run all unit tests. The --files option avoids stashing but passes files; however,
169- # the hook setup itself does not pass files to pytest (see .pre-commit-config.yaml).
170- .PHONY : test
171- test :
172- pre-commit run pytest --hook-stage push --files tests/
168+ # Run different kinds of tests: unit tests, integration tests, performance tests.
169+ # Note that the default goal 'test' runs the unit tests only, mainly for convenience
170+ # and compatibility with existing scripts.
171+ .PHONY : test test-all test-unit test-integration test-performance
172+ test : test-unit
173+ test-unit :
174+ COVERAGE_CORE=sysmon python -m pytest --config-file pyproject.toml --cov-config pyproject.toml -m ' not integration and not performance' src/package/ tests/ docs/
175+ test-integration :
176+ python -m pytest --config-file pyproject.toml --no-cov -m integration tests/
177+ test-performance :
178+ python -m pytest --config-file pyproject.toml --no-cov -m performance tests/
179+ test-all : test-unit test-integration test-performance
173180
174181# Build a source distribution package and a binary wheel distribution artifact.
175182# When building these artifacts, we need the environment variable SOURCE_DATE_EPOCH
176183# set to the build date/epoch. For more details, see: https://flit.pypa.io/en/latest/reproducible.html
177184.PHONY : dist
178185dist : dist/$(PACKAGE_NAME ) -$(PACKAGE_VERSION ) -py3-none-any.whl dist/$(PACKAGE_NAME ) -$(PACKAGE_VERSION ) .tar.gz dist/$(PACKAGE_NAME ) -$(PACKAGE_VERSION ) -docs-html.zip dist/$(PACKAGE_NAME ) -$(PACKAGE_VERSION ) -docs-md.zip dist/$(PACKAGE_NAME ) -$(PACKAGE_VERSION ) -build-epoch.txt
179- dist/$(PACKAGE_NAME ) -$(PACKAGE_VERSION ) -py3-none-any.whl : check test dist/$(PACKAGE_NAME ) -$(PACKAGE_VERSION ) -build-epoch.txt
186+ dist/$(PACKAGE_NAME ) -$(PACKAGE_VERSION ) -py3-none-any.whl : check test-all dist/$(PACKAGE_NAME ) -$(PACKAGE_VERSION ) -build-epoch.txt
180187 SOURCE_DATE_EPOCH=$(SOURCE_DATE_EPOCH ) flit build --setup-py --format wheel
181- dist/$(PACKAGE_NAME ) -$(PACKAGE_VERSION ) .tar.gz : check test dist/$(PACKAGE_NAME ) -$(PACKAGE_VERSION ) -build-epoch.txt
188+ dist/$(PACKAGE_NAME ) -$(PACKAGE_VERSION ) .tar.gz : check test-all dist/$(PACKAGE_NAME ) -$(PACKAGE_VERSION ) -build-epoch.txt
182189 SOURCE_DATE_EPOCH=$(SOURCE_DATE_EPOCH ) flit build --setup-py --format sdist
183190dist/$(PACKAGE_NAME ) -$(PACKAGE_VERSION ) -docs-html.zip : docs-html
184191 python -m zipfile -c dist/$(PACKAGE_NAME ) -$(PACKAGE_VERSION ) -docs-html.zip docs/_build/html/
0 commit comments