Skip to content

Add white box testing article to Resources - #146

Open
sancharinipanda wants to merge 1 commit into
cleder:mainfrom
sancharinipanda:add-keploy-blog-2
Open

sancharinipanda wants to merge 1 commit into
cleder:mainfrom
sancharinipanda:add-keploy-blog-2

Conversation

@sancharinipanda

@sancharinipanda sancharinipanda commented Oct 27, 2026 •

Copy link
Copy Markdown

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:

  • Add a white box testing article to the Resources articles collection, covering coverage techniques, pytest examples, pytest-cov measurement, and CI coverage thresholds.

@semanticdiff-com

Copy link
Copy Markdown

Review changes with  SemanticDiff

@sourcery-ai

sourcery-ai Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

The 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

Change Details Files
Adds a white-box testing article to the testing resources collection.
  • Links the article from the Articles section.
  • Summarizes its coverage of statement, branch, path, and condition testing using pytest.
  • Highlights pytest-cov measurement, branch coverage configuration, and CI coverage thresholds.
README.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@qodo-code-review

qodo-code-review Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

Grey Divider

Sorry, something went wrong

We weren't able to complete the code review on our side. Please try again manually by commenting /agentic_review on this PR.

Grey Divider

Qodo Logo

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Add white-box testing article to Resources

📝 Documentation 🕐 Less than 5 minutes

Grey Divider

AI Description

• Add a white-box testing article to Resources > Articles.
• Highlight its coverage techniques, pytest examples, and CI coverage thresholds.
High-Level Assessment

A direct entry in the existing Articles list is appropriate for a single external resource; no structural change is warranted.

Files changed (1) +1 / -0

Documentation (1) +1 / -0
README.mdList a white-box testing article +1/-0

List a white-box testing article

• Adds a link under Resources > Articles describing statement, branch, path, and condition coverage, with pytest-cov measurement and CI threshold guidance.

README.md

@mergify

mergify Bot commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

Comment thread README.md
- [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.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚪ 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant