pytest plugin for versionned templates #1324
12rambau
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I recently started the crusade of moving my pypackage template from cookiecutter to copier. I was very much interested in the
update
feature which will help a lot to maintain all my libs as consistent as possible. My problem is that it's an heavy templates with lots of triggers,{% raw %}
segments , nox sessions etc....In consequence I needed a tool to test the said template in a CI/CD pipeline and if possible do it using pyptest. So I came up with pytest-copie.
It is a pytest plugin that comes with a
copie
fixture which is a wrapper on top the copier API for generating projects. It helps you verify that your template is working as expected and takes care of cleaning up after running the tests. It’s here to help templates designers to check that everything works as expected on the generated filesIt is an adaptation of the pytest-cookies plugin for copier templates and is as simple to use as:
It's currently used here: https://github.com/12rambau/pypackage/blob/main/tests/test_build.py, but I'm sure I'm missing some copier tricks and important features so if you are interested, please have a look and open an issue !
Beta Was this translation helpful? Give feedback.
All reactions