<aside>
</aside>
test_ ์ ๋์ฌ) ์ดํดassert ๋ฌธ์ ์ฌ์ฉํ ํ
์คํธ ๊ฒฐ๊ณผ ๊ฒ์ฆ ๋ฐฉ๋ฒ ์ ์ฉํ๋ก์ ํธ ๊ตฌ์กฐ: (์ง๋ ์๊ฐ๊ณผ ๋์ผ)
graph TD
A(my-pytest-project) --> B(.venv);
A --> C(mycalc);
A --> D(tests);
C --> C1(__init__.py);
C --> C2(mycalc.py);
D --> D1(__init__.py);
D --> D2(test_mycalc.py);
style B fill:#eee,stroke:#333,stroke-dasharray: 5 5;
style C fill:#ccf,stroke:#333;
style D fill:#cfc,stroke:#333;
mycalc/mycalc.py (์์ค ์ฝ๋):tests/test_mycalc.py (ํ
์คํธ ์ฝ๋):test_*.py ๋๋ _test.py.
test_mycalc.py (O), my_tests.py (X)Test๋ก ์์ํ๋ ํด๋์ค ๋ด test_ ์์ ๋ฉ์๋.
class TestCalculator: ๋ด def test_addition(self): (O)test_ ์์ ํจ์.
def test_add(): (O), def add_test(): (X)