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.. :/

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 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.

Source Distribution

pytest-enhancements-0.0.4.tar.gz (2.1 kB view details)

Uploaded Source

Built Distribution

pytest_enhancements-0.0.4-py3-none-any.whl (14.9 kB view details)

Uploaded Python 3

File details

Details for the file pytest-enhancements-0.0.4.tar.gz.

File metadata

  • Download URL: pytest-enhancements-0.0.4.tar.gz
  • Upload date:
  • Size: 2.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.1

File hashes

Hashes for pytest-enhancements-0.0.4.tar.gz
Algorithm Hash digest
SHA256 a7fd697a6f44d9709b31a569fe4a86a2c96e329541f5dbbaf41645cbe8a021a7
MD5 9ac95e81cc72c8d2f5db26016ce68e6e
BLAKE2b-256 ddc59cee2b7b5cd5047ee96d346aa0aacab484e447103361fd46bf9156b9f4d3

See more details on using hashes here.

File details

Details for the file pytest_enhancements-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: pytest_enhancements-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 14.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.1

File hashes

Hashes for pytest_enhancements-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 8a390df6cece471cbea201f6c9c633ec3123bb727234663e6e84ec7578bcb732
MD5 363dff5c8b389c040c9bc6148ea35860
BLAKE2b-256 62274546ff5459d2f6598b469ed31c4dd2fb39365b9626ad758e652b6798414e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page