Skip to content
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

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

Closed
user1020 opened this issue Apr 4, 2014 · 10 comments · Fixed by #546
Labels

Comments

@user1020
Copy link

user1020 commented Apr 4, 2014

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.

@heyman
Copy link
Member

heyman commented Apr 6, 2014

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!

@heyman heyman added the bug label Apr 6, 2014
@heyman heyman changed the title Problem with running Locust Test file can not be named locust.py (or any other name that is the same as an existing python package) Apr 6, 2014
@user1020
Copy link
Author

user1020 commented Apr 6, 2014

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

@user1020 user1020 closed this as completed Apr 6, 2014
@heyman
Copy link
Member

heyman commented Apr 6, 2014

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

@heyman heyman reopened this Apr 6, 2014
@user1020
Copy link
Author

user1020 commented Apr 6, 2014

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

@tmkasun
Copy link

tmkasun commented Mar 2, 2016

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

@djonsson
Copy link

djonsson commented Mar 2, 2016

+1 :)

@bgenchel
Copy link

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

@junaidimadsah
Copy link

where is full path of this in windows

@nmelnic
Copy link

nmelnic commented Aug 24, 2016

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?

@tarsisazevedo
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants