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.

Source Distribution

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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: pytest-enhancements-0.0.2.tar.gz
  • Upload date:
  • Size: 2.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.7.4

File hashes

Hashes for pytest-enhancements-0.0.2.tar.gz
Algorithm Hash digest
SHA256 c34c35676c4dc088c8392c61523459b8c8ba874ee62d9ea60f550c6f8e06bef0
MD5 3d35344515e1e283807fd5a0dbb06d9e
BLAKE2b-256 fbf2cf11daa36c3598b7a831bcc77d684a95f0723032131d6b607109e51f7820

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pytest_enhancements-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 14.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.7.4

File hashes

Hashes for pytest_enhancements-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 2e3d77c11bc60d7056ade9d1b449e8ab08b3687eb373209923a9f0c13e4a86ec
MD5 16b4b5f46293aff2a7a7134832d4dd16
BLAKE2b-256 d6db5997e8dadd37aa5ecbeda54cb7a28f12ba904560c632108676203866c1cf

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