Junior — Middle
Have you ever written automated tests for individual modules or components in your current project?
sobes.tech AI
Answer from AI
Yes, in my current project I wrote automated tests for individual modules using unittest and pytest. For example, for a data processing function, I created tests that checked the correctness of the results with different input parameters, including boundary cases and error handling.
Here's a simple pytest example:
import pytest
def add(a, b):
return a + b
def test_add():
assert add(2, 3) == 5
assert add(-1, 1) == 0
assert add(0, 0) == 0