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
{{ message }}
Repository navigation
Commit 4e7eb9d
Browse filesBrowse the repository at this point in the historyBrowse files
docs: add prerequisites section and troubleshooting for pytest-cov installation (#226)
Fixes#163
Added comprehensive documentation to help users avoid the "unrecognized arguments" error
when pytest-cov is not installed:
1. Added Prerequisites section before Quick Start with:
- Python version requirements (3.6+ supported, 3.9+ recommended)
- Clear explanation that pytest-cov is required for --cov flags
- Collapsible Python version compatibility matrix
2. Added troubleshooting entry for "Unrecognized Arguments Error" with:
- Clear error message example
- Root cause explanation
- Multiple solution options (pip, requirements.txt, pyproject.toml)
- Workflow integration example
3. Updated Table of Contents to include new sections
This multi-layer approach prevents the issue proactively while helping users
who already encountered it.
Co-authored-by: Claude <[email protected]>
-[Coverage Report Too Large](#coverage-report-too-large)
48
50
-[GitHub Step Summary Too Large](#github-step-summary-too-large)
49
51
-[Files Not Found](#files-not-found)
@@ -56,6 +58,32 @@ A GitHub Action that adds pytest coverage reports as comments to your pull reque
56
58
57
59
</details>
58
60
61
+
## 📦 Prerequisites
62
+
63
+
Before using this action, ensure you have the following installed in your Python environment:
64
+
65
+
-**Python** - Version 3.6+ (Python 3.9+ recommended for latest pytest/pytest-cov versions)
66
+
-**pytest** - Python testing framework
67
+
-**pytest-cov** - Coverage plugin for pytest (provides `--cov` and `--cov-report` flags)
68
+
69
+
```bash
70
+
pip install pytest pytest-cov
71
+
```
72
+
73
+
> **Note**: The `--cov` and `--cov-report` flags used in the examples below are provided by `pytest-cov`, not pytest itself. If you see an error like `pytest: error: unrecognized arguments: --cov`, you need to install `pytest-cov`.
74
+
75
+
<details>
76
+
<summary>Python version compatibility</summary>
77
+
78
+
-**Python 3.9+**: Supported by latest pytest (8.4+) and pytest-cov (6.0+) versions
79
+
-**Python 3.8**: Use pytest-cov < 6.0.0 (e.g., pytest-cov 5.x)
80
+
-**Python 3.7**: Use pytest-cov < 5.0.0 (e.g., pytest-cov 4.x)
81
+
-**Python 3.6 and older**: Use older versions of pytest and pytest-cov
82
+
83
+
For most users, we recommend using **Python 3.9+** with the latest versions of pytest and pytest-cov to get the latest features and security updates.
84
+
85
+
</details>
86
+
59
87
## 🚀 Quick Start
60
88
61
89
Add this action to your workflow:
@@ -523,6 +551,49 @@ If you want auto-update the coverage badge on your README, you can see the [work
523
551
- For `workflow_dispatch`, provide the `issue-number` input
0 commit comments