def test_is_enabled(dvc_repo, config, result, monkeypatch): configobj = dvc_repo.config._repo_config configobj["core"] = config configobj.write() # reset DVC_TEST env var, which affects `is_enabled()` monkeypatch.delenv("DVC_TEST") assert result == Analytics.is_enabled()
def _welcome_message(): if Analytics.is_enabled(): logger.info( boxify( "DVC has enabled anonymous aggregate usage analytics.\n" "Read the analytics documentation (and how to opt-out) here:\n" "{blue}https://dvc.org/doc/user-guide/analytics{nc}".format( blue=colorama.Fore.BLUE, nc=colorama.Fore.RESET), border_color="red", )) msg = ("{yellow}What's next?{nc}\n" "{yellow}------------{nc}\n" "- Check out the documentation: {blue}https://dvc.org/doc{nc}\n" "- Get help and share ideas: {blue}https://dvc.org/chat{nc}\n" "- Star us on GitHub: {blue}https://github.com/iterative/dvc{nc}" ).format( yellow=colorama.Fore.YELLOW, blue=colorama.Fore.BLUE, nc=colorama.Fore.RESET, ) logger.info(msg)