def test_prompt_should_ask_and_keep_repo_dir(mocker, tmpdir):
 mock_read_user = mocker.patch('cookiecutter.vcs.read_user_yes_no', return_value=False, autospec=True)
 repo_dir = tmpdir.mkdir('repo')
 with pytest.raises(SystemExit):
  vcs.prompt_and_delete_repo(str(repo_dir))
 assert mock_read_user.called
 assert repo_dir.exists()

def test_prompt_should_ask_and_keep_repo_dir ( mocker , tmpdir ) : mock_read_user = mocker . patch ( 'cookiecutter.vcs.read_user_yes_no' , return_value = False , autospec = True ) repo_dir = tmpdir . mkdir ( 'repo' ) with pytest . raises ( SystemExit ) : vcs . prompt_and_delete_repo ( str ( repo_dir ) ) assert mock_read_user . called assert repo_dir . exists ( )
in prompt_and_delete_repo() .