-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Question: debugging in pycharm (or other arbitrary IDE) #613
Comments
not really an answer, but a few comments:
a
add code so your |
Took me a minute to get there (specifically to realize I had to call I create a subclass of HttpLocust called WebsiteUser. To execute a single instance from the CLI, I added:
Then run
|
Here I managed to get Intellij Idea (Similar to PyCharm) to break while I used It should break automatically right under the following line (I think break point is optional): pydevd.settrace('localhost', port=12345, stdoutToServer=True, stderrToServer=True) 👍 |
This seems to work for me. Also, note that the remote debug suggestion above requires a paid version of PyCharm or its cousin of a plugin in IntelliJ. I think the steps I have above will work for PyCharm CE as well. |
is there a similar tip for visual studio code ? |
just to add to what @nelsonjchen has stated, for IntelliJ set the "Script path" to what |
This is what I put in my
You can parameters to the |
Debug doesn't work in locust >= 1.2.3 |
In locust-plugins you can find debug example: |
I use Eclipse with Pydev. In Preferences->PyDev->Debug the 2nd to last option is "Gevent compatible debugging?". Gevent has to do with the lightweight threading used by Locust ( greenlets ) and I am too ignorant to know much more than that. Once I clicked that, I was able to stop at a breakpoint in my code. Thanks to all who provided the information and the person who wrote the Single User locust-plugin. |
I was able to develop, run and debug using the "Library" mode. |
Thanks, worked like a charm. Before I enabled this setting, the debugger would seem to "hang" and would never reach a breakpoint. For all those interested this is where you can enable the gevent compatible option in the debugger in PyCharm, |
Hello, 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?
The text was updated successfully, but these errors were encountered: