Files
dvc/tests/unit/test_analytics.py
T
Ruslan Kuprieiev 910a67b35f analytics: don't verify config from repo
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.
2019-11-08 02:37:11 +02:00

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()