pytest-django-queries
pytest-django-queries copied to clipboard
Add an option for counting queries on all tests
Is your feature request related to a problem? Please describe. Some users might want to count queries on all their tests without implementing new test cases for checks. So we could include an option for that.
Describe the solution you'd like
We could put a option --queries-count-all or such.
Describe alternatives you've considered None.
Additional context None.
Hi @NyanKiyoshi , I'm interested on this feature. Can I help? Do you have planned something?
Hey, sure you can help if you have time to do so!
I would assume the flow could be something like so:
- Add a new option in https://github.com/NyanKiyoshi/pytest-django-queries/blob/9c2f87106cb8f2a86b6b2bfca19dbe5f9696984b/pytest_django_queries/plugin.py#L77-L95 (dest could be
count_all_tests) - Then in that fixture we could do a check whether
request.config.count_all_testsis set toTrue: https://github.com/NyanKiyoshi/pytest-django-queries/blob/9c2f87106cb8f2a86b6b2bfca19dbe5f9696984b/pytest_django_queries/plugin.py#L128-L141