pytest的扩展参数化插件。
项目描述
pytest-xpara 是pytest的扩展参数化插件。
安装
pip install pytest-xpara
用法
py.test --xpara test_foo.py
示例
# 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 ========================
贡献
如果您想报告错误或请求功能,请随意在GitHub上打开问题或创建pull请求 [GitHub]。
项目详情
关闭
pytest_xpara-0.3.0.tar.gz的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | e1d7fce33aefa9970c916ee97d8f66b240b78adcb543820814e8dcc8af45ea16 |
|
MD5 | 1545b81c87e7016d4683acf9d98ecf55 |
|
BLAKE2b-256 | 8a4dcb3221a10e42465b0935bcd35ffe1c8f4fad73764738c0132ae802035c0b |
关闭
pytest_xpara-0.3.0-py2.py3-none-any.whl的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 3d6625020ebf69892270cf84758f8bb3799e39c023c3aba7e37a5f5b06e7d38a |
|
MD5 | 016f507d726a3254dec40ab82764b054 |
|
BLAKE2b-256 | 247883824d004d7fde6f7346b21e9336664b59d820b8ce2f664cf8f4168b4dbe |