pytest: Better dealing with env variables to configure tests

This commit is contained in:
Christian Decker 2017-05-02 14:32:12 +02:00 committed by Rusty Russell
parent db84525b67
commit 23da30a2a4
1 changed files with 5 additions and 2 deletions

View File

@ -15,9 +15,12 @@ import utils
bitcoind = None
TEST_DIR = tempfile.mkdtemp(prefix='lightning-')
VALGRIND = os.getenv("NOVALGRIND", None) == None
VALGRIND = os.getenv("NOVALGRIND", "0") == "0"
TEST_DEBUG = os.getenv("TEST_DEBUG", "0") == "1"
if os.getenv("TEST_DEBUG", None) != None:
print("Testing results are in {}".format(TEST_DIR))
if TEST_DEBUG:
logging.basicConfig(level=logging.DEBUG, stream=sys.stdout)
logging.info("Tests running in '%s'", TEST_DIR)