Skip to content

Commit

Permalink
Import TLJH only when needed in conftest.py
Browse files Browse the repository at this point in the history
  • Loading branch information
yuvipanda committed Oct 31, 2018
1 parent 25c4688 commit eb575b4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@

import pytest

import tljh


@pytest.fixture
def tljh_dir(tmpdir):
"""Fixture for setting up a temporary tljh dir"""
# Import TLJH only when needed. This lets us run tests in places
# where TLJH is not installed - particularly, the 'distro check' test.
import tljh

tljh_dir = str(tmpdir.join("tljh").mkdir())
with mock.patch.dict(os.environ, {"TLJH_INSTALL_PREFIX": tljh_dir}):
reload(tljh)
Expand Down

0 comments on commit eb575b4

Please sign in to comment.