pytest-coverage

โดย github

รัน pytest พร้อมรายงานความครอบคลุมเพื่อระบุและกำจัดบรรทัดโค้ดที่ไม่ได้ทดสอบ สร้างไฟล์ซอร์สโค้ดที่มีคำอธิบายประกอบในไดเรกทอรี cov_annotate/ โดยมีเครื่องหมาย ! บ่งชี้บรรทัดที่ไม่ครอบคลุม รองรับการตรวจสอบความครอบคลุมเฉพาะโมดูลผ่าน --cov=module_name และการรันทดสอบเป้าหมายบนไฟล์ทดสอบเฉพาะ ขั้นตอนการทำงาน: รันการครอบคลุม ตรวจสอบไฟล์ที่มีคำอธิบายประกอบสำหรับบรรทัดที่ไม่ครอบคลุม เขียนทดสอบเพื่อปิดช่องว่าง ทำซ้ำจนกว่าจะได้ความครอบคลุม 100%

npx skills add https://github.com/github/awesome-copilot --skill pytest-coverage

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.

Skills เพิ่มเติมจาก github

console-rendering
github
คำแนะนำสำหรับการใช้ระบบเรนเดอร์คอนโซลที่ใช้ struct tag ใน Go
official
github-pr-query
github
สอบถาม Pull Request บน GitHub อย่างมีประสิทธิภาพ พร้อมรองรับการกรองด้วยอาร์กิวเมนต์ jq
official
jqschema
github
ยูทิลิตี้ค้นพบสคีมา JSON ที่แยกข้อมูลโครงสร้างและประเภทจากข้อมูล JSON
official
gh-agent-session
github
ส่วนขยายเซสชันเอเจนต์ CLI ของ GitHub
official
gh-agent-task
github
ส่วนขยายงานตัวแทน GitHub CLI
official
github-copilot-agent-tips-and-tricks
github
เคล็ดลับและเทคนิคสำหรับการทำงานกับ Pull Requests ของ GitHub Copilot Agent
official
rust-coding-skill
github
Use this skill whenever editing `*.rs` files in the `rust/` SDK in order to write idiomatic, efficient, well-structured Rust code
official
ai-ready
github
ทำให้ repo ใดๆ พร้อมสำหรับ AI — วิเคราะห์โค้ดเบสของคุณและสร้าง AGENTS.md, copilot-instructions.md, ขั้นตอนการทำงาน CI, เทมเพลต issue และอื่นๆ ขุดรีวิว PR ของคุณ…
official