<aside>

</aside>

๐ŸŽฏ ์ด๋ฒˆ ์ฑ•ํ„ฐ ๋ชฉํ‘œ


๐Ÿ’ป ๊ฐ•์˜ ์ „์ฒด ์ฝ”๋“œ ๋ฐ ํ”„๋กœ์ ํŠธ ๊ตฌ์กฐ (ํ”Œ๋Ÿฌ๊ทธ์ธ ์„ค์น˜ ๋ฐ ์‚ฌ์šฉ!)

ํ”„๋กœ์ ํŠธ ๊ตฌ์กฐ: (๋ณ€๋™ ์—†์Œ)

graph TD
    A(my-pytest-project) --> B(.venv);
    A --> C(mycalc);
    A --> D(tests);
    A --> E(pytest.ini);
    C --> C1(__init__.py);
    C --> C2(calculator.py);
    C --> C3(exchange.py);
    D --> D1(__init__.py);
    D --> D2(test_calculator.py);
    D --> D3(conftest.py);
    D --> D4(test_scopes.py);
    D --> D5(test_markers.py);
    D --> D6(test_exchange.py);

    style B fill:#eee,stroke:#333,stroke-dasharray: 5 5;
    style C fill:#ccf,stroke:#333;
    style D fill:#cfc,stroke:#333;
    style E fill:#fef,stroke:#333;
    style C2 fill:#cce,stroke:#333;
    style C3 fill:#fda,stroke:#333;
    style D2 fill:#cef,stroke:#333;
    style D3 fill:#fec,stroke:#333;
    style D4 fill:#dff,stroke:#333;
    style D5 fill:#ffd,stroke:#333;
    style D6 fill:#adf,stroke:#333;

์ด๋ฒˆ ์‹œ๊ฐ„์— ์‚ฌ์šฉํ•  ์ฃผ์š” ๋ช…๋ น์–ด:

# (๊ฐ€์ƒํ™˜๊ฒฝ ํ™œ์„ฑํ™” ์ƒํƒœ)

# --- pytest-xdist (๋ณ‘๋ ฌ ์‹คํ–‰) ---
# 1. ์„ค์น˜
pip install pytest-xdist
# 2. ์‚ฌ์šฉ (์ž๋™ ์ฝ”์–ด ์ˆ˜ ๊ฐ์ง€)
pytest -n auto
# 3. ์‚ฌ์šฉ (4๊ฐœ ์›Œ์ปค๋กœ ์‹คํ–‰)
pytest -n 4

# --- pytest-sugar (๊ฐœ์„ ๋œ UI) ---
# 1. ์„ค์น˜
pip install pytest-sugar
# 2. ์‚ฌ์šฉ (์„ค์น˜ ํ›„ 'pytest' ์‹คํ–‰ ์‹œ ์ž๋™ ์ ์šฉ)
pytest

# --- pytest-order (์ˆœ์„œ ์ œ์–ด) ---
# 1. ์„ค์น˜
pip install pytest-order
# 2. ์‚ฌ์šฉ (@pytest.mark.order(N) ๋งˆ์ปค ์ถ”๊ฐ€ ํ•„์š”, ์•„๋ž˜ ๋‚ด์šฉ ์ฐธ๊ณ )
# pytest tests/test_order_example.py


๐Ÿ“š ๋‚ด์šฉ

1. Pytest ํ”Œ๋Ÿฌ๊ทธ์ธ์ด๋ž€? ๋ ˆ๊ณ  ๋ธ”๋ก์ฒ˜๋Ÿผ ๊ธฐ๋Šฅ ํ™•์žฅ! ๐Ÿงฑ