Skip to main content

Class-based pytest parametrization

Project description


Class-based test cases for pytest.


pip install pytest-data-suites

Usage example

from pytest_data_suites import DataSuite

class MultiplicationDataSuite(DataSuite):
    # Using TypedDict instead of dict here could clarify your code, but that's just a demo
    positive_operands = dict(left_operand=2, right_operand=2, operation_result=4)
    negative_operands = dict(left_operand=-3, right_operand=-7, operation_result=21)

def test_multiplication(left_operand: float, right_operand: float, operation_result: float) -> None:
    assert left_operand * right_operand == operation_result

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-data-suites-1.0.4.tar.gz (4.4 kB view hashes)

Uploaded source

Built Distribution

pytest_data_suites-1.0.4-py3-none-any.whl (5.1 kB view hashes)

Uploaded py3

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