2021-08-13 11:44:51 +05:30

15 lines
463 B
Python

# test_myadd5.py test suite using parameterize marker
import sys
import pytest
from mypytest.src.myadd3 import add
@pytest.mark.parametrize("x,y,ans",
[(10,5,15),(10,-5,5),
(-10,5,-5),(-10,-5,-15)],
ids=["pos-pos","pos-neg",
"neg-pos", "neg-neg"])
def test_add(x, y, ans):
""" test case to validate two positive numbers"""
assert add(x, y) == ans