-
Notifications
You must be signed in to change notification settings - Fork 345
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
Add django_debug_sql ini option #725
base: main
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## master #725 +/- ##
==========================================
+ Coverage 97.06% 97.93% +0.87%
==========================================
Files 32 33 +1
Lines 2009 1891 -118
Branches 153 150 -3
==========================================
- Hits 1950 1852 -98
+ Misses 43 26 -17
+ Partials 16 13 -3
Continue to review full report at Codecov.
|
TODO: - [ ] doc - [ ] use a command line option instead? I've thought about having a fixture also, but it would require to set "force_debug_cursor" on the connections then, and it probably not useful; typically you want to use this for a short time only - therefore a command line option might be better suited also (but you can use `-o django_debug_sql = 1`). And on the other hand, it will only show up on failures, and is therefore maybe good to set it in general.
I'd really like to see this baked into pytest-django! I hadn't seen this PR, but I'm currently using it through conftest.py like this |
This would indeed be very handy. Thanks for the workaround @fopina |
TODO:
I've thought about having a fixture also, but it would require to set
"force_debug_cursor" on the connections then, and it probably not
useful; typically you want to use this for a short time only - therefore
a command line option might be better suited also (but you can use
-o django_debug_sql = 1
). And on the other hand, it will only show up onfailures, and is therefore maybe good to set it in general.