Locust: Test file can not be named locust.py (or any other name that is the same as an existing python package)

Created on 4 Apr 2014  ·  10Comments  ·  Source: locustio/locust

Thanks for writing the locust test tool. It's very interesting!

I follow the instruction on http://locust.io/, first I installed

pip install locustio
pip install pyzmq

Then I copied and pasted the sample "Simple example" to locust.py in my local directory and run it against a server listening on another PC (10.3.0.3) as the following but got error:

 locust -f locust.py -H http://10.3.0.3
[2014-04-04 12:03:28,901] john-HP/ERROR/locust.main: No Locust class found!

Not sure what have gone wrong.

Thanks.

bug

Most helpful comment

I have the error no matter what my file is named. ?

All 10 comments

Hi!

I believe you got this error because your locust test file is named locust.py. I just tested this and got the same error.

I'm marking this issue as a bug, and changing the name of it. In the meanwhile you can get it working by just renaming your test file (for example to locustfile.py).

Thanks for the report!

Thanks Jonatan, it works now. Glad I stumbled upon a bug.

Great! I'll re-open this issue and use it to track the bug :).

Sure. Sorry, I shouldn't try to close it.

I got the same error when having file name as locust.py.

+1 :)

I have the error no matter what my file is named. ?

where is full path of this in windows

Hi,
got the same error, tried to rename the locust but the error still apears. Note: I'm running it from ubuntu VM. Do you have any advices?

The problema here is that the error is not clear. I think you can improve error message if locust file is named locust.py.

Was this page helpful?
0 / 5 - 0 ratings