Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating django to 4.2.1 makes django_assert_num_queries not see queries #1068

Closed
MuslimBeibytuly opened this issue May 31, 2023 · 1 comment

Comments

@MuslimBeibytuly
Copy link

docker image: python:3.11.2-slim
django==4.2.1
pytest-django==4.5.2
    with django_assert_num_queries(num=1):
        response = authenticated_client.get(
            path='/api/endpoint_name/',
        )

shows:
Failed: Expected to perform 1 queries but 0 were done
while endpoint has 1 query, it was shown using django 4.2 version

@elnygren
Copy link

Still broken with:

platform darwin -- Python 3.11.1, pytest-7.4.0, pluggy-1.3.0
plugins: anyio-4.0.0, xdist-3.3.1, kolo-2.14.0, django-4.5.2, Faker-19.3.1

and

django==4.2.5

when using python-xdist (pytest -n2 pat/to/test).

The behavior is flaky, sometimes the test passes, sometimes not. I can see the SQL queries in the logs but django_assert_num_queries captures zero queries.

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

No branches or pull requests

2 participants