From 8fabae122413afbca6c9ade7a1e495a22c84f671 Mon Sep 17 00:00:00 2001 From: Corey Goldberg Date: Mon, 20 Feb 2017 11:01:42 -0500 Subject: [PATCH] Prohibits the locustfile from being named 'locust.py' --- locust/main.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/locust/main.py b/locust/main.py index 3b356f2faa..da2addea5c 100644 --- a/locust/main.py +++ b/locust/main.py @@ -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: