pytest-copie


Namepytest-copie JSON
Version 0.2.0 PyPI version JSON
download
home_pageNone
SummaryThe pytest plugin for your copier templates 📒
upload_time2024-06-26 11:48:26
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseMIT
keywords python copier pytest pytest-plugin
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
pytest-copie
============

.. image:: https://img.shields.io/badge/License-MIT-yellow.svg?logo=opensourceinitiative&logoColor=white
    :target: LICENSE
    :alt: License: MIT

.. image:: https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg?logo=git&logoColor=white
   :target: https://conventionalcommits.org
   :alt: conventional commit

.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
   :target: https://github.com/psf/black
   :alt: Black badge

.. image:: https://img.shields.io/badge/code_style-prettier-ff69b4.svg?logo=prettier&logoColor=white
   :target: https://github.com/prettier/prettier
   :alt: prettier badge

.. image:: https://img.shields.io/badge/pre--commit-active-yellow?logo=pre-commit&logoColor=white
    :target: https://pre-commit.com/
    :alt: pre-commit

.. image:: https://img.shields.io/pypi/v/pytest-copie?color=blue&logo=pypi&logoColor=white
    :target: https://pypi.org/project/pytest-copie/
    :alt: PyPI version

.. image:: https://img.shields.io/conda/v/conda-forge/pytest-copie?logo=condaforge&logoColor=white&color=blue
   :target: https://anaconda.org/conda-forge/pytest-copie
   :alt: Conda

.. image:: https://img.shields.io/github/actions/workflow/status/12rambau/pytest-copie/unit.yaml?logo=github&logoColor=white
    :target: https://github.com/12rambau/pytest-copie/actions/workflows/unit.yaml
    :alt: build

.. image:: https://img.shields.io/codecov/c/github/12rambau/pytest-copie?logo=codecov&logoColor=white
    :target: https://codecov.io/gh/12rambau/pytest-copie
    :alt: Test Coverage

.. image:: https://img.shields.io/readthedocs/pytest-copie?logo=readthedocs&logoColor=white
    :target: https://pytest-copie.readthedocs.io/en/latest/
    :alt: Documentation Status

Overview
--------

pytest-copie is a `pytest <https://github.com/pytest-dev/pytest>`__ plugin that comes with a ``copie`` fixture which is a wrapper on top the `copier <https://github.com/copier-org/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 <https://github.com/hackebrot/pytest-cookies>`__ plugin for `copier <https://github.com/copier-org/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 <https://pypi.org/project/pytest-copie/>`__ and can be installed with `pip <https://pip.pypa.io/en/stable/>`__:

.. code-block:: console

    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.

.. code-block:: python

    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 <https://pytest-copie.readthedocs.io>`__ for more details.

Credits
-------

