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 hashes)

Uploaded Source

Built Distribution

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

Uploaded Python 3

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