Simon Willison’s Weblog

Subscribe

Wednesday, 27th January 2021

TIL Testing cookiecutter templates with pytest — I added some unit tests to my [datasette-plugin](https://github.com/simonw/datasette-plugin) cookiecutter template today, since the latest features involved adding a `hooks/post_gen_project.py` script.
TIL Conditionally creating directories in cookiecutter — I wanted my [datasette-plugin](https://github.com/simonw/datasette-plugin) cookiecutter template to create empty `static` and `templates` directories if the user replied `y` to the `include_static_directory` and `include_templates_directory` prompts.