This package was created with `Copier <https://copier.readthedocs.io/en/latest/>`__ and the `@12rambau/pypackage <https://github.com/12rambau/pypackage>`__ 0.1.11 project template.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "pytest-copie",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "Python, copier, pytest, pytest-plugin",
    "author": null,
    "author_email": "Pierrick Rambaud <pierrick.rambaud49@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/53/df/fdc41a85adf7168128cff0147a4429fa8ae8645ca74a0040cf1c7691bfd6/pytest_copie-0.2.0.tar.gz",
    "platform": null,
    "description": "\npytest-copie\n============\n\n.. image:: https://img.shields.io/badge/License-MIT-yellow.svg?logo=opensourceinitiative&logoColor=white\n    :target: LICENSE\n    :alt: License: MIT\n\n.. image:: https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg?logo=git&logoColor=white\n   :target: https://conventionalcommits.org\n   :alt: conventional commit\n\n.. image:: https://img.shields.io/badge/code%20style-black-000000.svg\n   :target: https://github.com/psf/black\n   :alt: Black badge\n\n.. image:: https://img.shields.io/badge/code_style-prettier-ff69b4.svg?logo=prettier&logoColor=white\n   :target: https://github.com/prettier/prettier\n   :alt: prettier badge\n\n.. image:: https://img.shields.io/badge/pre--commit-active-yellow?logo=pre-commit&logoColor=white\n    :target: https://pre-commit.com/\n    :alt: pre-commit\n\n.. image:: https://img.shields.io/pypi/v/pytest-copie?color=blue&logo=pypi&logoColor=white\n    :target: https://pypi.org/project/pytest-copie/\n    :alt: PyPI version\n\n.. image:: https://img.shields.io/conda/v/conda-forge/pytest-copie?logo=condaforge&logoColor=white&color=blue\n   :target: https://anaconda.org/conda-forge/pytest-copie\n   :alt: Conda\n\n.. image:: https://img.shields.io/github/actions/workflow/status/12rambau/pytest-copie/unit.yaml?logo=github&logoColor=white\n    :target: https://github.com/12rambau/pytest-copie/actions/workflows/unit.yaml\n    :alt: build\n\n.. image:: https://img.shields.io/codecov/c/github/12rambau/pytest-copie?logo=codecov&logoColor=white\n    :target: https://codecov.io/gh/12rambau/pytest-copie\n    :alt: Test Coverage\n\n.. image:: https://img.shields.io/readthedocs/pytest-copie?logo=readthedocs&logoColor=white\n    :target: https://pytest-copie.readthedocs.io/en/latest/\n    :alt: Documentation Status\n\nOverview\n--------\n\npytest-copie is a `pytest <https://github.com/pytest-dev/pytest>`__ plugin that comes with a ``copie`` fixture which is a wrapper on top the `copier <https://github.com/copier-org/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:\n\nIt is an adaptation of the `pytest-cookies <https://github.com/hackebrot/pytest-cookies>`__ plugin for `copier <https://github.com/copier-org/copier>`__ templates.\n\nIt\u2019s here to help templates designers to check that everything works as expected on the generated files including (but not limited to):\n\n-   linting operations\n-   testing operations\n-   packaging operations\n-   documentation operations\n-   \u2026\n\nInstallation\n------------\n\n**pytest-copie** is available on `PyPI <https://pypi.org/project/pytest-copie/>`__ and can be installed with `pip <https://pip.pypa.io/en/stable/>`__:\n\n.. code-block:: console\n\n    pip install pytest-copie\n\nUsage\n-----\n\nThe ``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.\n\n.. code-block:: python\n\n    def test_template(copie):\n        res = copie.copy(extra_answers={\"repo_name\": \"helloworld\"})\n\n        assert res.exit_code == 0\n        assert res.exception is None\n        assert result.project_dir.is_dir()\n\nContext and template location can be fully customized, see our `documentation <https://pytest-copie.readthedocs.io>`__ for more details.\n\nCredits\n-------\n\nThis package was created with `Copier <https://copier.readthedocs.io/en/latest/>`__ and the `@12rambau/pypackage <https://github.com/12rambau/pypackage>`__ 0.1.11 project template.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "The pytest plugin for your copier templates \ud83d\udcd2",
    "version": "0.2.0",
    "project_urls": {
        "Homepage": "https://github.com/12rambau/pytest-copie"
    },
    "split_keywords": [
        "python",
        " copier",
        " pytest",
        " pytest-plugin"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5c63aa3e90377211890ccbd2ea3adab27f1b5924dec1812d1dbf1f183918cbd6",
                "md5": "bb1ddb40e962ed2481237eacb4161c01",
                "sha256": "374538b5d602093c10c0c904bc7f6d6ae77ca00f4158364c894a549a2265772e"
            },
            "downloads": -1,
            "filename": "pytest_copie-0.2.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "bb1ddb40e962ed2481237eacb4161c01",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 7246,
            "upload_time": "2024-06-26T11:48:25",
            "upload_time_iso_8601": "2024-06-26T11:48:25.468440Z",
            "url": "https://files.pythonhosted.org/packages/5c/63/aa3e90377211890ccbd2ea3adab27f1b5924dec1812d1dbf1f183918cbd6/pytest_copie-0.2.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "53dffdc41a85adf7168128cff0147a4429fa8ae8645ca74a0040cf1c7691bfd6",
                "md5": "1c55cf4fb2e02057ada437a2c11d526b",
                "sha256": "12f002e2f40ecc00062b3aa3099e0c665df6fd3711284bad9605dbfead0f0e63"
            },
            "downloads": -1,
            "filename": "pytest_copie-0.2.0.tar.gz",
            "has_sig": false,
            "md5_digest": "1c55cf4fb2e02057ada437a2c11d526b",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 21392,
            "upload_time": "2024-06-26T11:48:26",
            "upload_time_iso_8601": "2024-06-26T11:48:26.999305Z",
            "url": "https://files.pythonhosted.org/packages/53/df/fdc41a85adf7168128cff0147a4429fa8ae8645ca74a0040cf1c7691bfd6/pytest_copie-0.2.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-06-26 11:48:26",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "12rambau",
    "github_project": "pytest-copie",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "pytest-copie"
}
        
Elapsed time: 0.28741s