initial message improvements

This commit is contained in:
Chaeil Yun 2024-04-25 19:56:22 -04:00
parent 41ca1f5633
commit 57030e826d
3 changed files with 9 additions and 19 deletions

View File

@ -1,3 +1,2 @@
def add(a, b):
return a + b

View File

@ -1,5 +1,6 @@
import pytest
@pytest.mark.parametrize("arg1,arg2", [(1, 1)])
def test_parametrization(arg1, arg2):
assert arg1 == arg2
@ -12,5 +13,4 @@ def test_parametrization(arg1, arg2):
# The error message lives in this path: pytest/src/_pytest/python.py
# ("arg1", "arg2"), and "arg1, arg2" works, but cannot put in default parameters as normal function

View File

@ -1,22 +1,13 @@
# test_math_operations.py
import pytest
import add_function
import pytest
result_index = [(1, 2, 3), (-1, 1, 0), (0, 0, 0), (5, -3, 2), (1, 1, 2)]
result_index = [
(1, 2, 3),
(-1, 1, 0),
(0, 0, 0),
(5, -3, 2),
(1, 1, 2)
]
@pytest.mark.parametrize("a, b, expected_result", result_index)
def test_add(a, b, expected_result):
assert add_function.add(a, b) == expected_result