def METHOD_NAME(self):
    """
    If the return code from execute is non-zero and log_errors is
    True, log an error message.
    """
    repo = VCSRepository.for_type(Repository.Type.GIT, "/path")
    with patch("pontoon.sync.vcs.repositories.execute") as mock_execute, patch(
        "pontoon.sync.vcs.repositories.log"
    ) as mock_log:
        mock_execute.return_value = 1, "output", "stderr"
        assert repo.execute("command", cwd="working_dir", log_errors=True) == (
            1,
            "output",
            "stderr",
        )
        mock_log.error.assert_called_with(
            CONTAINS("stderr", "command", "working_dir")
        )