The pytest plugin for your copier templates 📒
Project description
Overview
pytest-copie 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. :ledger:
It is an adaptation of the pytest-cookies plugin for copier templates.
It’s here to help templates designers to check that everything works as expected on the generated files including (but not limited to):
linting operations
testing operations
packaging operations
documentation operations
…
Installation
pytest-copie is available on PyPI and can be installed with pip:
pip install pytest-copie
Usage
The copie fixture will allow you to copy a template and run tests against it. It will also clean up the generated project after the tests have been run.
def test_template(copie):
res = copie.copy(extra_answers={"repo_name": "helloworld"})
assert res.exit_code == 0
assert res.exception is None
assert result.project_dir.is_dir()
Context and template location can be fully customized, see our documentation for more details.
Credits
This package was created with Copier and the @12rambau/pypackage 0.1.11 project template.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pytest_copie-0.2.0.tar.gz
.
File metadata
- Download URL: pytest_copie-0.2.0.tar.gz
- Upload date:
- Size: 21.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.10.14
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 12f002e2f40ecc00062b3aa3099e0c665df6fd3711284bad9605dbfead0f0e63 |
|
MD5 | 1c55cf4fb2e02057ada437a2c11d526b |
|
BLAKE2b-256 | 53dffdc41a85adf7168128cff0147a4429fa8ae8645ca74a0040cf1c7691bfd6 |
File details
Details for the file pytest_copie-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: pytest_copie-0.2.0-py3-none-any.whl
- Upload date:
- Size: 7.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.10.14
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 374538b5d602093c10c0c904bc7f6d6ae77ca00f4158364c894a549a2265772e |
|
MD5 | bb1ddb40e962ed2481237eacb4161c01 |
|
BLAKE2b-256 | 5c63aa3e90377211890ccbd2ea3adab27f1b5924dec1812d1dbf1f183918cbd6 |