@pytest.fixture(scope='session')
def cli_runner():
 runner = CliRunner()
 def cli_main(*cli_args):
  'Run cookiecutter cli main with the given args.'
  return runner.invoke(main, cli_args)
 return cli_main

@ pytest . fixture ( scope = 'session' ) def cli_runner ( ) : runner = CliRunner ( ) def cli_main ( * cli_args ) : return runner . invoke ( main , cli_args ) return cli_main
fixture that returns a helper function to run the cookiecutter cli .