Skip to content

assertNumQueries analogue #187

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

Closed
l0kix2 opened this issue Dec 1, 2014 · 5 comments
Closed

assertNumQueries analogue #187

l0kix2 opened this issue Dec 1, 2014 · 5 comments

Comments

@l0kix2
Copy link

l0kix2 commented Dec 1, 2014

In Django TransactionTestCase we have useful method assertNumQueries https://docs.djangoproject.com/en/1.7/topics/testing/tools/#django.test.TransactionTestCase.assertNumQueries.
Can we do something like that in pytest-django or maybe it is somewhere and i missed it?

@blueyed
Copy link
Contributor

blueyed commented Dec 1, 2014

Does #97 help you here?

@pelme
Copy link
Member

pelme commented Jan 2, 2015

#97 should solve this. I have a hack that I use internally that you might find useful in the meantime:
https://gist.github.com/pelme/58d5f67cbb35b34e3c20

@pelme
Copy link
Member

pelme commented Mar 29, 2015

Closing this issue since it is covered in #97.

@pelme pelme closed this as completed Mar 29, 2015
@l0kix2
Copy link
Author

l0kix2 commented Jun 21, 2017

Didn't understand #97 solution and where it was described, but thanks for snippet.

@blueyed
Copy link
Contributor

blueyed commented Jun 21, 2017

@l0kix2
It points to the WIP at #232.

But regarding this issue, it is available as a django_assert_num_queries fixture (via #387).
It has not been released yet though.

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

3 participants