Skip to main content
https://img.shields.io/pypi/v/parametrize_from_file.svg https://img.shields.io/pypi/pyversions/parametrize_from_file.svg https://img.shields.io/readthedocs/parametrize_from_file.svg https://img.shields.io/github/workflow/status/kalekundert/parametrize_from_file/Test%20and%20release/master https://img.shields.io/coveralls/kalekundert/parametrize_from_file.svg https://img.shields.io/github/last-commit/kalekundert/parametrize_from_file?logo=github

Parametrize From File is a library for reading unit test parameters from config files. It works with the pytest framework. Below is the basic workflow that this package enables:

  • Write test cases in a JSON, YAML, TOML, or NestedText file:

    # test_misc.yml
    test_addition:
      - a: 1
        b: 2
        c: 3
    
      - a: 2
        b: 4
        c: 6
  • Decorate the corresponding test functions with @parametrize_from_file:

    # test_misc.py
    import parametrize_from_file
    
    @parametrize_from_file
    def test_addition(a, b, c):
        assert a + b == c
  • Run pytest as usual:

    $ pytest
    ============================= test session starts ==============================
    platform linux -- Python 3.8.2, pytest-6.2.4, py-1.9.0, pluggy-0.13.1
    rootdir: /home/kale/hacking/projects/parametrize_from_file, configfile: pyproject.toml
    plugins: forked-1.1.3, anyio-3.1.0, xonsh-0.9.27, typeguard-2.12.1, cov-2.8.1, xdist-1.32.0, hypothesis-5.8.3, mock-2.0.0
    collected 1 item
    
    test_misc.py ..                                                          [100%]
    
    ============================== 1 passed in 0.12s ===============================

Refer to the online documentation for more information.

Metadata

Release files for parametrize-from-file 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for parametrize-from-file 0.4.0
File Size Uploaded
parametrize_from_file-0.4.0.tar.gz 33.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for parametrize-from-file 0.4.0
File Interpreter ABI Platform
parametrize_from_file-0.4.0-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 49.3 kB

Release files / parametrize_from_file-0.4.0.tar.gz

Download URL parametrize_from_file-0.4.0.tar.gz
Size 33.7 kB
Tags Source
SHA-256 checksum
How to use checksums
6a1c81c3bf2490f07baa75514fd9812475ae89a9f5ff923cebf834e03565fffb
BLAKE2b-256 checksum
How to use checksums
bd09d6e0f63d9f9417dab5c305ad78c538826fbb93a93b35cbc769b3dc40ff57
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.7.11

Release files / parametrize_from_file-0.4.0-py2.py3-none-any.whl

Download URL parametrize_from_file-0.4.0-py2.py3-none-any.whl
Size 15.6 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
0435fffed7bff2d27b9ee74e25e243335b49be94a670893dbc795e0a5e911878
BLAKE2b-256 checksum
How to use checksums
cedbae25b2acac1a5784775bee70a5f9694ff04add10a8d225533b876df67d4b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.7.11

Release history Release notifications | RSS feed

0.20.0

2 release files

0.19.0

2 release files

0.17.1

2 release files

0.17.0

2 release files

0.16.0

2 release files

0.15.0

2 release files

0.14.0

2 release files

0.13.0

2 release files

0.12.0

2 release files

0.11.1

2 release files

0.11.0

2 release files

0.9.1

2 release files

0.9.0

2 release files

0.8.0

2 release files

0.7.1

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.5.1

2 release files

0.5.0

2 release files

This release

0.4.0 This release

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.1

2 release files

0.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page