Skip to content

Commit 10fcecd

Browse files
committed
fix: revise tests
1 parent 659820c commit 10fcecd

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

templateflow/conf/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def _env_to_bool(envvar: str, default: bool) -> bool:
3535

3636

3737
TF_DEFAULT_HOME = Path.home() / '.cache' / 'templateflow'
38-
TF_HOME = Path(getenv('TEMPLATEFLOW_HOME', str(TF_DEFAULT_HOME)))
38+
TF_HOME = Path(getenv('TEMPLATEFLOW_HOME', str(TF_DEFAULT_HOME))).absolute()
3939
TF_GITHUB_SOURCE = 'https://github.com/templateflow/templateflow.git'
4040
TF_S3_ROOT = 'https://templateflow.s3.amazonaws.com'
4141
TF_USE_DATALAD = _env_to_bool('TEMPLATEFLOW_USE_DATALAD', False)

templateflow/conf/tests/test_conf.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,16 @@ def test_conf_init(monkeypatch, tmp_path, use_datalad):
5858
@pytest.mark.parametrize('use_datalad', ['off', 'on'])
5959
def test_setup_home(monkeypatch, tmp_path, capfd, use_datalad):
6060
"""Check the correct functioning of the installation hook."""
61-
home = (tmp_path / f'setup-home-{use_datalad}').resolve()
61+
home = (tmp_path / f'setup-home-{use_datalad}').absolute()
6262
monkeypatch.setenv('TEMPLATEFLOW_USE_DATALAD', use_datalad)
6363
monkeypatch.setenv('TEMPLATEFLOW_HOME', str(home))
6464

6565
with capfd.disabled():
6666
reload(tfc)
67+
68+
# Ensure mocks are up-to-date
69+
assert tfc.TF_USE_DATALAD is (use_datalad == 'on')
70+
assert str(tfc.TF_HOME) == str(home)
6771
# First execution, the S3 stub is created (or datalad install)
6872
assert tfc.TF_CACHED is False
6973
assert tfc.setup_home() is False

0 commit comments

Comments
 (0)