mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-02 07:18:25 +01:00
tests: isolate dvc config and directories (#9450)
* tests: isolate dvc config and directories by introducing envvars to change default values. This lets pytest handle the deletion of tmpdirs, instead of filling /var/tmp with hundreds of thousands of directories. Also isolates test run from faulty global/system config files. * move to dvc/env and sort
This commit is contained in:
@@ -5,6 +5,7 @@ from contextlib import suppress
|
||||
|
||||
import pytest
|
||||
|
||||
from dvc import env
|
||||
from dvc.testing.fixtures import * # noqa, pylint: disable=wildcard-import
|
||||
|
||||
from .dir_helpers import * # noqa, pylint: disable=wildcard-import
|
||||
@@ -206,7 +207,13 @@ defaultBranch=master
|
||||
import pygit2
|
||||
|
||||
pygit2.settings.search_path[pygit2.GIT_CONFIG_LEVEL_GLOBAL] = str(home_dir)
|
||||
|
||||
monkeypatch.setenv(env.DVC_SYSTEM_CONFIG_DIR, os.fspath(path / "system"))
|
||||
monkeypatch.setenv(env.DVC_GLOBAL_CONFIG_DIR, os.fspath(path / "global"))
|
||||
monkeypatch.setenv(env.DVC_SITE_CACHE_DIR, os.fspath(path / "site_cache_dir"))
|
||||
|
||||
yield
|
||||
|
||||
monkeypatch.undo()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user