Skip to content

Add pytest-queryguard to Tools - #135

Merged
cleder merged 1 commit into
cleder:mainfrom
MaciejZiel:add-pytest-queryguard
Oct 13, 2026
Merged

cleder merged 1 commit into
cleder:mainfrom
MaciejZiel:add-pytest-queryguard

Conversation

@MaciejZiel

@MaciejZiel MaciejZiel commented Oct 11, 2026 •

Copy link
Copy Markdown

Adds pytest-queryguard (MIT, on PyPI) to the Tools section, next to the other pytest helpers. It watches the SQL each test sends, fails the test when it sees an N+1 pattern even with only a few rows in the test database, and lets you set a per-test query budget with a max_queries marker. Disclosure: I'm the author.

Summary by Sourcery

New Features:

  • Add pytest-queryguard to the Tools section as a pytest plugin for detecting N+1 SQL queries and enforcing per-test query budgets.

@semanticdiff-com

Copy link
Copy Markdown

Review changes with  SemanticDiff

@sourcery-ai

sourcery-ai Bot commented Oct 11, 2026 •

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

Reviewer's Guide

The README now lists pytest-queryguard alongside other pytest tools, highlighting its SQLAlchemy 2 query monitoring, N+1 detection, and configurable per-test query budgets.

File-Level Changes

Change Details Files
Add pytest-queryguard to the pytest helper listings in the Tools section.
  • Add a link to the project repository.
  • Describe its N+1 query detection and per-test SQL query budget support for SQLAlchemy 2, including sync, async, and FastAPI usage.
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 11, 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

List pytest-queryguard among pytest testing tools

📝 Documentation 🕐 Less than 5 minutes

Grey Divider

AI Description

• Add pytest-queryguard to the README’s pytest tools list.
• Describe its N+1 query detection and query budgets for SQLAlchemy 2 tests.
High-Level Assessment

Listing the plugin alongside existing pytest helpers is appropriate for this curated tools section. No architectural alternative is warranted.

Files changed (1) +1 / -0

Documentation (1) +1 / -0
README.mdAdd pytest-queryguard to the testing tools list +1/-0

Add pytest-queryguard to the testing tools list

• Adds a link to pytest-queryguard and describes its N+1 query detection and query-budget support for SQLAlchemy 2 tests in synchronous, asynchronous, and FastAPI code.

README.md

@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 reviewed your changes and they look great!

Sourcery assessment

Approved.


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

@mergify

mergify Bot commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

This pull request does not currently match the merge queue conditions, so it cannot be queued from here. The box comes back if it matches again.

@llamapreview llamapreview 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.

LlamaPReview — No blocking issues found

Documentation-only one-line curation change: the new pytest-queryguard bullet sits inside the Tools section with correct link/description format and no duplicate entry, so it is safe to merge.

Review details and evidence

Material unknowns

  • Whether the linked project actually exists, is MIT-licensed, and is published on PyPI, and whether the repository's contribution guidelines impose extra requirements (e.g. a mandatory PyPI annotation). Not merge-deciding: the repository-local contract for an awesome-list entry — link text, URL form, placement, and description — is fully satisfied at the exact head, so no answer here changes the clear posture.
    • Check: No pre-merge action; if desired, the maintainer can spot-check the linked repository and any CONTRIBUTING policy out of band.

LlamaPReview checks

  • Read the complete PR-head file README.md.

Still coding alone? Open CarbonChat, a chat room right inside Codex.

@cleder
cleder merged commit 3ce59e1 into cleder:main Oct 13, 2026
5 checks passed
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.

2 participants