본문으로 건너뛰기
Skillpedia
테스트40k · #7349

pytest-coverage

하는 일

이 도구는 모든 코드가 테스트되고 있는지 확인하도록 돕습니다. 테스트되지 않은 코드 부분을 보여 주어, 테스트를 추가할 수 있도록 합니다.

사용하는 경우

  • ✓테스트가 코드를 모두 다루는지 확인하고 싶을 때.
  • ✓테스트되지 않은 코드 부분을 찾아야 할 때.
  • ✓코드의 100%가 테스트되는 것이 목표일 때.

스킬 링크

https://github.com/github/awesome-copilot/blob/main/skills/pytest-coverage/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/github/awesome-copilot/blob/main/skills/pytest-coverage/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“프로젝트의 테스트 커버리지를 확인하고, 테스트가 빠진 곳을 보여 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

도구는 테스트를 실행하고, 어떤 코드 줄이 실행되었는지 확인합니다. 테스트되지 않은 줄을 '!' 표시와 함께 보여 주는 보고서를 만듭니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

The goal is for the tests to cover all lines of code.

Generate a coverage report with:

pytest --cov --cov-report=annotate:cov_annotate

If you are checking for coverage of a specific module, you can specify it like this:

pytest --cov=your_module_name --cov-report=annotate:cov_annotate

You can also specify specific tests to run, for example:

pytest tests/test_your_module.py --cov=your_module_name --cov-report=annotate:cov_annotate

Open the cov_annotate directory to view the annotated source code. There will be one file per source file. If a file has 100% source coverage, it means all lines are covered by tests, so you do not need to open the file.

For each file that has less than 100% test coverage, find the matching file in cov_annotate and review the file.

If a line starts with a ! (exclamation mark), it means that the line is not covered by tests. Add tests to cover the missing lines.

Keep running the tests and improving coverage until all lines are covered.

자주 묻는 질문

'코드 커버리지'는 무엇을 뜻하나요?

테스트가 코드의 어떤 부분을 실행했는지 나타내는 지표입니다. 목표는 코드의 100%를 커버하는 것입니다.

'cov_annotate' 디렉터리는 무엇인가요?

각 코드 줄마다 테스트된 부분과 그렇지 않은 부분을 보여 주는 파일을 저장하는 폴더입니다.

테스트를 더 추가해야 하는지 어떻게 알 수 있나요?

보고서의 코드 파일에 '!' 표시가 있는 줄이 있으면, 그 줄은 테스트되지 않은 것이므로 테스트를 추가해야 합니다.

상세 정보

작성자의 원본 설명

Run pytest tests with coverage, discover lines missing coverage, and increase coverage to 100%.

repo: github/awesome-copilot

인기도

GitHub 스타
40k
순위
#7349
라이선스
MIT
업데이트
2026. 10. 15.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