Skip to content

Conversation

kingbuzzman
Copy link
Member

@kingbuzzman kingbuzzman commented Feb 7, 2025

Adds quality of life to replace

from django.db import connections

def test_test():
    with django_assert_num_queries(1, connection=connections["log"]):
        Model.objects.get()

with

def test_test():
    with django_assert_num_queries(1, using="log"):
        Model.objects.get()

I have multiple DBs and this is driving me nuts...

Copy link
Member

@adamchainz adamchainz left a comment

Choose a reason for hiding this comment

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

Seems like a valuable QOL and would actually align with Django’s API

@kingbuzzman kingbuzzman marked this pull request as ready for review February 10, 2025 09:01
@kingbuzzman kingbuzzman mentioned this pull request Feb 10, 2025
bluetech pushed a commit that referenced this pull request Feb 10, 2025
This update addresses two common pain points when developing on GitHub.com's browser editor:

Delayed CI Testing: Small changes often accumulate, causing the CI to wait for all previous commits before testing your current commit. This delay can be inefficient. Suggestion: Cancel previous CI runs when pushing new commits to speed up the feedback loop.

Lack of Fix Suggestions for ruff Issues: When ruff flags an issue, it highlights the problematic code block but doesn't suggest how to fix it. By adding the --diff option, you can see the differences and get guidance on correcting the issue.

All this came about while working on #1170
Copy link
Member

@bluetech bluetech left a comment

Choose a reason for hiding this comment

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

Looks good, thanks!

@bluetech bluetech merged commit 0ee43ef into pytest-dev:main Feb 10, 2025
19 checks passed
@kingbuzzman kingbuzzman deleted the patch-1 branch February 10, 2025 12:57
@kingbuzzman
Copy link
Member Author

@bluetech thank you! Any idea when this will be released?

@bluetech
Copy link
Member

Soon!

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.

3 participants