mirror of
https://github.com/jupyterhub/the-littlest-jupyterhub.git
synced 2025-12-18 21:54:05 +08:00
move tljh_dir fixture to conftest
so it can be used everywhere
This commit is contained in:
@@ -2,7 +2,6 @@
|
||||
Test configuration commandline tools
|
||||
"""
|
||||
|
||||
from importlib import reload
|
||||
import os
|
||||
import tempfile
|
||||
from unittest import mock
|
||||
@@ -12,21 +11,6 @@ import pytest
|
||||
from tljh import config, configurer
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def tljh_dir(tmpdir):
|
||||
"""Fixture for setting up a temporary tljh dir"""
|
||||
tljh_dir = str(tmpdir.join("tljh").mkdir())
|
||||
with mock.patch.dict(
|
||||
os.environ,
|
||||
{"TLJH_INSTALL_PREFIX": tljh_dir}
|
||||
):
|
||||
reload(config)
|
||||
reload(configurer)
|
||||
assert config.INSTALL_PREFIX == tljh_dir
|
||||
os.makedirs(config.STATE_DIR)
|
||||
yield tljh_dir
|
||||
|
||||
|
||||
def test_set_no_mutate():
|
||||
conf = {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user