Skillpedia
الاختبار48k · #5553

python-testing-patterns

ما الذي تفعله

يعلّمك هذا الدليل كيفية اختبار كود Python بشكل شامل. يغطي تقنيات مثل استخدام 'pytest' وإنشاء 'fixtures' (إعدادات جاهزة مسبقًا) و'mocking' (محاكاة أجزاء من الكود)، وتطوير البرنامج باستخدام التطوير المدفوع بالاختبار (TDD).

متى تستخدمها

  • ✓عند كتابة اختبارات لكود Python الخاص بك.
  • ✓عند إعداد مجموعة اختبارات وتنظيمها.
  • ✓عند اتباع ممارسات TDD في التطوير.

رابط المهارة

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/python-testing-patterns/SKILL.md

انسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.

طريقة الاستخدام

أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.

رسالة جاهزة للصق

استخدم هذه المهارة لمساعدتي: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/python-testing-patterns/SKILL.md اقرأ ملف SKILL.md في هذا الرابط ونفّذ تعليماته لمهمتي.
تريد أن يجد الذكاء الاصطناعي مهارات مثل هذه بنفسه؟ثبّت خادم Skillpedia MCP المجاني: سطر واحد، ويبحث في 15,000+ مهارة قبل كل مهمة.ثبّته في دقيقة واحدة →

مثال على ما تطلبه من الذكاء الاصطناعي

“كيف أكتب اختبارات لدالة Python تحسب متوسط قائمة من الأرقام؟”

5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.

كيف تعمل

يستخدم الذكاء الاصطناعي هذا الدليل لتوضيح كيفية كتابة اختبارات Python فعّالة. يشرح استخدام أدوات مثل pytest وتقنيات محاكاة الاعتماديات، لضمان أن كودك يعمل بشكل صحيح.

المحتوى التقني (ملف SKILL.md الأصلي)

النص الأصلي من المؤلف، مباشرة من GitHub.

Python Testing Patterns

Comprehensive guide to implementing robust testing strategies in Python using pytest, fixtures, mocking, parameterization, and test-driven development practices.

Use this skill when

  • Writing unit tests for Python code
  • Setting up test suites and test infrastructure
  • Implementing test-driven development (TDD)
  • Creating integration tests for APIs and services
  • Mocking external dependencies and services
  • Testing async code and concurrent operations
  • Setting up continuous testing in CI/CD
  • Implementing property-based testing
  • Testing database operations
  • Debugging failing tests

Do not use this skill when

  • The task is unrelated to python testing patterns
  • You need a different domain or tool outside this scope

Instructions

  • Clarify goals, constraints, and required inputs.
  • Apply relevant best practices and validate outcomes.
  • Provide actionable steps and verification.
  • If detailed examples are required, open resources/implementation-playbook.md.

Resources

  • resources/implementation-playbook.md for detailed patterns and examples.

Limitations

  • Use this skill only when the task clearly matches the scope described above.
  • Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
  • Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.
الأسئلة الشائعة

ما هو pytest؟

pytest أداة شائعة تسهّل كتابة الاختبارات لكود Python.

ما هي «fixtures»؟

هي إعدادات أولية يمكن إعادة استخدامها عبر عدة اختبارات لتجهيز بيئة الاختبار.

ما هو «mocking»؟

هو أسلوب لمحاكاة أجزاء من الكود أو الخدمات الخارجية التي يعتمد عليها الكود، مما يتيح اختبار كل وحدة على حدة.

التفاصيل

الوصف الأصلي من المؤلف

Implement comprehensive testing strategies with pytest, fixtures, mocking, and test-driven development. Use when writing Python tests, setting up test suites, or implementing testing best practices.

repo: sickn33/agentic-awesome-skills

الشعبية

نجوم GitHub
48k
الترتيب
#5553
الترخيص
MIT
آخر تحديث
15‏/10‏/2026

هل هذه المهارة مفيدة؟

0

سجّل الدخول للتصويت.

التعليقات

  • …

المزيد من المهارات من هذا المستودع

مهارات مشابهة