Pipenv: pytest-cov๋กœ pytest๋ฅผ ์„ค์น˜ํ•  ๋•Œ ์ข…์†์„ฑ์„ ํ•ด๊ฒฐํ•  ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค.

์— ๋งŒ๋“  2018๋…„ 08์›” 01์ผ  ยท  3์ฝ”๋ฉ˜ํŠธ  ยท  ์ถœ์ฒ˜: pypa/pipenv

๋ฌธ์ œ ์„ค๋ช…

์ข…์†์„ฑ์ด ํ•ด๊ฒฐ๋˜์ง€ ์•Š๋Š”๋‹ค๊ณ  ๋ถˆํ‰ํ•˜๋ฏ€๋กœ pytest ๋ฐ pytest-cov๋ฅผ ์„ค์น˜ํ•  ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค.

๋ณต์ œ ๋ฐ ์ถœ๋ ฅ ๋‹จ๊ณ„

๋‚ด ํ•ํŒŒ์ผ

[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
pytest = "*"
pytest-cov = "*"

[dev-packages]

[requires]
python_version = "3.6"
 $ pipenv install
Pipfile.lock (ca72e7) out of date, updating to (4ccbf7)...
Locking [dev-packages] dependencies...
Locking [packages] dependencies...

Warning: Your dependencies could not be resolved. You likely have a mismatch in your sub-dependencies.
  You can use $ pipenv install --skip-lock to bypass this mechanism, then run $ pipenv graph to inspect the situation.
  Hint: try $ pipenv lock --pre if it is a pre-release dependency.
Could not find a version that matches pluggy<0.7,>=0.5,>=0.7
Tried: 0.3.0, 0.3.0, 0.3.1, 0.3.1, 0.4.0, 0.4.0, 0.5.0, 0.5.1, 0.5.1, 0.5.2, 0.5.2, 0.6.0, 0.6.0, 0.6.0, 0.7.1, 0.7.1
There are incompatible versions in the resolved dependencies.

๊ทธ๋Ÿฐ ๋‹ค์Œ ๋‹ค์Œ์„ ์ˆ˜ํ–‰ํ•ฉ๋‹ˆ๋‹ค.

$ pipenv install --skip-lock
$ pipenv graph
pytest-cov==2.5.1
  - coverage [required: >=3.7.1, installed: 4.5.1]
  - pytest [required: >=2.6.0, installed: 3.7.0]
    - atomicwrites [required: >=1.0, installed: 1.1.5]
    - attrs [required: >=17.4.0, installed: 18.1.0]
    - more-itertools [required: >=4.0.0, installed: 4.3.0]
      - six [required: >=1.0.0,<2.0.0, installed: 1.11.0]
    - pluggy [required: >=0.7, installed: 0.7.1]
    - py [required: >=1.5.0, installed: 1.5.4]
    - setuptools [required: Any, installed: 40.0.0]
    - six [required: >=1.10.0, installed: 1.11.0]

์ข…์†์„ฑ์€ ๊ดœ์ฐฎ์•„ ๋ณด์ž…๋‹ˆ๋‹ค.

๊ฐ€์žฅ ์œ ์šฉํ•œ ๋Œ“๊ธ€

์ด๊ฑด ์ •๋ง ๋‹ซ์•„์•ผ ํ•˜๋‚˜? pipenv ์ธก์—์„œ ๋ช‡ ๊ฐ€์ง€ ๊ฐ€๋Šฅํ•œ ๊ฐœ์„  ์‚ฌํ•ญ์ด ์žˆ๋‹ค๊ณ  ์ƒ๊ฐํ•ฉ๋‹ˆ๋‹ค.

  • ํŒจํ‚ค์ง€๊ฐ€ ์ฃผ์–ด์ง„ ์ œ์•ฝ ์กฐ๊ฑด์œผ๋กœ ํ•ด๊ฒฐ๋˜๋Š” ์ด์œ ๋ฅผ ์‚ฌ์šฉ์ž์—๊ฒŒ ์„ค๋ช…ํ•˜์—ฌ ์ด๋Ÿฌํ•œ ์ผ์ด ๋ฐœ์ƒํ•˜๋Š” ์ด์œ ์— ๋Œ€ํ•ด ์„ค๋ช…ํ•ฉ๋‹ˆ๋‹ค.
  • ์‚ฌ์šฉ์ž์—๊ฒŒ ์ˆ˜ํ–‰ํ•  ์ž‘์—…์— ๋Œ€ํ•œ ํžŒํŠธ ์ œ๊ณต: ) ์ž ๊ธˆ ํ•ด์ œ ์‹คํ–‰, b) ๋‹ค๋ฅธ ์ž‘์—… ๋“ฑ

๋ชจ๋“  3 ๋Œ“๊ธ€

pipenv lock --clear ์ด ๋ฌธ์ œ๋ฅผ ํ•ด๊ฒฐํ•ฉ๋‹ˆ๋‹ค.

์ด๊ฑด ์ •๋ง ๋‹ซ์•„์•ผ ํ•˜๋‚˜? pipenv ์ธก์—์„œ ๋ช‡ ๊ฐ€์ง€ ๊ฐ€๋Šฅํ•œ ๊ฐœ์„  ์‚ฌํ•ญ์ด ์žˆ๋‹ค๊ณ  ์ƒ๊ฐํ•ฉ๋‹ˆ๋‹ค.

  • ํŒจํ‚ค์ง€๊ฐ€ ์ฃผ์–ด์ง„ ์ œ์•ฝ ์กฐ๊ฑด์œผ๋กœ ํ•ด๊ฒฐ๋˜๋Š” ์ด์œ ๋ฅผ ์‚ฌ์šฉ์ž์—๊ฒŒ ์„ค๋ช…ํ•˜์—ฌ ์ด๋Ÿฌํ•œ ์ผ์ด ๋ฐœ์ƒํ•˜๋Š” ์ด์œ ์— ๋Œ€ํ•ด ์„ค๋ช…ํ•ฉ๋‹ˆ๋‹ค.
  • ์‚ฌ์šฉ์ž์—๊ฒŒ ์ˆ˜ํ–‰ํ•  ์ž‘์—…์— ๋Œ€ํ•œ ํžŒํŠธ ์ œ๊ณต: ) ์ž ๊ธˆ ํ•ด์ œ ์‹คํ–‰, b) ๋‹ค๋ฅธ ์ž‘์—… ๋“ฑ
์ด ํŽ˜์ด์ง€๊ฐ€ ๋„์›€์ด ๋˜์—ˆ๋‚˜์š”?
0 / 5 - 0 ๋“ฑ๊ธ‰