[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7F3NB5AXN659BPMG9MD9GPW":3,"skill-same:01M7F3NB5AXN659BPMG9MD9GPW":58},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":30,"commitSha":31,"skillDirectory":32,"forksCount":33,"repositoryHtmlUrl":34,"repositoryHomepageUrl":6,"ownerHtmlUrl":35,"ownerBlogUrl":6,"ownerDescription":36,"updatedAt":37,"install":38,"resources":51},"01M7F3NB5AXN659BPMG9MD9GPW","pytest-skill",null,"Generates production-grade pytest tests in Python with fixtures, parametrize, markers, mocking, and conftest patterns. Use when user mentions \"pytest\", \"conftest\", \"@pytest.fixture\", \"@pytest.mark\", \"Python test\".","lza6\u002FArmor-piercing-system-prompts","lza6","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F128880206?v=4","01M7EB3K7WPX5T28EJ2NVHE6EG","Chinese-tingfeng","01M7EB3K97E1KQ16QWKJMFNGX8",11,"MIT","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F05-技能与代理开发\u002Fpytest-skill\u002FSKILL.md",[],[],"2026-11-16 10:05:34",false,"---\nname: pytest-skill\ndescription: \"Generates production-grade pytest tests in Python with fixtures, parametrize, markers, mocking, and conftest patterns. Use when user mentions \\\"pytest\\\", \\\"conftest\\\", \\\"@pytest.fixture\\\", \\\"@pytest.mark\\\", \\\"Python test\\\".\"\nrisk: critical\nsource: https:\u002F\u002Fgithub.com\u002FLambdaTest\u002Fagent-skills\u002Ftree\u002Fmain\u002Fpytest-skill\nsource_repo: LambdaTest\u002Fagent-skills\nsource_type: community\ndate_added: 2026-07-01\nlicense: MIT\nlicense_source: https:\u002F\u002Fgithub.com\u002FLambdaTest\u002Fagent-skills\u002Fblob\u002Fmain\u002FLICENSE\n---\n\n# Pytest Testing Skill\n## When to Use\n\nUse this skill when you need generates production-grade pytest tests in Python with fixtures, parametrize, markers, mocking, and conftest patterns. Use when user mentions \"pytest\", \"conftest\", \"@pytest.fixture\", \"@pytest.mark\", \"Python test\". Triggers on: \"pytest\", \"conftest\", \"Python test\", \"parametrize\", \"Python...\n\n\n## Core Patterns\n\n### Basic Test\n\n```python\nimport pytest\n\ndef test_addition():\n    assert 2 + 3 == 5\n\ndef test_exception():\n    with pytest.raises(ValueError, match=\"invalid\"):\n        int(\"not_a_number\")\n\nclass TestCalculator:\n    def test_add(self):\n        calc = Calculator()\n        assert calc.add(2, 3) == 5\n\n    def test_divide_by_zero(self):\n        with pytest.raises(ZeroDivisionError):\n            Calculator().divide(10, 0)\n```\n\n### Fixtures\n\n```python\n@pytest.fixture\ndef calculator():\n    return Calculator()\n\n@pytest.fixture\ndef db_connection():\n    conn = Database.connect(\"test_db\")\n    yield conn  # teardown after yield\n    conn.rollback()\n    conn.close()\n\n@pytest.fixture(scope=\"module\")\ndef api_client():\n    client = APIClient(base_url=\"http:\u002F\u002Flocalhost:8000\")\n    yield client\n    client.logout()\n\n# conftest.py - shared fixtures\n@pytest.fixture(autouse=True)\ndef reset_state():\n    State.reset()\n    yield\n    State.cleanup()\n\n# Usage\ndef test_add(calculator):\n    assert calculator.add(2, 3) == 5\n```\n\n### Parametrize\n\n```python\n@pytest.mark.parametrize(\"input,expected\", [\n    (\"hello\", 5), (\"\", 0), (\"pytest\", 6),\n])\ndef test_string_length(input, expected):\n    assert len(input) == expected\n\n@pytest.mark.parametrize(\"a,b,expected\", [\n    (2, 3, 5), (-1, 1, 0), (0, 0, 0),\n])\ndef test_add(calculator, a, b, expected):\n    assert calculator.add(a, b) == expected\n```\n\n### Markers\n\n```python\n@pytest.mark.slow\ndef test_large_dataset(): ...\n\n@pytest.mark.skip(reason=\"Not implemented\")\ndef test_future_feature(): ...\n\n@pytest.mark.skipif(sys.platform == \"win32\", reason=\"Unix only\")\ndef test_unix_permissions(): ...\n\n@pytest.mark.xfail(reason=\"Known bug #123\")\ndef test_known_bug(): ...\n```\n\n### Mocking\n\n```python\nfrom unittest.mock import patch, MagicMock\n\ndef test_send_email(mocker):\n    mock_smtp = mocker.patch(\"myapp.email.smtplib.SMTP\")\n    send_welcome_email(\"user@test.com\")\n    mock_smtp.return_value.sendmail.assert_called_once()\n\ndef test_api_call(mocker):\n    mock_response = mocker.Mock()\n    mock_response.status_code = 200\n    mock_response.json.return_value = {\"users\": [{\"name\": \"Alice\"}]}\n    mocker.patch(\"myapp.service.requests.get\", return_value=mock_response)\n    users = get_users()\n    assert len(users) == 1\n\n@patch(\"myapp.service.database\")\ndef test_save_user(mock_db):\n    mock_db.save.return_value = True\n    assert save_user({\"name\": \"Alice\"}) is True\n    mock_db.save.assert_called_once()\n```\n\n### Assertions\n\n```python\nassert x == y\nassert x != y\nassert x in collection\nassert isinstance(obj, MyClass)\nassert 0.1 + 0.2 == pytest.approx(0.3)\n\nwith pytest.raises(ValueError) as exc_info:\n    raise ValueError(\"bad\")\nassert \"bad\" in str(exc_info.value)\n```\n\n### Anti-Patterns\n\n| Bad | Good | Why |\n|-----|------|-----|\n| `self.assertEqual()` | `assert x == y` | pytest rewrites give better output |\n| Setup in `__init__` | `@pytest.fixture` | Lifecycle management |\n| Global state | Fixture with `yield` | Proper cleanup |\n| Huge test functions | Small focused tests | Easier debugging |\n\n## Quick Reference\n\n| Task | Command |\n|------|---------|\n| Run all | `pytest` |\n| Run file | `pytest tests\u002Ftest_login.py` |\n| Run specific | `pytest tests\u002Ftest_login.py::test_login_success` |\n| By marker | `pytest -m slow` |\n| By keyword | `pytest -k \"login and not invalid\"` |\n| Verbose | `pytest -v` |\n| Stop first fail | `pytest -x` |\n| Last failed | `pytest --lf` |\n| Coverage | `pytest --cov=myapp --cov-report=html` |\n| Parallel | `pytest -n auto` (pytest-xdist) |\n\n## pyproject.toml\n\n```toml\n[tool.pytest.ini_options]\ntestpaths = [\"tests\"]\nmarkers = [\"slow: slow tests\", \"integration: integration tests\"]\naddopts = \"-v --tb=short\"\n```\n\n## Deep Patterns\n\nFor production-grade patterns, see `reference\u002Fplaybook.md`:\n\n| Section | What's Inside |\n|---------|--------------|\n| §1 Config | pytest.ini + pyproject.toml with markers, coverage |\n| §2 Fixtures | Scoping, factories, teardown, autouse, tmp_path |\n| §3 Parametrize | Basic, with IDs, cartesian, indirect |\n| §4 Mocking | pytest-mock, monkeypatch, spies, env vars |\n| §5 Async | pytest-asyncio, async fixtures, async client |\n| §6 Exceptions | pytest.raises(match=), warnings |\n| §7 Markers & Plugins | Custom markers, collection hooks |\n| §8 Class-Based | Nested classes, autouse setup |\n| §9 CI\u002FCD | GitHub Actions matrix, coverage gates |\n| §10 Debugging Table | 10 common problems with fixes |\n| §11 Best Practices | 15-item production checklist |\n\n## Limitations\n\n- Use this skill only when the task clearly matches its upstream source and local project context.\n- Verify commands, generated code, dependencies, credentials, and external service behavior before applying changes.\n- Do not treat examples as a substitute for environment-specific tests, security review, or user approval for destructive or costly actions.\n","# Pytest Testing Skill\n## When to Use\n\nUse this skill when you need generates production-grade pytest tests in Python with fixtures, parametrize, markers, mocking, and conftest patterns. Use when user mentions \"pytest\", \"conftest\", \"@pytest.fixture\", \"@pytest.mark\", \"Python test\". Triggers on: \"pytest\", \"conftest\", \"Python test\", \"parametrize\", \"Python...\n\n\n## Core Patterns\n\n### Basic Test\n\n```python\nimport pytest\n\ndef test_addition():\n    assert 2 + 3 == 5\n\ndef test_exception():\n    with pytest.raises(ValueError, match=\"invalid\"):\n        int(\"not_a_number\")\n\nclass TestCalculator:\n    def test_add(self):\n        calc = Calculator()\n        assert calc.add(2, 3) == 5\n\n    def test_divide_by_zero(self):\n        with pytest.raises(ZeroDivisionError):\n            Calculator().divide(10, 0)\n```\n\n### Fixtures\n\n```python\n@pytest.fixture\ndef calculator():\n    return Calculator()\n\n@pytest.fixture\ndef db_connection():\n    conn = Database.connect(\"test_db\")\n    yield conn  # teardown after yield\n    conn.rollback()\n    conn.close()\n\n@pytest.fixture(scope=\"module\")\ndef api_client():\n    client = APIClient(base_url=\"http:\u002F\u002Flocalhost:8000\")\n    yield client\n    client.logout()\n\n# conftest.py - shared fixtures\n@pytest.fixture(autouse=True)\ndef reset_state():\n    State.reset()\n    yield\n    State.cleanup()\n\n# Usage\ndef test_add(calculator):\n    assert calculator.add(2, 3) == 5\n```\n\n### Parametrize\n\n```python\n@pytest.mark.parametrize(\"input,expected\", [\n    (\"hello\", 5), (\"\", 0), (\"pytest\", 6),\n])\ndef test_string_length(input, expected):\n    assert len(input) == expected\n\n@pytest.mark.parametrize(\"a,b,expected\", [\n    (2, 3, 5), (-1, 1, 0), (0, 0, 0),\n])\ndef test_add(calculator, a, b, expected):\n    assert calculator.add(a, b) == expected\n```\n\n### Markers\n\n```python\n@pytest.mark.slow\ndef test_large_dataset(): ...\n\n@pytest.mark.skip(reason=\"Not implemented\")\ndef test_future_feature(): ...\n\n@pytest.mark.skipif(sys.platform == \"win32\", reason=\"Unix only\")\ndef test_unix_permissions(): ...\n\n@pytest.mark.xfail(reason=\"Known bug #123\")\ndef test_known_bug(): ...\n```\n\n### Mocking\n\n```python\nfrom unittest.mock import patch, MagicMock\n\ndef test_send_email(mocker):\n    mock_smtp = mocker.patch(\"myapp.email.smtplib.SMTP\")\n    send_welcome_email(\"user@test.com\")\n    mock_smtp.return_value.sendmail.assert_called_once()\n\ndef test_api_call(mocker):\n    mock_response = mocker.Mock()\n    mock_response.status_code = 200\n    mock_response.json.return_value = {\"users\": [{\"name\": \"Alice\"}]}\n    mocker.patch(\"myapp.service.requests.get\", return_value=mock_response)\n    users = get_users()\n    assert len(users) == 1\n\n@patch(\"myapp.service.database\")\ndef test_save_user(mock_db):\n    mock_db.save.return_value = True\n    assert save_user({\"name\": \"Alice\"}) is True\n    mock_db.save.assert_called_once()\n```\n\n### Assertions\n\n```python\nassert x == y\nassert x != y\nassert x in collection\nassert isinstance(obj, MyClass)\nassert 0.1 + 0.2 == pytest.approx(0.3)\n\nwith pytest.raises(ValueError) as exc_info:\n    raise ValueError(\"bad\")\nassert \"bad\" in str(exc_info.value)\n```\n\n### Anti-Patterns\n\n| Bad | Good | Why |\n|-----|------|-----|\n| `self.assertEqual()` | `assert x == y` | pytest rewrites give better output |\n| Setup in `__init__` | `@pytest.fixture` | Lifecycle management |\n| Global state | Fixture with `yield` | Proper cleanup |\n| Huge test functions | Small focused tests | Easier debugging |\n\n## Quick Reference\n\n| Task | Command |\n|------|---------|\n| Run all | `pytest` |\n| Run file | `pytest tests\u002Ftest_login.py` |\n| Run specific | `pytest tests\u002Ftest_login.py::test_login_success` |\n| By marker | `pytest -m slow` |\n| By keyword | `pytest -k \"login and not invalid\"` |\n| Verbose | `pytest -v` |\n| Stop first fail | `pytest -x` |\n| Last failed | `pytest --lf` |\n| Coverage | `pytest --cov=myapp --cov-report=html` |\n| Parallel | `pytest -n auto` (pytest-xdist) |\n\n## pyproject.toml\n\n```toml\n[tool.pytest.ini_options]\ntestpaths = [\"tests\"]\nmarkers = [\"slow: slow tests\", \"integration: integration tests\"]\naddopts = \"-v --tb=short\"\n```\n\n## Deep Patterns\n\nFor production-grade patterns, see `reference\u002Fplaybook.md`:\n\n| Section | What's Inside |\n|---------|--------------|\n| §1 Config | pytest.ini + pyproject.toml with markers, coverage |\n| §2 Fixtures | Scoping, factories, teardown, autouse, tmp_path |\n| §3 Parametrize | Basic, with IDs, cartesian, indirect |\n| §4 Mocking | pytest-mock, monkeypatch, spies, env vars |\n| §5 Async | pytest-asyncio, async fixtures, async client |\n| §6 Exceptions | pytest.raises(match=), warnings |\n| §7 Markers & Plugins | Custom markers, collection hooks |\n| §8 Class-Based | Nested classes, autouse setup |\n| §9 CI\u002FCD | GitHub Actions matrix, coverage gates |\n| §10 Debugging Table | 10 common problems with fixes |\n| §11 Best Practices | 15-item production checklist |\n\n## Limitations\n\n- Use this skill only when the task clearly matches its upstream source and local project context.\n- Verify commands, generated code, dependencies, credentials, and external service behavior before applying changes.\n- Do not treat examples as a substitute for environment-specific tests, security review, or user approval for destructive or costly actions.\n",{"name":5,"risk":24,"source":25,"license":15,"date_added":26,"description":7,"source_repo":27,"source_type":28,"license_source":29},"critical","https:\u002F\u002Fgithub.com\u002FLambdaTest\u002Fagent-skills\u002Ftree\u002Fmain\u002Fpytest-skill",1782864000000,"LambdaTest\u002Fagent-skills","community","https:\u002F\u002Fgithub.com\u002FLambdaTest\u002Fagent-skills\u002Fblob\u002Fmain\u002FLICENSE","main","d69096e239f2a89aabc2cd078c47664a9d3b1e11","05-技能与代理开发\u002Fpytest-skill",3,"https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts","https:\u002F\u002Fgithub.com\u002Flza6","个人vx：Tf00798\r\n个人✈：@TFGY999","2026-10-08 14:29:22",{"source":8,"skillName":5,"commands":39,"prompt":49,"zipAvailable":50},[40,43,46],{"tool":41,"command":42},"npx","npx skills add lza6\u002FArmor-piercing-system-prompts --skill pytest-skill",{"tool":44,"command":45},"bunx","bunx skills add lza6\u002FArmor-piercing-system-prompts --skill pytest-skill",{"tool":47,"command":48},"pnpm","pnpm dlx skills add lza6\u002FArmor-piercing-system-prompts --skill pytest-skill","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F05-技能与代理开发\u002Fpytest-skill\u002FSKILL.md",true,[52],{"path":53,"resourceType":54,"resourceTypeDesc":55,"sizeBytes":56,"sourceHtmlUrl":57},"reference\u002Fplaybook.md","REFERENCE","参考文档",10967,"https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F05-技能与代理开发\u002Fpytest-skill\u002Freference\u002Fplaybook.md",[59,66,71,78,85,92],{"skillNo":60,"name":61,"nameZh":6,"description":62,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":63,"categories":64,"keywords":65,"publishedAt":19},"01M7FFG485KY83TD6HSC4YPCMC","obsidian-clipper-template-creator","Guide for creating templates for the Obsidian Web Clipper. Use when you want to create a new clipping template, understand available variables, or format clipped content.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobsidian-clipper-template-creator\u002FSKILL.md",[],[],{"skillNo":67,"name":61,"nameZh":6,"description":62,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":68,"categories":69,"keywords":70,"publishedAt":19},"01M7FFG0T6AZ0STEJPSB3CX84K","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobsidian-clipper-template-creator-antigravity-awesome-skills-main\u002FSKILL.md",[],[],{"skillNo":72,"name":73,"nameZh":6,"description":74,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":19},"01M7FFFY0QEM14SKWPDYGMXM2P","python-api","Programmatic Object-Detection-Metrics API guidance for BoundingBox, BoundingBoxes, Evaluator, enums, coordinate conversion, AP\u002FmAP semantics, and source-style import diagnostics.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002Fsub-skills\u002Fpython-api\u002FSKILL.md",[],[],{"skillNo":79,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":19},"01M7FFFVZQZ2GJ0C0TGP7JHD20","file-evaluation","Folder-based PASCAL VOC AP\u002FmAP evaluation from ground-truth and detection text files.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002Fsub-skills\u002Ffile-evaluation\u002FSKILL.md",[],[],{"skillNo":86,"name":87,"nameZh":6,"description":88,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":19},"01M7FFFSFNYSE77SJ6PE1CK2DA","object-detection-metrics","Guides legacy Object-Detection-Metrics PASCAL VOC AP\u002FmAP evaluation from detection text folders and direct Python API classes.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002FSKILL.md",[],[],{"skillNo":93,"name":94,"nameZh":6,"description":95,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":96,"categories":97,"keywords":98,"publishedAt":19},"01M7FFFP0GCK1RVXBCPQ8APBMT","nx-workspace-patterns","Configure and optimize Nx monorepo workspaces. Use when setting up Nx, configuring project boundaries, optimizing build caching, or implementing affected commands.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fnx-workspace-patterns\u002FSKILL.md",[],[]]