Skip to main content

Provide data to parameterizezd tests from files

Project description

Setup

in conftest.py

pytest_plugins = ["parametrize_from_file.generate_tests"]

Usage

Code

from parametrize_from_file import params_from_yml

@params_from_yml
def test_first(string):
    assert len(string) > 0

@params_from_yml
def test_second(numer_1, number_2):
    assert number_1 > number_2

Data Files

test_data/test_first.yml

tc_not_zero_1:
    string: some text
tc_not_zero_2:
    string: another text
tc_not_zero_3:
    string: still text

test_data/test_second.yml

tc_compare_1:
    number_1: 4
    number_2: 5
tc_compare_2:
    number_1: 7
    number_2: 5

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

params-from-file-0.0.2.tar.gz (14.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

params_from_file-0.0.2-py3-none-any.whl (14.7 kB view details)

Uploaded Python 3

File details

Details for the file params-from-file-0.0.2.tar.gz.

File metadata

  • Download URL: params-from-file-0.0.2.tar.gz
  • Upload date:
  • Size: 14.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.10.12

File hashes

Hashes for params-from-file-0.0.2.tar.gz
Algorithm Hash digest
SHA256 8e56ac3fb1a30547c2aca686291718fb497e30c409142172688deae2f3e5c43f
MD5 11a6b4b10487de5bd572000d64b1b1cb
BLAKE2b-256 706de7bc9f74dc89ab0ca1ab816326eaacd0512a0319b989ba3ec8a688259ba7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for params_from_file-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 22407733d7d2ff03c15c2a6dde2440b1afadd56866e6db02ba68f2dd15563816
MD5 c9f6e769358012759e48e513b9674808
BLAKE2b-256 bce4c18844c5b421d26342b23b5f8b4a1d795c4de3b9b4b5cc87428f926afd00

See more details on using hashes here.

Supported by

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