Giter Club home page Giter Club logo

pytest-xpara's Introduction

Build Status Coverage Status PyPI Version

pytest-xpara

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.

pytest-xpara's People

Contributors

tonyseek avatar zheaoli avatar mozillazg avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.