You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-**Why:** The standard, feature-rich combination for modern Python testing, offering excellent DX for writing tests and robust, standard coverage reporting. ([Details](topics/06_testing-coverage.md))
51
51
52
52
-**07: Documentation Generation and Building:**
@@ -117,7 +117,7 @@ The true power of this template lies in how these chosen tools work together coh
117
117
1.**Configuration:** Defined primarily in `pyproject.toml` and separate tool config files ([01](topics/01_project-structure.md)).
118
118
2.**Dependency/Environment Management:** Handled efficiently by {uv}`uv<>`, creating standard virtual environments and managing packages based on `pyproject.toml` and `uv.lock` ([02](topics/02_dependency-management.md)).
119
119
3.**Task Automation:** Orchestrated by {nox}`Nox<>`, calling commands from other tools via `uv run` (or `uvx`), providing the single interface for developers and CI/CD to run workflows ([12](topics/12_task-automation.md)).
120
-
4.**Code Quality & Testing:** Ensured by {ruff}`Ruff<>` (formatting/linting), {pyright}`Pyright<>` (typing), {pip-audit}`pip-audit<>` (dep security), and {bandit-bandit}`Bandit<>` (code security), along with {pytest-pytest-cov}`pytest<>`/{coverage.py}`coverage.py<>` for testing. These tools are installed via {uv}`uv<>` and executed via Task Automation ([03](topics/03_code-formatting.md)-[08](topics/08_security-checks.md), orchestrated by [12](topics/12_task-automation.md)).
120
+
4.**Code Quality & Testing:** Ensured by {ruff}`Ruff<>` (formatting/linting), {pyright}`Pyright<>` (typing), {pip-audit}`pip-audit<>` (dep security), and {bandit-bandit}`Bandit<>` (code security), along with {pytest-pytest-cov}`pytest<>`/{coverage.py}`coveragepy-coverage-documentation<>` for testing. These tools are installed via {uv}`uv<>` and executed via Task Automation ([03](topics/03_code-formatting.md)-[08](topics/08_security-checks.md), orchestrated by [12](topics/12_task-automation.md)).
121
121
5.**Packaging & Distribution:** Artifacts created via {uv}`uv<>` build using selected backends, and published via {uv}`uv<>` publish, orchestrated by Task Automation ([09](topics/09_packaging-build.md)-[10](topics/10_packaging-publish.md)).
122
122
6.**Containerization:** Defined by `Dockerfile`, built by {docker}`Docker<>`/{podman}`Podman<>` (often via `uv` installing deps inside), orchestrated by Task Automation. Local multi-container setups managed by {docker}`Docker Compose<>` ([11](topics/11_container-build.md), [15](topics/15_compose-local.md)).
123
123
7.**Automated Workflows:** Triggered by CI/CD platforms (configured to call Task Automation commands), handling matrices, secrets, and reporting ([13](topics/13_ci-orchestration.md)-[14](topics/14_cd-orchestration.md)).
Copy file name to clipboardExpand all lines: docs/topics/06_testing-coverage.md
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -81,8 +81,8 @@ We evaluated the primary testing framework and coverage tools:
81
81
82
82
-**Integration with Testing & Coverage:** Excellent. Provides seamless, standard integration by adding `--cov` flags to the `pytest` command. Orchestrates running {coverage.py}`coverage.py<>` around the {pytest-pytest-cov}`pytest<>` run.
83
83
-**Accurate & Detailed Reporting:** Excellent. Leverages {coverage.py}`coverage.py<>`'s full reporting capabilities via {pytest-pytest-cov}`pytest<>` command-line arguments and config files.
84
-
-**Performance:** High (Combined). Adds minimal overhead; combined performance is driven by {pytest-pytest-cov}`pytest<>` and {coverage.py}`coverage.py<>` execution.
85
-
-**OS Interoperability:** Excellent. Pure Python plugin, inherits compatibility from {pytest-pytest-cov}`pytest<>` and {coverage.py}`coverage.py<>`.
84
+
-**Performance:** High (Combined). Adds minimal overhead; combined performance is driven by {pytest-pytest-cov}`pytest<>` and {coverage.py}`coveragepy-coverage-documentation<>` execution.
85
+
-**OS Interoperability:** Excellent. Pure Python plugin, inherits compatibility from {pytest-pytest-cov}`pytest<>` and {coverage.py}`coveragepy-coverage-documentation<>`.
86
86
-**Callable for Workflow:** Excellent. Simply adds flags to the standard `pytest` command, easily used in Task Automation and CI.
87
87
-**Maturity & Stability:** Very High. The standard, mature, and stable plugin for {pytest-pytest-cov}`pytest<>` coverage integration.
88
88
-**Community & Documentation:** Very High. Essential part of the {pytest-pytest-cov}`pytest<>` ecosystem.
@@ -110,21 +110,21 @@ We evaluated the primary testing framework and coverage tools:
110
110
111
111
## Justification for the Choice
112
112
113
-
The combination of **{pytest}`pytest<>`**, **{coverage.py}`coverage.py<>`**, and **{pytest-pytest-cov}`pytest-cov<>`** is the best fit for providing robust testing and coverage capabilities in this template, complemented by **{nox}`Nox<>`** for matrix execution:
113
+
The combination of **{pytest}`pytest<>`**, **{coverage.py}`coveragepy-coverage-documentation<>`**, and **{pytest-pytest-cov}`pytest-cov<>`** is the best fit for providing robust testing and coverage capabilities in this template, complemented by **{nox}`Nox<>`** for matrix execution:
114
114
115
115
1.**Developer Experience:** {pytest-pytest-cov}`pytest<>` offers significantly **easier test writing and organization** compared to {unittest-documentation}`unittest<>`, with powerful features like fixtures and parametrization that improve test maintainability and expressiveness (addressing **Ease of Use** and **Feature-Rich**). This aligns with the **"Obvious way to do it"** for writing tests.
116
-
2.**Standards and Integration:** {pytest-pytest-cov}`pytest<>` is the de facto standard modern Python testing framework, and {coverage.py}`coverage.py<>` is the universal coverage engine. **{pytest-pytest-cov}`pytest-cov<>`** provides **seamless, standard integration** between them via a simple command-line flag (`--cov`), making combined testing and coverage easy to run and automate (addressing **Integration**).
117
-
3.**Reporting:** This combination provides **excellent standard reporting**, including JUnit XML from {pytest-pytest-cov}`pytest<>` and Cobertura XML/HTML from {coverage.py}`coverage.py<>`, which are essential for integration into CI/CD platforms (Area 13, 14) (addressing **Reporting**).
116
+
2.**Standards and Integration:** {pytest-pytest-cov}`pytest<>` is the de facto standard modern Python testing framework, and {coverage.py}`coveragepy-coverage-documentation<>` is the universal coverage engine. **{pytest-pytest-cov}`pytest-cov<>`** provides **seamless, standard integration** between them via a simple command-line flag (`--cov`), making combined testing and coverage easy to run and automate (addressing **Integration**).
117
+
3.**Reporting:** This combination provides **excellent standard reporting**, including JUnit XML from {pytest-pytest-cov}`pytest<>` and Cobertura XML/HTML from {coverage.py}`coveragepy-coverage-documentation<>`, which are essential for integration into CI/CD platforms (Area 13, 14) (addressing **Reporting**).
118
118
4.**Performance & OS Interoperability:** All chosen tools are **performant** for their tasks and **highly OS-interoperable**, working reliably across development and CI environments (addressing **Performance** and **OS Interoperability**).
119
119
5.**Matrix Testing:** While {pytest-pytest-cov}`pytest<>` itself isn't a matrix orchestrator, **{nox}`Nox<>`** (Area 12) is explicitly designed to run sessions (like our test session) across different Python versions and environments using `uv`, effectively providing the necessary matrix testing capability within the template's primary automation layer. For complex scenarios or community conventions, {nox}`Nox<>` can easily **invoke {tox}`Tox<>`**.
120
120
121
121
{unittest-documentation}`unittest<>` was discounted due to its comparative verbosity, lack of features, and less streamlined integration for testing+coverage. {tox}`Tox<>` is better suited as a matrix _runner_ called by {nox}`Nox<>` than the primary testing _framework_ itself.
122
122
123
-
By choosing this combination, the template leverages the strengths of each tool – {pytest-pytest-cov}`pytest<>` for writing tests, {coverage.py}`coverage.py<>` for coverage, {pytest-pytest-cov}`pytest-cov<>` for integration, and {nox}`Nox<>` for orchestration – to provide a robust, modern, and well-integrated testing and coverage solution.
123
+
By choosing this combination, the template leverages the strengths of each tool – {pytest-pytest-cov}`pytest<>` for writing tests, {coverage.py}`coveragepy-coverage-documentation<>` for coverage, {pytest-pytest-cov}`pytest-cov<>` for integration, and {nox}`Nox<>` for orchestration – to provide a robust, modern, and well-integrated testing and coverage solution.
124
124
125
125
## Interactions with Other Topics
126
126
127
-
-**pyproject.toml (01):** {pytest-pytest-cov}`pytest<>` and {coverage.py}`coverage.py<>` are configured via `pyproject.toml` (`[tool.pytest]`, `[tool.coverage]`) or separate config files (`.coveragerc`). Testing dependencies are managed via {uv}`uv<>` (Area 02).
127
+
-**pyproject.toml (01):** {pytest-pytest-cov}`pytest<>` and {coverage.py}`coveragepy-coverage-documentation<>` are configured via `pyproject.toml` (`[tool.pytest]`, `[tool.coverage]`) or separate config files (`.coveragerc`). Testing dependencies are managed via {uv}`uv<>` (Area 02).
128
128
-**Task Automation (12):** {nox}`Nox<>` sessions are defined to run the test suite (`uv run pytest --cov...`). This session is run across the matrix of Python versions defined in the `noxfile.py`. {nox}`Nox<>` also orchestrates {tox}`Tox<>` if needed.
129
129
-**CI Orchestration (13):** The CI pipeline runs the test sessions defined in {nox}`Nox<>` (`nox -s test`), leveraging the CI platform's matrix capabilities or relying on Nox's internal matrixing (`-p` flag). Test reports (JUnit XML) and coverage reports (Cobertura XML) are artifacts collected by CI.
130
-
-**Dev Containers (17):** {pytest-pytest-cov}`pytest<>`, {coverage.py}`coverage.py<>`, {pytest-pytest-cov}`pytest-cov<>` are installed and used within the development container for local testing.
130
+
-**Dev Containers (17):** {pytest-pytest-cov}`pytest<>`, {coverage.py}`coveragepy-coverage-documentation<>`, {pytest-pytest-cov}`pytest-cov<>` are installed and used within the development container for local testing.
Copy file name to clipboardExpand all lines: docs/usage.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -93,7 +93,7 @@ The template uses {pytest-pytest-cov}`pytest<>` ([Topic 06](topics/06_testing-co
93
93
```bash
94
94
uvx nox -s test
95
95
```
96
-
This runs tests across applicable Python versions and measures code coverage with {coverage.py}`coverage.py<>` ([Topic 06](topics/06_testing-coverage.md)) based on `.coveragerc`. Reports are generated (JUnit XML for CI, terminal summary).
96
+
This runs tests across applicable Python versions and measures code coverage with {coverage.py}`coveragepy-coverage-documentation<>` ([Topic 06](topics/06_testing-coverage.md)) based on `.coveragerc`. Reports are generated (JUnit XML for CI, terminal summary).
0 commit comments