Skip to main content

An extended parametrizing plugin of pytest.

Project description

pytest-xpara is an extended parametrizing plugin of pytest.

Installation

pip install pytest-xpara

Usage

py.test --xpara test_foo.py

Example

# test_foo.py
import pytest

@pytest.mark.xparametrize
def test_bar(lhs, rhs):
    assert lhs == -rhs
# test_foo.yaml
test_bar:
  args: lhs,rhs
  data:
    - lhs: 1
      rhs: -1
    - lhs: -1
      rhs: 1
  dataids:
    - left_to_right
    - right_to_left
$ py.test -v --xpara test_foo.py
========================== test session starts ===========================
platform darwin -- Python 2.7.12, pytest-3.0.5, py-1.4.32, pluggy-0.4.0
cachedir: ../.cache
rootdir: /Users/tonyseek/Sites/pytest-xpara, inifile: setup.cfg
plugins: xpara-0.0.0, cov-2.4.0
collecting ... collected 2 items

test_foo.py::test_bar[left_to_right] PASSED
test_foo.py::test_bar[right_to_left] PASSED

======================== 2 passed in 0.03 seconds ========================

Contributing

If you want to report bugs or request features, please feel free to open issues or create pull requests on GitHub.

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-xpara-0.1.0.tar.gz (3.2 kB view details)

Uploaded Source

Built Distribution

pytest_xpara-0.1.0-py2.py3-none-any.whl (5.2 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file pytest-xpara-0.1.0.tar.gz.

File metadata

File hashes

Hashes for pytest-xpara-0.1.0.tar.gz
Algorithm Hash digest
SHA256 13923a17189edb6d036136cc6156abddea8409df7367dc77e1f67594b8b026fd
MD5 7a3ebcf114f9f0a7e9227db468fb379f
BLAKE2b-256 9c449828e5af655294c3c5e1c83500debf3f4843ce4e811837ac8b32184febbe

See more details on using hashes here.

File details

Details for the file pytest_xpara-0.1.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for pytest_xpara-0.1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 b93759dad59565b3f882f6221bbbbe6b58e5407e5d9ca95d0d8eabd974740b34
MD5 df74db338231586ef42c521bc6e9bf44
BLAKE2b-256 da34c682bde3b98cb59150ce596717e195097790c915c9f5e67c6c1a6908b128

See more details on using hashes here.

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