{"id":"57778dc5-7e95-4a1c-b6a3-23cd44bda710","slug":"nkchivas-openclaw-skill-python-testing-patterns","name":"python-testing-patterns","description":"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.","canonicalUrl":"https://xpersona.co/skill/nkchivas-openclaw-skill-python-testing-patterns","sourceUrl":"https://github.com/nkchivas/openclaw-skill-python-testing-patterns","homepage":null,"source":"GITHUB_OPENCLEW","vendor":{"slug":"nkchivas","label":"Nkchivas","url":"https://github.com/nkchivas/openclaw-skill-python-testing-patterns"},"protocols":["OPENCLEW"],"capabilities":[],"trustScore":null,"trustConfidence":"unknown","artifactCount":0,"benchmarkCount":0,"lastRelease":null,"freshnessAt":"2026-02-24T19:44:23.834Z","freshnessLabel":"Feb 24, 2026","securityReviewed":true,"openapiReady":false,"stats":[{"label":"Trust score","value":"Unknown"},{"label":"Compatibility","value":"OpenClaw"},{"label":"Freshness","value":"Feb 24, 2026"},{"label":"Vendor","value":"Nkchivas"},{"label":"Artifacts","value":"0"},{"label":"Benchmarks","value":"0"},{"label":"Last release","value":"Unpublished"}],"factsPreview":[{"factKey":"docs_crawl","category":"integration","label":"Crawlable docs","value":"6 indexed pages on the official domain","href":"https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fopenclaw%2Fskills%2Ftree%2Fmain%2Fskills%2Fasleep123%2Fcaldav-calendar","sourceUrl":"https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fopenclaw%2Fskills%2Ftree%2Fmain%2Fskills%2Fasleep123%2Fcaldav-calendar","sourceType":"search_document","confidence":"medium","observedAt":"2026-04-15T05:03:46.393Z","isPublic":true},{"factKey":"vendor","category":"vendor","label":"Vendor","value":"Nkchivas","href":"https://github.com/nkchivas/openclaw-skill-python-testing-patterns","sourceUrl":"https://github.com/nkchivas/openclaw-skill-python-testing-patterns","sourceType":"profile","confidence":"medium","observedAt":"2026-02-24T19:44:24.841Z","isPublic":true},{"factKey":"protocols","category":"compatibility","label":"Protocol compatibility","value":"OpenClaw","href":"https://xpersona.co/api/v1/agents/nkchivas-openclaw-skill-python-testing-patterns/contract","sourceUrl":"https://xpersona.co/api/v1/agents/nkchivas-openclaw-skill-python-testing-patterns/contract","sourceType":"contract","confidence":"medium","observedAt":"2026-02-24T19:44:24.841Z","isPublic":true},{"factKey":"handshake_status","category":"security","label":"Handshake status","value":"UNKNOWN","href":"https://xpersona.co/api/v1/agents/nkchivas-openclaw-skill-python-testing-patterns/trust","sourceUrl":"https://xpersona.co/api/v1/agents/nkchivas-openclaw-skill-python-testing-patterns/trust","sourceType":"trust","confidence":"medium","observedAt":null,"isPublic":true}],"highlights":["Trust evidence available"],"agentCard":{"name":"python-testing-patterns","description":"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.","source":"GITHUB_OPENCLEW","sourceId":"github:1164433316","repository":"https://github.com/nkchivas/openclaw-skill-python-testing-patterns","documentation":"https://xpersona.co/skill/nkchivas-openclaw-skill-python-testing-patterns/agent/nkchivas-openclaw-skill-python-testing-patterns","protocols":["OPENCLEW"],"languages":["typescript"],"install":{"command":"git clone https://github.com/nkchivas/openclaw-skill-python-testing-patterns.git","ecosystem":"git"},"examples":[{"kind":"example","language":"python","snippet":"# test_example.py\ndef add(a, b):\n    return a + b\n\ndef test_add():\n    \"\"\"Basic test example.\"\"\"\n    result = add(2, 3)\n    assert result == 5\n\ndef test_add_negative():\n    \"\"\"Test with negative numbers.\"\"\"\n    assert add(-1, 1) == 0\n\n# Run with: pytest test_example.py"},{"kind":"example","language":"python","snippet":"# test_calculator.py\nimport pytest\n\nclass Calculator:\n    \"\"\"Simple calculator for testing.\"\"\"\n\n    def add(self, a: float, b: float) -> float:\n        return a + b\n\n    def subtract(self, a: float, b: float) -> float:\n        return a - b\n\n    def multiply(self, a: float, b: float) -> float:\n        return a * b\n\n    def divide(self, a: float, b: float) -> float:\n        if b == 0:\n            raise ValueError(\"Cannot divide by zero\")\n        return a / b\n\n\ndef test_addition():\n    \"\"\"Test addition.\"\"\"\n    calc = Calculator()\n    assert calc.add(2, 3) == 5\n    assert calc.add(-1, 1) == 0\n    assert calc.add(0, 0) == 0\n\n\ndef test_subtraction():\n    \"\"\"Test subtraction.\"\"\"\n    calc = Calculator()\n    assert calc.subtract(5, 3) == 2\n    assert calc.subtract(0, 5) == -5\n\n\ndef test_multiplication():\n    \"\"\"Test multiplication.\"\"\"\n    calc = Calculator()\n    assert calc.multiply(3, 4) == 12\n    assert calc.multiply(0, 5) == 0\n\n\ndef test_division():\n    \"\"\"Test division.\"\"\"\n    calc = Calculator()\n    assert calc.divide(6, 3) == 2\n    assert calc.divide(5, 2) == 2.5\n\n\ndef test_division_by_zero():\n    \"\"\"Test division by zero raises error.\"\"\"\n    calc = Calculator()\n    with pytest.raises(ValueError, match=\"Cannot divide by zero\"):\n        calc.divide(5, 0)"}]}}