<aside>
</aside>
๐ฏ ์ด๋ฒ ์ฑํฐ ๋ชฉํ
- ์ฌ๋ฌ Python ๋ฒ์ /๋ค๋ฅธ ์์กด์ฑ ์กฐํฉ ์ฝ๋ ํ
์คํธ ์ด์ (ํธํ์ฑ) ์ดํด
@nox.session(python=[...])
๋ฐ์ฝ๋ ์ดํฐ ์ธ์๋ก ๋์ผ Nox ์ธ์
์ ์ฌ๋ฌ Python ๋ฒ์ ์ ์คํ ์ค์
- Nox์ Python ๋ฒ์ ๋ณ ๋ณ๋ ๊ฒฉ๋ฆฌ ๊ฐ์ ํ๊ฒฝ ์์ฑ ๋ฐ ํ
์คํธ ์คํ ๋ฐฉ์ ์ดํด
- ์ธ์
ํจ์ ๋ด
session.python
์์ฑ์ผ๋ก ํ์ฌ ์คํ Python ๋ฒ์ ํ์ธ ๋ฐฉ๋ฒ ์๊ธฐ
- (๊ฐ๋ตํ)
nox.parametrize
๋ฐ์ฝ๋ ์ดํฐ๋ก Python ๋ฒ์ ์ธ ๋ค๋ฅธ ์กฐ๊ฑด ์ธ์
ํ๋ผ๋ฏธํฐํ ์ธ์ง
- ๋ฉํฐ ํ๊ฒฝ ํ
์คํธ ์๋ํ์ ๋ผ์ด๋ธ๋ฌ๋ฆฌ ๊ฐ๋ฐ ๋ฑ ํธํ์ฑ ๋ณด์ฅ ์ค์์ฑ ์ดํด
๐ป ๊ฐ์ ์ ์ฒด ์ฝ๋ ๋ฐ ํ๋ก์ ํธ ๊ตฌ์กฐ (Noxfile ์์ !)
ํ๋ก์ ํธ ๊ตฌ์กฐ: (๋ณ๋ ์์)
graph TD
A(my-pytest-project) --> B(.venv);
A --> C(mycalc);
A --> D(tests);
A --> E(pytest.ini);
A --> F(noxfile.py tests ์ธ์
๋ฐ์ฝ๋ ์ดํฐ ์์ );
A --> G(requirements-dev.txt);
A --> H(pyproject.toml);
C --> ...;
D --> ...;
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 F fill:#ffc,stroke:#333;
style G fill:#eee,stroke:#333;
style H fill:#eef,stroke:#333;
noxfile.py
(tests
์ธ์
์์ ):
- ์ด๋ฒ ์๊ฐ์ ์ฌ์ฉํ ์ฃผ์ ๋ช
๋ น์ด:
๐ ๋ด์ฉ
1. ์ ์ฌ๋ฌ ํ๊ฒฝ์์ ํ
์คํธํด์ผ ํ ๊น์? ํธํ์ฑ์ ์ค์์ฑ! ๐ค
- ๋ฐฐ๊ฒฝ: ๋ด ์ปดํจํฐ(ํน์ ํ๊ฒฝ)์์ ์ ๋์ํด๋ ๋ค๋ฅธ ํ๊ฒฝ์์ ๋ฌธ์ ๋ฐ์ ๊ฐ๋ฅ.
- ์ฃผ์ ์์ธ:
- Python ๋ฒ์ ์ฐจ์ด: ๊ธฐ๋ฅ ์ถ๊ฐ/๋ณ๊ฒฝ, ์ด์ /์ต์ ๋ฒ์ ๊ฐ ํธํ์ฑ ๋ฌธ์ .
- ์์กด์ฑ ๋ผ์ด๋ธ๋ฌ๋ฆฌ ๋ฒ์ ์ฐจ์ด: ์ธ๋ถ ๋ผ์ด๋ธ๋ฌ๋ฆฌ ๋ฒ์ ๋ณ ๊ธฐ๋ฅ/API ๋ณ๊ฒฝ.
- ์ด์์ฒด์ ์ฐจ์ด: ํ์ผ ๊ฒฝ๋ก, ์์คํ
ํธ์ถ ๋ฑ OS ์์กด์ ์ฝ๋ ๋์ ์ฐจ์ด (Nox ๋ค๋ฅธ ๊ธฐ๋ฅ/CI ํ๊ฒฝ ์ฃผ๋ก ๋ค๋ฃธ).
- ์ค์์ฑ: ํนํ ๋ผ์ด๋ธ๋ฌ๋ฆฌ ๊ฐ๋ฐ, ์ฌ๋ฌ ์๋ฒ ๋ฐฐํฌ ์ ํ๋ฆฌ์ผ์ด์
๊ฐ๋ฐ ์ ๋ค์ํ ํ๊ฒฝ ํธํ์ฑ ๋ณด์ฅ ํ์.