Skip to main content

The pytest plugin for your copier templates 📒

Project description

License: MIT conventional commit ruff badge prettier badge pre-commit PyPI version build Test Coverage Documentation Status Conda

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.16 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

pytest_copie-0.3.1.tar.gz (25.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pytest_copie-0.3.1-py3-none-any.whl (8.9 kB view details)

Uploaded Python 3

File details

Details for the file pytest_copie-0.3.1.tar.gz.

File metadata

  • Download URL: pytest_copie-0.3.1.tar.gz
  • Upload date:
  • Size: 25.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.11

File hashes

Hashes for pytest_copie-0.3.1.tar.gz
Algorithm Hash digest
SHA256 7120c87bbe7489cb1a6bfcef154135cdf48b61ed8e8fb9035c788a40209f344a
MD5 9a5298b8f3c3caac5345c5a196f9f722
BLAKE2b-256 c6203722677a1d5364b4dd913dd0380fa437694b481feb1a1beab8b4ced7c793

See more details on using hashes here.

File details

Details for the file pytest_copie-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: pytest_copie-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 8.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.11

File hashes

Hashes for pytest_copie-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6669f5ce3e1e15a7c62b09519b07075611e7e06ee5474e20424a6d7fa975194c
MD5 d968265ebb8088896eb096b5286efcee
BLAKE2b-256 257a5096d153d08a47392cad8bad8b43cfdd5eee21c3a7f3021cf70cd311814b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page