<aside>
</aside>
pytest-xdist
) ์ค์น ๋ฐ ์ฌ์ฉpytest-sugar
) ์ค์น ๋ฐ ํจ๊ณผ ํ์ธpytest-order
) ์ฌ์ฉ๋ฒ ๋ฐ ์ฃผ์์ ์๊ธฐํ๋ก์ ํธ ๊ตฌ์กฐ: (๋ณ๋ ์์)
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
pip
์ผ๋ก ๊ฐ๋จํ ์ค์น, ๋ฐ๋ก ์ฌ์ฉ ๋๋ ๊ฐ๋จํ ์ต์
์ผ๋ก ํ์ฉ.