From 9c28a6ff4a75e2adbac9b185d5a826baaab9e13b Mon Sep 17 00:00:00 2001 From: Meng Xiangzhuo Date: Thu, 3 Oct 2024 12:07:03 +0800 Subject: [PATCH] Add test --- tests/commands/test_startup_time.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 tests/commands/test_startup_time.py diff --git a/tests/commands/test_startup_time.py b/tests/commands/test_startup_time.py new file mode 100644 index 000000000..6ffaa51c6 --- /dev/null +++ b/tests/commands/test_startup_time.py @@ -0,0 +1,14 @@ +import subprocess +import time + + +MAXIMUM_STARTUP_TIME = 0.5 + + +def test_startup_time(): + start = time.time() + subprocess.run(["freqtrade", "-h"]) + elapsed = time.time() - start + assert ( + elapsed < MAXIMUM_STARTUP_TIME + ), "The startup time is too long, try to use lazy import in the command entry function"