pytest-gen

द्वारा github

व्यापक pytest परीक्षण उत्पन्न करें - परीक्षण उत्पन्न करते समय, परीक्षण सूट बनाते समय, या Python कोड का परीक्षण करते समय उपयोग करें

npx skills add https://github.com/github/copilot-cli-for-beginners --skill pytest-gen

Pytest Generation Skill

When generating tests, follow this structure.

Test Organization

  • Group tests by function under test
  • Use @pytest.mark.parametrize for multiple inputs
  • Use fixtures for shared setup
  • Follow arrange/act/assert pattern

Coverage Requirements

  • Happy path (expected usage)
  • Edge cases (empty strings, None, boundary values)
  • Error cases (invalid input, file not found, wrong types)
  • Integration (functions working together)

Template

import pytest
from module_under_test import function_to_test


@pytest.fixture
def sample_data():
    """Provide shared test data."""
    return {"key": "value"}


class TestFunctionName:
    """Tests for function_name."""

    def test_happy_path(self, sample_data):
        result = function_to_test(valid_input)
        assert result == expected_output

    def test_empty_input(self):
        result = function_to_test("")
        assert result == expected_for_empty

    @pytest.mark.parametrize("input_val,expected", [
        ("valid", True),
        ("", False),
        (None, False),
    ])
    def test_various_inputs(self, input_val, expected):
        assert function_to_test(input_val) == expected

github की और Skills

console-rendering
github
Go में struct टैग-आधारित कंसोल रेंडरिंग सिस्टम का उपयोग करने के निर्देश
official
github-pr-query
github
jq तर्क समर्थन के साथ GitHub पुल अनुरोधों को कुशलतापूर्वक क्वेरी करें
official
jqschema
github
JSON डेटा से संरचना और प्रकार की जानकारी निकालने वाली JSON स्कीमा खोज उपयोगिता
official
gh-agent-session
github
GitHub CLI एजेंट सत्र विस्तार
official
gh-agent-task
github
GitHub CLI एजेंट कार्य विस्तार
official
github-copilot-agent-tips-and-tricks
github
GitHub Copilot Agent PRs के साथ काम करने के लिए टिप्स और ट्रिक्स
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
किसी भी रिपॉजिटरी को AI-तैयार बनाएं — आपके कोडबेस का विश्लेषण करता है और AGENTS.md, copilot-instructions.md, CI वर्कफ़्लो, इश्यू टेम्पलेट और अधिक जनरेट करता है। आपकी PR समीक्षा को माइन करता है…
official