Question: debugging in pycharm (or other arbitrary IDE)
See original GitHub issueHello, so quick question. I have locust installed in a venv on python 3 (locustio==0.8a2). I’ve been building and testing a locust python script, but I’m trying to traverse some complicated json responses. In order to run a locust script, you have to run locust loadtest-file.py
Is it possible to attach a debugger while running a locust script?
Issue Analytics
- State:
- Created 6 years ago
- Comments:12 (1 by maintainers)
Top Results From Across the Web
Step 2. Debug your first Python application - PyCharm
Debugging in detail The Debug tool window shows dedicated panes for frames, variables, and watches, and the console, where all the input and...
Read more >Run/debug configurations | PyCharm Documentation - JetBrains
Learn how to use run configurations to run/debug your code in PyCharm with various startup properties.
Read more >Debug | PyCharm Documentation - JetBrains
How to configure the debugger settings. Learn more about launching, pausing and stopping a debugging session, and stepping through the program.
Read more >Get started | PyCharm Documentation - JetBrains
To start debugging your application, press Shift+F9 . Then go through the program execution step by step (see the available options in the...
Read more >Debugging During Testing - PyCharm Guide - JetBrains
When writing tests, use the PyCharm "visual debugger" to interactively poke around in the context of a problem.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Took me a minute to get there (specifically to realize I had to call
.run()
) so I figured I’d share:I create a subclass of HttpLocust called WebsiteUser. To execute a single instance from the CLI, I added:
Then run
python locustfily.py
. If I have apdb
breakpoint in one of my tasks, this triggers the breakpoint. Full examplelocustfile.py
:Here I managed to get Intellij Idea (Similar to PyCharm) to break while
locust
is running.I used
python remote debug
run configuration, followed instructions. In my case, I just used a virtualenv and installedlocustio
andpydevd
directly. 🎉It should break automatically right under the following line (I think break point is optional):
👍