跳转到主要内容

pytest改进(上游拒绝)

项目描述

pytest-enhancements

被上游拒绝的pytest改进。可能涉及直接修补pytest.. :/

另请参阅 我的带有更多改进的pytest分支.

特性

  • 支持传递字典到 @pytest.mark.parametrize

    @pytest.mark.parametrize('arg1,arg2,expected_id', {
        "myid_12": [1, 2, "[myid_12]"],
        "replaced_id": pytest.param(3, 4, "[replaced_id]", id="myid_34"),
        "myid_56": pytest.param(5, 6, "[myid_56]"),
    })
    def test_parametrize_dict(request, arg1, arg2, expected_id):
        if expected_id is None:
            expected_id = "[%d-%d-None]" % (arg1, arg2)
        assert request.node.nodeid.endswith(expected_id)
    

    (在 https://github.com/pytest-dev/pytest/pull/5850 中被拒绝)

安装

$ pip install pytest-enhancements

许可协议

根据GNU GPL v3.0 许可协议分发。

项目详情


下载文件

下载适合您平台的应用程序。如果您不确定选择哪一个,请了解更多关于 安装软件包 的信息。

源代码分发

pytest-enhancements-0.0.4.tar.gz (2.1 kB 查看哈希值)

上传于

构建版本

pytest_enhancements-0.0.4-py3-none-any.whl (14.9 kB 查看哈希值)

上传于 Python 3

支持者