Skip to main content

Improvements for pytest (rejected upstream)

Project description

pytest-enhancements

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

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 https://github.com/pytest-dev/pytest/pull/5850)

Installation

$ pip install pytest-enhancements

License

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for pytest-enhancements, version 0.0.1
Filename, size File type Python version Upload date Hashes
Filename, size pytest_enhancements-0.0.1-py3-none-any.whl (14.9 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size pytest-enhancements-0.0.1.tar.gz (2.0 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page