diff --git a/docs/development.md b/docs/development.md index 2fb5bedc..ef6b385e 100644 --- a/docs/development.md +++ b/docs/development.md @@ -12,12 +12,12 @@ Then install all dependencies: $ pip install -r requirements-dev.txt ``` -Now you can use `httprunner/cli.py` as debugging entrances. +Now you can use `main-debug.py` as debugging entrances. ```bash # debug hrun -$ python httprunner/cli.py hrun -h +$ python main-debug.py hrun -h # debug locusts -$ python httprunner/cli.py locusts -h +$ python main-debug.py locusts -h ``` diff --git a/httprunner/cli.py b/httprunner/cli.py index 3239ce96..b07374c6 100644 --- a/httprunner/cli.py +++ b/httprunner/cli.py @@ -143,12 +143,3 @@ def main_locust(): locusts.run_locusts_on_cpu_cores(sys.argv, cpu_cores_num_value) else: locusts.main() - - -if __name__ == '__main__': - cmd = sys.argv.pop(1) - - if cmd in ["hrun", "httprunner", "ate"]: - main_hrun() - elif cmd in ["locust", "locusts"]: - main_locust() diff --git a/main-debug.py b/main-debug.py new file mode 100644 index 00000000..b7aae0f0 --- /dev/null +++ b/main-debug.py @@ -0,0 +1,10 @@ +import sys + +from httprunner.cli import main_hrun, main_locust + +cmd = sys.argv.pop(1) + +if cmd in ["hrun", "httprunner", "ate"]: + main_hrun() +elif cmd in ["locust", "locusts"]: + main_locust()