Adding chapter 5 source code
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
# 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
|
||||
Reference in New Issue
Block a user