Add regression test for generated package data#432
Conversation
712325c to
ccfed73
Compare
a285ab3 to
db634fb
Compare
pyproject.toml
Outdated
| "tests", | ||
| [tool.mypy] | ||
| exclude = [ | ||
| 'tests\/data\/test_package_generation\/src\/cookiecutter_test\/__init__\.py', |
There was a problem hiding this comment.
Can someone work out how I can get this to work? mypy doesn't seem to be ignoring the file 😢
There was a problem hiding this comment.
So I encountered this problem yesterday (along with @alessandrofelder) python/mypy#17977. It's not ideal, but maybe we just exclude from pre-commit?
paddyroddy
left a comment
There was a problem hiding this comment.
Are we sure we want this? Every time there's a new change, this test will have to be updated.
See #329 for context and motivation. Definitely appreciate that this adds a bit more work when changing anything in the template, but I think it's worth it to catch potential errors such as in #309 which slipped through the PR author and reviewer. I've tried to make the loop here as simple as possible:
|
70617fa to
6279aff
Compare
|
Sigh, putting this back as draft until I can fix the test |
698df36 to
882c939
Compare
Fix test data [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci Fix toml sorting
c23a657 to
b2ecc8e
Compare
|
The tests are failing again @dstansby. |
paddyroddy
left a comment
There was a problem hiding this comment.
I've fixed this @dstansby. Will approve and merge now so it doesn't need fixing again.

This adds a regression test for generated pacakge data. The test folder now has a data folder inside it which contains a reference copy of the generated package. This is then compared at test time to a newly generated package. Any differences are shown after the failing test with a diff that looks like:
To update the test files with an intentional change, when the test fails the test data is updated with the changes that can then be easily comitted (if desired).
Fixes #329