From 99091c7c4a01889423abadaca101b1ec6f92f2df Mon Sep 17 00:00:00 2001 From: alv2017 Date: Tue, 11 Mar 2025 01:36:38 +0200 Subject: [PATCH] Adding types to tests: test/test_tutorial/test_path_params/test_tutorial002.py --- tests/test_tutorial/test_path_params/test_tutorial002.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/test_tutorial/test_path_params/test_tutorial002.py b/tests/test_tutorial/test_path_params/test_tutorial002.py index a47421467..26d2c1f15 100644 --- a/tests/test_tutorial/test_path_params/test_tutorial002.py +++ b/tests/test_tutorial/test_path_params/test_tutorial002.py @@ -11,7 +11,7 @@ def get_client(): @pytest.mark.parametrize("parameter_value", [-10, 0, 10]) def test_with_integer_parameters(client, parameter_value): - parameter = parameter_value + parameter: int = parameter_value response = client.get(f"/items/{parameter}") assert response.status_code == 200 assert response.json() == {"item_id": parameter} @@ -19,10 +19,10 @@ def test_with_integer_parameters(client, parameter_value): @pytest.mark.parametrize("parameter_value", [-10.00, 0.00, 10.00]) def test_with_integers_converted_to_floats(client, parameter_value): - parameter = parameter_value + parameter: float = parameter_value response = client.get(f"/items/{parameter}") assert response.status_code == 200 - assert response.json() == {"item_id": parameter} + assert response.json() == {"item_id": int(parameter)} @pytest.mark.parametrize("parameter_value", [-3.14, 3.14])