Class-based pytest parametrization
Project description
pytest-data-suites
Class-based test cases for pytest
.
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
Built Distribution
Close
Hashes for pytest_data_suites-1.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cffec708d0434ca82f8501f5c5d403ff670dacffd06d3af21d704815a97cccb7 |
|
MD5 | cc36101b415e02d5e8b9d5935bbc593c |
|
BLAKE2b-256 | c0d66a858c6bafd885f134d0a613c569855c3368c80129169b8d1006c68877a9 |