1. Pytest 설치pip install pytest pytest-mock2. 기본적인 테스트 작성(1) 간단한 테스트# test_sample.pydef add(a, b): return a + bdef test_add(): assert add(2, 3) == 5 assert add(1, -1) == 0테스트 실행:pytest(2) 예외 처리 테스트import pytestdef divide(x, y): if y == 0: raise ValueError("Cannot divide by zero!") return x / ydef test_divide(): with pytest.raises(ValueError, match="Cannot divide by zero!"..