From b644599af838212c2ca02242bf1ef23ca10d5263 Mon Sep 17 00:00:00 2001 From: yuvipanda Date: Wed, 31 Oct 2018 10:25:29 -0700 Subject: [PATCH] Import TLJH only when needed in conftest.py --- integration-tests/conftest.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/integration-tests/conftest.py b/integration-tests/conftest.py index ee0ebbd..82dd70e 100644 --- a/integration-tests/conftest.py +++ b/integration-tests/conftest.py @@ -4,12 +4,14 @@ import os from pytest import fixture -from tljh.config import CONFIG_FILE, reload_component @fixture def preserve_config(request): """Fixture to save and restore config around tests""" + # Import TLJH only when needed. This lets us run tests in places + # where TLJH is not installed - particularly, the 'distro check' test. + from tljh.config import CONFIG_FILE, reload_component if os.path.exists(CONFIG_FILE): with open(CONFIG_FILE) as f: save_config = f.read()