run locust 1.0.1 directly from .py file
See original GitHub issueAnyway I run locust 1.0.1 directly from .py file? test.py
class MainTaskSet(TaskSet):
@task
...
class WebsiteUser(FastHttpUser):
tasks = [MainTaskSet]
if __name__ == '__main__':
from locust.main import main
main()
It used to work, but with 1.0.1 I got: ./test.py Could not find any locustfile! Ensure file ends in ‘.py’ and see --help for available options.
One way is to set env. var with current file name in if __name__ == '__main__'
block.
Another is to run it as library.
Is there is an easier way to do it? It’s somewhat related to run/debug from locustfile from vscode also…
Issue Analytics
- State:
- Created 3 years ago
- Comments:8
Top Results From Across the Web
Quick start — Locust 1.0.1 documentation
The locustfile.py is a normal Python file that will get imported by Locust. Within it you can import modules just as you would...
Read more >Quick start — Locust 1.0.2 documentation
To run Locust distributed across multiple Python processes or machines, you can start a single Locust master process with the --master command line...
Read more >Installation — Locust 1.0.1 documentation
Once Locust is installed, a locust command should be available in your shell. (if you're not using virtualenv—which you should—make sure your python...
Read more >Getting started — Locust 2.14.0 documentation
To run Locust distributed across multiple Python processes or machines, you start a single Locust master process with the --master command line parameter,...
Read more >Running Locust without the web UI — Locust 1.1 documentation
locust -f locust_files/my_locust_file.py --headless -u 1000 -r 100 ... By default, locust will stop your tasks immediately. If you want to allow your...
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
I have it already. Just missing the old way I used to run it, that’s all. BTW: It was a suggestion only, don’t take it personal, please! 😃
I wasn’t taking it personally, sorry if I made it sound like I did 😃