Tutorial
This tutorial will walk you through the basics of using Karva.
Getting started
We will first create a new project using uv
.
This will give us a project that looks like this:
We can then create our core logic in src/calculator/__init__.py
.
We can then create our tests in tests/test_add.py
.
from calculator import Calculator
def test_add():
calculator = Calculator()
assert calculator.add(1, 2) == 3
Then, we'll add karva to our project.
We can then run our tests with uv run karva test
.
This will give us a report of our tests.