how to stop the debugger from using pytest by default
Answered
Is there a way to stop pycharm from using pytest when debugging a file which has a function that starts with "test..."?
By default, when debugging any python file that contains a function that starts with "test", pycharm uses pytest for debugging which might not be wanted. Is there any way to change this behavior? For example if one would like to use the normal debugger mode, also for files with test functions?
Please sign in to leave a comment.
You can change the test runner in Settings/Preferences | Tools | Python Integrated Tools to, for example, Unittests.
You can also create a Python run configuration manually (Run | Edit Configurations...)
Hi Sergey Karpov, thanks for your answer! What I would like, is to use the normal project interpreter, that would be used for any normal python file that does not start with "test". I don't see this option in Settings/Preferences | Tools | Python Integrated Tools.
In fact, I would like not testing to be done automatically when running those files, is this possible?
Having to create a new configuration each time is really bothersome.
I have functions like test_... , and suddenly when I right-click run or debug, I only have options "python test ...". WHY? Your suggestion to create configuration manually EVERY time is not productive. Now I need to remember not to have functions starting with test_... or I cannot run that file as a normal python script. Please stop enforcing your idiosyncratic views on the rest of the coding community. Written out of frustration working with pycharm (soo many examples of poor UX).
Jc138691 I agree with every word!
At the very least add an option for a regular debugging on the right click.
+1 Its very annoying that Debug leads to "Debug Python test in …". The happens not only for files with test_ in the name, but also with files contains functions with the name "test_*"
I shouldn't have to the edit global settings or add a new run configuration to just run a file in the debugger just because I added a function called test_something.