diff --git a/pyproject.toml b/pyproject.toml index b3840e4..a158003 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -41,6 +41,7 @@ build-backend = "poetry.core.masonry.api" [tool.pytest.ini_options] addopts = "--cov=src --cov-report=xml" +pythonpath = ["src"] [tool.ruff] line-length = 88 diff --git a/src/my_python_project/__init__.py b/src/my_python_project/__init__.py index 699ee4b..7444a30 100644 --- a/src/my_python_project/__init__.py +++ b/src/my_python_project/__init__.py @@ -7,3 +7,8 @@ # # Commercial use beyond a 30-day trial requires a separate license. # Contact: gowtham.rao@coreason.ai + + +def add(a: int, b: int) -> int: + """Adds two integers together.""" + return a + b diff --git a/tests/test_example.py b/tests/test_main.py similarity index 78% rename from tests/test_example.py rename to tests/test_main.py index a84fb72..6e45c38 100644 --- a/tests/test_example.py +++ b/tests/test_main.py @@ -8,6 +8,9 @@ # Commercial use beyond a 30-day trial requires a separate license. # Contact: gowtham.rao@coreason.ai +from my_python_project import add -def test_always_passes(): - assert True + +def test_add(): + """Tests the add function.""" + assert add(1, 2) == 3