mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-08 23:09:48 +01:00
Otherwise this will raise an exception from analytics worker: ``` dvc config cache.type sometypo ``` But running that same command with `--system` or `--global` flag outside of repo won't raise that. Also need to better handle ConfigObjError, but that is a separate issue.
15 lines
417 B
Python
15 lines
417 B
Python
from dvc.analytics import Analytics
|
|
from dvc.config import Config
|
|
from dvc.repo import NotDvcRepoError
|
|
|
|
|
|
def test_broken_config(mocker, dvc_repo):
|
|
Config(dvc_repo.dvc_dir, validate=False).set("cache", "type", "unknown")
|
|
|
|
assert Analytics._get_current_config()
|
|
|
|
with mocker.patch(
|
|
"dvc.repo.Repo.find_dvc_dir", side_effect=NotDvcRepoError(".")
|
|
):
|
|
assert Analytics._get_current_config()
|