Skip to content

blueyed/pytest-enhancements

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pytest-enhancements

Enhancements to pytest that were rejected upstream. Might involve monkey-patching pytest directly.. :/

See also my pytest branch with more enhancements.

Features

  • Supports passing dictionaries to @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)

    (rejected in pytest-dev/pytest#5850)

Installation

$ pip install pytest-enhancements

License

Distributed under the terms of the GNU GPL v3.0 license.

About

Improvements for pytest (rejected upstream)

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages