Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a unit test suite #19

Closed
freakboy3742 opened this issue May 23, 2020 · 2 comments
Closed

Add a unit test suite #19

freakboy3742 opened this issue May 23, 2020 · 2 comments
Labels
enhancement New features, or improvements to existing features.

Comments

@freakboy3742
Copy link
Member

#18 fixed a problem with the generated pyproject.toml that was inadvertently introduced when Docker support was added to the template. This fix wouldn't have been needed at all if there was basic pre-merge testing, implemented as a unit test suite.

We should add unit tests template itself. Cookiecutter can be invoked programmatically; so we can run the template with a fixed context and check key properties of the output, like:

  • Can pyproject.toml be parsed without error?
  • Can app.py be compiled without a syntax error? (we don't have to run it - we can use py_compile to compile the code to detect errors)
  • Does flake8 raise any errors on the generated code?

This should be a pytest suite, wrapped with a tox configuration. There should also be a Github Actions configuration that invokes the test suite on every PR. The CI configuration for Briefcase will serve as a starting point for this test setup.

@freakboy3742 freakboy3742 added enhancement New features, or improvements to existing features. up-for-grabs labels May 23, 2020
@GenevieveBuckley
Copy link
Contributor

The Driven Data cookicutter for data science has a reasonably extensive test suite, which I found useful to look at. The repository is at: https://github.com/drivendata/cookiecutter-data-science

@freakboy3742
Copy link
Member Author

Fixed by #21.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New features, or improvements to existing features.
Projects
None yet
Development

No branches or pull requests

2 participants