diff --git a/testing/local_testing/add_function.py b/testing/local_testing/add_function.py index 4693ad3cf..e1829c359 100644 --- a/testing/local_testing/add_function.py +++ b/testing/local_testing/add_function.py @@ -1,2 +1,2 @@ -def add(a, b): +def add(a: int, b: int) -> int: return a + b diff --git a/testing/local_testing/local_test_0.py b/testing/local_testing/local_test_0.py index 218606208..76c079dea 100644 --- a/testing/local_testing/local_test_0.py +++ b/testing/local_testing/local_test_0.py @@ -1,19 +1,16 @@ import pytest - @pytest.mark.parametrize("arg1,arg2", [(1, 1)]) - def test_parametrization(arg1, arg2): assert arg1 == arg2 assert arg1 + 1 == arg2 + 1 # Gets the error: In test_parametrization: indirect fixture '(1, 1)' doesn't exist -# Goal is to change this message into a more beginner friendly message. - +# Goal is to change this message into a more beginner friendly message. + # 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 \ No newline at end of file +# ("arg1", "arg2"), and "arg1, arg2" works, but cannot put in default parameters as normal function diff --git a/testing/local_testing/local_test_test.py b/testing/local_testing/local_test_test.py index 72ca93062..23ac56060 100644 --- a/testing/local_testing/local_test_test.py +++ b/testing/local_testing/local_test_test.py @@ -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 - - -