From 1c30a5b14768038de4450b7fbf846645acbc6382 Mon Sep 17 00:00:00 2001 From: venomade Date: Mon, 2 Nov 2026 11:09:29 +0000 Subject: [PATCH] Add new tests to lab-5-stretch --- test_calculator.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test_calculator.py b/test_calculator.py index 4d99646..b451092 100644 --- a/test_calculator.py +++ b/test_calculator.py @@ -1,3 +1,4 @@ +import pytest from calculator import add, subtract, multiply, divide def test_add(): @@ -19,3 +20,12 @@ def test_divide_uneven(): result = divide(a, b) # Assert assert result == 2.5 + +@pytest.mark.parametrize("a, b, expected", [ + (2, 3, 5), (-2, -3, -5), (0, 0, 0), +]) +def test_add_many(a, b, expected): + assert add(a, b) == expected + +def test_divide_by_zero(): + assert divide (5, 0) == float("inf")