Adding chapter 5 source code

This commit is contained in:
muassif
2021-02-21 21:40:34 +04:00
committed by GitHub
parent e8469ec365
commit e662762d09
24 changed files with 348 additions and 0 deletions
+14
View File
@@ -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