From 15250b35ce2e30ae74ed79311d21a5eafe72b5f2 Mon Sep 17 00:00:00 2001 From: Abhishek Date: Mon, 20 Oct 2025 13:40:31 +0530 Subject: [PATCH] just checking in a test file for demo purposes. --- testing/test_sample.py | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 testing/test_sample.py diff --git a/testing/test_sample.py b/testing/test_sample.py new file mode 100644 index 00000000000..fe1df3e0e68 --- /dev/null +++ b/testing/test_sample.py @@ -0,0 +1,32 @@ +"""Small sample tests for pytestdemo. + +These are intentionally simple so running the single file should pass +in any standard pytest environment. +""" + +import pytest + + +def add(a, b): + """Simple helper used by the tests.""" + return a + b + + +def test_add_positive_numbers(): + """A basic happy-path test.""" + assert add(2, 3) == 5 + + +def test_add_with_zero(): + """Edge case: adding zero should be identity.""" + assert add(0, 7) == 7 + + +def test_add_negative_numbers(): + """Ensure negatives work as expected.""" + assert add(-2, -3) == -5 + + +@pytest.mark.parametrize("a,b,expected", [(1, 2, 3), (10, -1, 9), (0, 0, 0)]) +def test_add_parametrized(a, b, expected): + assert add(a, b) == expected