Skip to main content

Pytest plugin for parametrizing tests with default iterables.

Project description

https://img.shields.io/pypi/v/pytest-parametrized.svg https://img.shields.io/pypi/pyversions/pytest-parametrized.svg https://img.shields.io/pypi/status/pytest-parametrized.svg https://img.shields.io/travis/coady/pytest-parametrized.svg https://img.shields.io/codecov/c/github/coady/pytest-parametrized.svg

Pytest plugin for parametrizing tests with default iterables, providing alternative syntax for pytest.mark.parametrize.

Usage

Decorate tests with iterable default values.

@pytest.parametrized
def test(name=values, ...):
   """test single parametrized arg with each value"""

@pytest.parametrized.zip
def test(name=values, name1=values1, ...):
   """test parametrized args with zipped values"""

@pytest.parametrized.product
def test(name=values, name1=values1, ...):
   """test parametrized args with cartesian product of values"""

Simple parametrized fixtures also supported, for easier reuse.

fixture_name = pytest.parametrized.fixture(*params)

Installation

$ pip install pytest-parametrized

Require plugin as usual in conftest.py.

pytest_plugins = 'parametrized', ...

Tests

100% branch coverage.

$ pytest [--cov]

Changes

0.2

  • fixture keyword options

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-parametrized-0.2.tar.gz (3.2 kB view hashes)

Uploaded Source

Built Distribution

pytest_parametrized-0.2-py2.py3-none-any.whl (4.4 kB view hashes)

Uploaded Python 2 Python 3

Supported by

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