Skip to content

sommersoft/cookiecutter-pytest-plugin

Β 
Β 

Repository files navigation

cookiecutter-pytest-plugin

Join Chat on Gitter.im See Build Status on Travis CI Documentation Status

Minimal Cookiecutter template for authoring pytest plugins that help you to write better programs.

This template requires Cookiecutter 1.4.0 "Shortbread" or higher

Getting Started

Install Cookiecutter and generate a new pytest plugin project:

$ pip install cookiecutter
$ cookiecutter https://github.com/pytest-dev/cookiecutter-pytest-plugin

Cookiecutter prompts you for information regarding your plugin:

full_name [Raphael Pierzina]: Andreas Pelme
email [[email protected]]: [email protected]
github_username [hackebrot]: pelme
plugin_name [foobar]: awesome
module_name [awesome]: awesome
short_description [A simple plugin to use with pytest]:
version [0.1.0]:
pytest_version [2.9.1]:
Select docs_tool:
1 - mkdocs
2 - sphinx
3 - none
Choose from 1, 2, 3 [1]: 1
Select license:
1 - MIT
2 - BSD-3
3 - GNU GPL v3.0
Choose from 1, 2, 3 [1]: 2
INFO:post_gen_project:Moving files for mkdocs.

There you go - you just created a minimal pytest plugin:

pytest-awesome/
β”œβ”€β”€ LICENSE
β”œβ”€β”€ README.rst
β”œβ”€β”€ docs
β”‚Β Β  └── index.md
β”œβ”€β”€ mkdocs.yml
β”œβ”€β”€ pytest_awesome.py
β”œβ”€β”€ setup.py
β”œβ”€β”€ tests
β”‚Β Β  β”œβ”€β”€ conftest.py
β”‚Β Β  └── test_awesome.py
└── tox.ini

Features

  • Installable PyPI package featuring a setup.py.
  • Test suite running tox and pytest that makes sure your plugin is working as expected
  • Working example code for a fixture, a cli option, as well as a pytest.ini option
  • Comprehensive README.rst file that contains useful information about your plugin
  • Continuous integration configuration for Travis CI and AppVeyor
  • Optional documentation with either Sphinx or MkDocs
  • Choose from several licenses, such as MIT, BSD-3, Apache v2.0, GNU GPL v3.0, or MPL v2.0

Requirements to Submit a Plugin

If you plan on submitting your plugin to the pytest-dev organization you need to meet the following requirements:

  • PyPI presence with a setup.py that contains a license, pytest- prefixed, version number, authors, short and long description.
  • a tox.ini for running tests using tox.
  • a README describing how to use the plugin and on which platforms it runs.
  • a LICENSE file or equivalent containing the licensing information, with matching info in setup.py.
  • an issue tracker unless you rather want to use the core pytest issue tracker.

Please see the official guidelines at Submit a Plugin.

Resources

Please consult the pytest docs for more information on hooks at pytest hook reference.

Contribute

We welcome you to contribute to this project. Please visit the documentation to get started!

Issues

If you encounter any problems, please file an issue along with a detailed description.

Code of Conduct

Everyone interacting in the Cookiecutter pytest Plugin project's codebases, issue trackers, chat rooms, and mailing lists is expected to follow the PyPA Code of Conduct.

License

Distributed under the terms of the MIT license, Cookiecutter pytest Plugin is free and open source software.

OSI certified

About

A Cookiecutter template for pytest plugins πŸ’»

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 52.5%
  • Makefile 25.8%
  • Batchfile 21.7%