Skip to content

Test template via pytest #548

Description

@alexdewar

Testing that the template actually works is currently a bit of a pain and has to be done manually. You have to run cookiecutter manually, then do whatever checks you want on top of the result (e.g. running pre-commit).

There are various checks we run as part of the CI workflow on templates generated with the different packaging options:

  • Run mypy
  • Run pytest
  • Run pre-commit
  • Run mkdocs build --strict
  • Run uv build

We could make each of these separate pytest tests, running each of the commands with subprocess.run. This would make it easier to test locally and would provide other benefits (e.g. easy parameterisation).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions