From edf043c89b961b05f6e2f8a24f167958bb5b2708 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Mon, 16 Jul 2018 15:22:56 +0930 Subject: [PATCH] pytest: make utils.py read config.vars. I could not figure out why test_announce_address suddenly stopped working: I had previously been using DEVELOPER=1 on the cmdline for historical reasons when testing locally. Signed-off-by: Rusty Russell --- tests/utils.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/utils.py b/tests/utils.py index eac280c4c..0aab9f924 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -27,7 +27,10 @@ LIGHTNINGD_CONFIG = { 'disable-dns': None, } -DEVELOPER = os.getenv("DEVELOPER", "0") == "1" +with open('config.vars') as configfile: + config = dict([(line.rstrip().split('=', 1)) for line in configfile]) + +DEVELOPER = os.getenv("DEVELOPER", config['DEVELOPER']) == "1" TIMEOUT = int(os.getenv("TIMEOUT", "60"))