From ca3a4d482a4142c57a66c5d12293bae363efd1d7 Mon Sep 17 00:00:00 2001 From: Tom Hu Date: Thu, 18 Sep 2025 18:31:01 +0200 Subject: [PATCH] step4: add more tests --- app/test_calculator.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/app/test_calculator.py b/app/test_calculator.py index f5641938..84087f7f 100644 --- a/app/test_calculator.py +++ b/app/test_calculator.py @@ -1,4 +1,6 @@ from .calculator import Calculator +import time +import random def test_add(): @@ -29,3 +31,13 @@ def test_divide(): assert Calculator.divide(0, 2.0) == 0 assert Calculator.divide(-4, 2.0) == -2.0 # assert Calculator.divide(2.0, 0.0) == 'Cannot divide by 0' + +def test_fail(): + assert True == False + +def test_flaky(): + assert random.random() < 0.8 # This should fail 20% of the time + +def test_slow(): + time.sleep(5) + assert True == True