Quick Start¶
1. Write a test¶
Add @test to any function in your source code:
# math_utils.py
from inline_tests import test
def add(a, b):
return a + b
@test
def addition_works():
assert add(2, 2) == 4
assert add(-1, 1) == 0
2. Run it¶
That's it. The test runs. Your normal code stays the same.
3. Mix with regular tests¶
inline-tests is additive. Your test_*.py files still work:
Next steps¶
- The Decorator - @test options and patterns
- pytest Integration - Fixtures, parametrize, async