From 3c01a7b829bb175330bc3f2f9636304c28349a59 Mon Sep 17 00:00:00 2001 From: Adalene_codecov <152432831+Adal3n3@users.noreply.github.com> Date: Tue, 23 Apr 2024 15:04:09 -0700 Subject: [PATCH] step3: cover divide by 0 case --- api/calculator/test_calculator.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/api/calculator/test_calculator.py b/api/calculator/test_calculator.py index 69fa778f1..4c0e68150 100644 --- a/api/calculator/test_calculator.py +++ b/api/calculator/test_calculator.py @@ -27,4 +27,7 @@ def test_divide(): assert Calculator.divide(1, 2) == 0.5 assert Calculator.divide(1.0, 2.0) == 0.5 assert Calculator.divide(0, 2.0) == 0 - assert Calculator.divide(-4, 2.0) == -2.0 \ No newline at end of file + assert Calculator.divide(-4, 2.0) == -2.0 + +def test_divide_by_0(): + assert Calculator.divide(2.0, 0) == 'Cannot divide by 0' \ No newline at end of file