Skip to content
This repository has been archived by the owner on Jun 17, 2022. It is now read-only.

Commit

Permalink
Prohibits the locustfile from being named 'locust.py' (locustio#546)
Browse files Browse the repository at this point in the history
  • Loading branch information
cgoldberg authored and AngelosTheodosiadis committed Jan 10, 2020
1 parent fdfeb9b commit 7c2b02b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions locust/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,10 +350,15 @@ def main():
sys.exit(0)

locustfile = find_locustfile(options.locustfile)

if not locustfile:
logger.error("Could not find any locustfile! Ensure file ends in '.py' and see --help for available options.")
sys.exit(1)

if locustfile == "locust.py":
logger.error("The locustfile must not be named `locust.py`. Please rename the file and try again.")
sys.exit(1)

docstring, locusts = load_locustfile(locustfile)

if options.list_commands:
Expand Down

0 comments on commit 7c2b02b

Please sign in to comment.