From 651a8e4ae00a9a69c11c67882e8a464777255b4c Mon Sep 17 00:00:00 2001 From: lan Date: Tue, 18 Jan 2022 17:33:51 +0800 Subject: [PATCH] .env file ignore blank lines and comments --- httprunner/loader.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/httprunner/loader.py b/httprunner/loader.py index 74cacad6..5b4bc6e4 100644 --- a/httprunner/loader.py +++ b/httprunner/loader.py @@ -130,6 +130,9 @@ def load_dot_env_file(dot_env_path: Text) -> Dict: with open(dot_env_path, mode="rb") as fp: for line in fp: # maxsplit=1 + line = line.strip() + if not len(line) or line.startswith(b"#"): + continue if b"=" in line: variable, value = line.split(b"=", 1) elif b":" in line: