pytest-coverage
यह क्या करती है
यह tool जाँचने में मदद करता है कि आपका सारा code टेस्ट हो रहा है या नहीं। यह दिखाता है कि code का कौन सा हिस्सा टेस्ट नहीं हो रहा, ताकि आप और टेस्ट जोड़ सकें।
कब इस्तेमाल करें
- ✓जब आप चाहते हैं कि आपके टेस्ट पूरे code को कवर करें।
- ✓जब आपको वे हिस्से ढूँढने हों जिनके लिए कोई टेस्ट नहीं है।
- ✓जब लक्ष्य यह हो कि आपके 100% code का टेस्ट हो।
Skill का लिंक
https://github.com/github/awesome-copilot/blob/main/skills/pytest-coverage/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“मेरे project का test coverage जाँचो और बताओ कि कहाँ टेस्ट नहीं हैं।”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
tool आपके टेस्ट चलाता है और देखता है कि code की कौन सी लाइनें चलीं। यह एक रिपोर्ट बनाता है जिसमें वे लाइनें दिखती हैं जो टेस्ट नहीं हुईं, और उन पर '!' का निशान लगा होता है।
तकनीकी सामग्री (मूल 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.
अक्सर पूछे जाने वाले सवाल
'code coverage' का क्या मतलब है?
Code coverage एक माप है जो बताता है कि आपके टेस्ट ने code के किन हिस्सों को चलाया। लक्ष्य 100% code को कवर करना होता है।
'cov_annotate' directory क्या है?
यह एक folder है जिसमें tool ऐसी files सेव करता है जो लाइन-दर-लाइन दिखाती हैं कि code का कौन सा हिस्सा टेस्ट हुआ और कौन सा नहीं।
मुझे कैसे पता चलेगा कि मुझे और टेस्ट जोड़ने की ज़रूरत है?
अगर रिपोर्ट में किसी code file की कुछ लाइनों पर '!' लगा है, तो इसका मतलब है वे लाइनें टेस्ट नहीं हुईं और उनके लिए टेस्ट जोड़ने होंगे।
जानकारी
लेखक का मूल विवरण
Run pytest tests with coverage, discover lines missing coverage, and increase coverage to 100%.
repo: github/awesome-copilot
लोकप्रियता
- GitHub स्टार
- 40k
- रैंकिंग में स्थान
- #7349
- लाइसेंस
- MIT
- अपडेट की गई
- 15/10/2026
कमेंट
- …
इस repository की और skills
acquire-codebase-knowledge
40kआपके एजेंट को किसी मौजूदा code प्रोजेक्ट को समझने और उसका documentation बनाने में मदद करता है। यह नए लोगों को प्रोजेक्ट से जोड़ने या architecture का सार जानने में उपयोगी है।
acreadiness-assess
40kआपके एजेंट को किसी प्रोजेक्ट की AI के लिए तैयारी जाँचने और रिपोर्ट बनाने देता है। यह समझने में उपयोगी है कि प्रोजेक्ट AI tools इस्तेमाल करने के लिए कितना तैयार है।
acreadiness-generate-instructions
40kआपके एजेंट को assessment के आधार पर AI tools के लिए निर्देश बनाने में मदद करता है। यह बताता है कि AI कोड के साथ बेहतर कैसे काम करे और पहचानी गई कमियाँ कैसे दूर हों।
acreadiness-policy
40kआपके एजेंट को AI प्रोजेक्ट assessment के लिए नीतियाँ तय करने या लागू करने में मदद करता है। यह प्रोजेक्ट्स के मूल्यांकन को मानक बनाने और compliance सुनिश्चित करने में उपयोगी है।
मिलती-जुलती skills
test-driven-development
311kयह आपके एजेंट को किसी भी फ़ीचर या सुधार से पहले पहले असफल होने वाला टेस्ट लिखना, उसे असफल होते देखना, फिर पास करने वाला सबसे छोटा कोड लिखना सिखाती है।
verification-before-completion
311kयह आपके एजेंट को किसी काम, सुधार या build के पूरा या पास होने का दावा करने से पहले असली जांच चलाकर उसका आउटपुट पढ़ना सिखाती है।
migrate-to-shoehorn
310kआपकी टेस्ट फ़ाइलों में जोखिम भरे type casts की जगह shoehorn लाइब्रेरी लगाती है, ताकि टेस्ट अधूरे डेटा से भी type checks पास कर सकें।