3👍
Run python normally but use pdb on your code. Something like this:
... code before ...
import pdb; pdb.set_trace()
... code after ...
It will stop the code on that point. You will need to press c (continue), q (quit) or n (next) in order to keep going. You can test expressions and check where are you by pressing l.
The code will go probably faster, but debugging can be more painful.
1👍
I had the same problem a while ago until I figured out, Django and PyCharm allow you to specify to run single tests and not the complete test suite everytime I press the debug-button.
In order to do this, simply edit your Debug configuration in PyCharm. Change your target
to point a module, a class or even a method somewhere deep down in your test files.
In order to do this, ensure your directories are modules (e.g. a directory which has a __init__.py file in it). You’re now able to point specific targets in the following format:
django_app.tests_module.test_case.test_method
It is clear that the final target “path” depends on your project’s organzation.
Don’t forget to change the target back once you’re done implementing in order to run all the tests before pushing your code 😉