Skip to main content

Class-based pytest parametrization

Project description

pytest-data-suites

Class-based test cases for pytest.

Installation

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)


@MultiplicationDataSuite.parametrize
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.5.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

pytest_data_suites-1.0.5-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file pytest_data_suites-1.0.5.tar.gz.

File metadata

  • Download URL: pytest_data_suites-1.0.5.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.11.7 Darwin/23.4.0

File hashes

Hashes for pytest_data_suites-1.0.5.tar.gz
Algorithm Hash digest
SHA256 65de9db16a98f21086f8faabbade484880218a6bba3a782b43d4dac768053905
MD5 854c114ab3e9d8de5e06294e134fda3d
BLAKE2b-256 a59f198fdcfecddd525f0ce5b6d7c3bc0ba17632fb558257ac20bd04e077e863

See more details on using hashes here.

File details

Details for the file pytest_data_suites-1.0.5-py3-none-any.whl.

File metadata

File hashes

Hashes for pytest_data_suites-1.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 f585e47bb813a4bca470c56e367d8e49b60ba34658ee12e4e1e712f36b73b5ed
MD5 f12b78d3f55220aad464af116cae9d02
BLAKE2b-256 9ba85a4ad72ee857e51ef8b73f478b72c3ccc108a522d4e04ded2f341c4650ff

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