Repository navigation
Add white box testing article to Resources - #146
sancharinipanda wants to merge 1 commit into
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThe PR updates the testing resources README by adding an article covering white-box coverage techniques with pytest, pytest-cov usage, and enforcing minimum coverage in CI. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
PR Summary by QodoAdd white-box testing article to Resources
AI Description
High-Level Assessment
Files changed (1)
|
|
Tick the box to add this pull request to the merge queue (same as
|
There was a problem hiding this comment.
Hey - I've found 1 issue
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="README.md" line_range="319" />
<code_context>
- [Patterns of flakey Python tests](https://tech.octopus.energy/news/2022/05/23/flakey-python-tests.html) - This post details several patterns that cause flakey Python tests. Being aware of these common causes can help when investigating your own flakey tests.
- [Unit testing Python code in Jupyter notebooks](https://www.wrighters.io/unit-testing-python-code-in-jupyter-notebooks) - This article covers several options for unit testing Python code in a Jupyter notebook.
- [30 best practices for software development and testing](https://opensource.com/article/17/5/30-best-practices-software-development-and-testing) - These software engineering rules and testing best practices might help save you time and headaches.
+- [White Box Testing: Techniques, Examples & Best Practices](https://keploy.io/blog/community/white-box-testing) - Statement, branch, path and condition coverage explained with pytest examples, measured with pytest-cov, plus coverage thresholds in CI.
### Books
</code_context>
<issue_to_address>
**Unsupported coverage metrics claimed**
When readers interpret “measured with pytest-cov” as applying to all four coverage types, pytest-cov and coverage.py report statement and branch coverage, but not path or condition coverage, so readers cannot reproduce the listing’s implied measurements for all four metrics.
Clarify that pytest-cov measures statement and branch coverage, while path and condition coverage are explained separately.
</issue_to_address>Sourcery assessment
Approved.
| - [Patterns of flakey Python tests](https://tech.octopus.energy/news/2022/05/23/flakey-python-tests.html) - This post details several patterns that cause flakey Python tests. Being aware of these common causes can help when investigating your own flakey tests. | ||
| - [Unit testing Python code in Jupyter notebooks](https://www.wrighters.io/unit-testing-python-code-in-jupyter-notebooks) - This article covers several options for unit testing Python code in a Jupyter notebook. | ||
| - [30 best practices for software development and testing](https://opensource.com/article/17/5/30-best-practices-software-development-and-testing) - These software engineering rules and testing best practices might help save you time and headaches. | ||
| - [White Box Testing: Techniques, Examples & Best Practices](https://keploy.io/blog/community/white-box-testing) - Statement, branch, path and condition coverage explained with pytest examples, measured with pytest-cov, plus coverage thresholds in CI. |
There was a problem hiding this comment.
⚪ Low · Unsupported coverage metrics claimed
When readers interpret “measured with pytest-cov” as applying to all four coverage types, pytest-cov and coverage.py report statement and branch coverage, but not path or condition coverage, so readers cannot reproduce the listing’s implied measurements for all four metrics.
Clarify that pytest-cov measures statement and branch coverage, while path and condition coverage are explained separately.
Prompt for AI agents
In `README.md` at line 319:
**Unsupported coverage metrics claimed**
When readers interpret “measured with pytest-cov” as applying to all four coverage types, pytest-cov and coverage.py report statement and branch coverage, but not path or condition coverage, so readers cannot reproduce the listing’s implied measurements for all four metrics.
Clarify that pytest-cov measures statement and branch coverage, while path and condition coverage are explained separately.
Adds a white box testing article to Resources > Articles. It walks through statement, branch, path and condition coverage with pytest examples, shows how to measure each with pytest-cov (including --cov-branch), and how to fail a CI build when coverage drops with --cov-fail-under.
Summary by Sourcery
New Features: