[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6QQGS7N3ENQZR2Y5JBRYDHD":3,"skill-same:01M6QQGS7N3ENQZR2Y5JBRYDHD":46},{"skillNo":4,"name":5,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":21,"linkOnly":22,"markdownContent":23,"markdownBody":23,"frontMatter":24,"refName":25,"commitSha":26,"skillDirectory":27,"forksCount":13,"repositoryHtmlUrl":28,"repositoryHomepageUrl":6,"ownerHtmlUrl":29,"ownerBlogUrl":6,"ownerDescription":30,"updatedAt":31,"install":32,"resources":45},"01M6QQGS7N3ENQZR2Y5JBRYDHD","testing-conventions",null,"lfr-ai\u002Fcopier-fullstack-template","lfr-ai","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F233346551?v=4","01M6QPWTJWTSJV1TQTTY8ZPBYJ","Laurits Fromberg","01M6QPWTQ47BZGA4TH17H14N80",0,"MIT","https:\u002F\u002Fgithub.com\u002Flfr-ai\u002Fcopier-fullstack-template\u002Fblob\u002Fmain\u002Ftemplate\u002F.github\u002Fskills\u002Ftesting-conventions\u002FSKILL.md",[],[18,19,20],"testing","conventions","testing conventions","2026-11-10 10:12:30",false,"# Testing Conventions Skill\n\n## Test Structure\n\n```text\ntests\u002F\n└── unit\u002F\n    ├── conftest.py          # Shared fixtures\n    ├── test_services.py     # Service layer tests\n    ├── test_models.py       # Model handler tests\n    └── test_utils.py        # Utility function tests\n```\n\n### Source → Test Mapping\n\n| Source | Test |\n|--------|------|\n| `backend\u002Fsrc\u002F\u003Cproject_slug>\u002Fapplication\u002Forchestrator.py` | `tests\u002Funit\u002Ftest_orchestrator.py` |\n| `backend\u002Fsrc\u002F\u003Cproject_slug>\u002Fai\u002Fhandlers\u002Fgpt.py` | `tests\u002Funit\u002Ftest_gpt_handler.py` |\n| `backend\u002Fsrc\u002F\u003Cproject_slug>\u002Futils\u002Fvalidators.py` | `tests\u002Funit\u002Ftest_validators.py` |\n| `backend\u002Fsrc\u002F\u003Cproject_slug>\u002Fcore\u002Fpydantic_models.py` | `tests\u002Funit\u002Ftest_pydantic_models.py` |\n\n## Naming Conventions\n\n| Element | Pattern | Example |\n|---------|---------|---------|\n| Test file | `test_{module}.py` | `test_orchestrator.py` |\n| Test class | `Test{ClassName}` | `TestOrchestrator` |\n| Test method | `test_{method}_{scenario}` | `test_process_claim_empty_input` |\n| Fixture | `{noun}_fixture` or `sample_{noun}` | `sample_claim` |\n\n## Test Template\n\n```python\n\"\"\"Tests for {module_name}.\"\"\"\n\nimport pytest\nfrom hypothesis import given, strategies as st\n\nfrom \u003Cproject_slug>.{path} import {Symbol}\n\n\nclass TestSymbol:\n    \"\"\"Tests for Symbol.\"\"\"\n\n    def test_method_happy_path(self) -> None:\n        \"\"\"Method returns expected result for valid input.\"\"\"\n        # Arrange\n        input_data = ...\n\n        # Act\n        result = Symbol().method(input_data)\n\n        # Assert\n        assert result == expected\n\n    def test_method_empty_input(self) -> None:\n        \"\"\"Method handles empty input gracefully.\"\"\"\n        with pytest.raises(ValueError, match=\"cannot be empty\"):\n            Symbol().method(\"\")\n\n    @pytest.mark.parametrize(\n        \"input_val, expected\",\n        [\n            (1, \"one\"),\n            (2, \"two\"),\n            (3, \"three\"),\n        ],\n    )\n    def test_method_parametrized(\n        self, input_val: int, expected: str\n    ) -> None:\n        \"\"\"Method maps input to correct output.\"\"\"\n        assert Symbol().method(input_val) == expected\n\n    @given(st.integers(min_value=0, max_value=100))\n    def test_method_property(self, value: int) -> None:\n        \"\"\"Method output is always non-negative.\"\"\"\n        result = Symbol().method(value)\n        assert result >= 0\n```\n\n## Fixture Patterns\n\n### Factory Fixtures (preferred)\n\n```python\n@pytest.fixture\ndef claim_factory():\n    \"\"\"Create test claims with sensible defaults.\"\"\"\n    def _factory(**overrides) -> dict[str, object]:\n        defaults = {\n            \"id\": 1,\n            \"diagnosis\": \"Test diagnosis\",\n            \"status\": \"pending\",\n        }\n        return {**defaults, **overrides}\n    return _factory\n```\n\n### Shared Fixtures in conftest.py\n\n```python\n# tests\u002Funit\u002Fconftest.py\n\n@pytest.fixture\ndef sample_claim() -> dict[str, object]:\n    \"\"\"Minimal valid claim for testing.\"\"\"\n    return {\"id\": 1, \"diagnosis\": \"Test\"}\n```\n\n## Rules\n\n- All test functions MUST have `-> None` return type\n- Use `pytest.raises(ExcType, match=\"pattern\")` — always include `match`\n- Use `pytest.mark.parametrize` for data-driven tests\n- Use `monkeypatch` for environment variables (never `os.environ` directly)\n- Use `tmp_path` for filesystem tests\n- Mark slow tests: `@pytest.mark.slow`\n- Never test private methods (underscore-prefixed)\n- Never use `time.sleep()` in tests\n- Never hardcode field names — use registry constants\n- Never use mutable defaults in fixtures\n\n## Anti-Patterns\n\n| Anti-Pattern | Correct Pattern |\n|-------------|----------------|\n| Testing private methods | Test through public API |\n| `time.sleep()` in tests | Use `pytest-timeout` or mocks |\n| Shared mutable state | Factory fixtures |\n| `assert True` \u002F `assert not False` | Assert specific values |\n| Exact float comparison | `pytest.approx()` |\n| Ignoring test warnings | Fix root cause |\n",{},"main","f726ce2f2bb4e3bcc2f56c066598f4acd910c5ee","template\u002F.github\u002Fskills\u002Ftesting-conventions","https:\u002F\u002Fgithub.com\u002Flfr-ai\u002Fcopier-fullstack-template","https:\u002F\u002Fgithub.com\u002Flfr-ai","Optimizing for elegance","2026-07-20 12:19:48",{"source":7,"skillName":5,"commands":33,"prompt":43,"zipAvailable":44},[34,37,40],{"tool":35,"command":36},"npx","npx skills add lfr-ai\u002Fcopier-fullstack-template --skill testing-conventions",{"tool":38,"command":39},"bunx","bunx skills add lfr-ai\u002Fcopier-fullstack-template --skill testing-conventions",{"tool":41,"command":42},"pnpm","pnpm dlx skills add lfr-ai\u002Fcopier-fullstack-template --skill testing-conventions","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Flfr-ai\u002Fcopier-fullstack-template\u002Fblob\u002Fmain\u002Ftemplate\u002F.github\u002Fskills\u002Ftesting-conventions\u002FSKILL.md",true,[],[47,70,76,92,98,106],{"skillNo":48,"name":49,"nameZh":6,"description":50,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":51,"categories":52,"keywords":53,"publishedAt":21},"01M6QQGVYW8BZ3W165A5YMJ1PF","ui-ux-frontend","Frontend UX, accessibility, responsive layout, and Storybook interaction quality standards.","https:\u002F\u002Fgithub.com\u002Flfr-ai\u002Fcopier-fullstack-template\u002Fblob\u002Fmain\u002Ftemplate\u002F.github\u002Fskills\u002Fui-ux-frontend\u002FSKILL.md",[],[54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69],"ui ux","ui ux frontend","ui","ux","frontend","accessibility","frontend ux","interaction","layout","responsive","mdx","tsx","standards","quality","storybook","css",{"skillNo":71,"name":72,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":73,"categories":74,"keywords":75,"publishedAt":21},"01M6QQGQKA9Q6A147WXMS7QPGX","tdd","https:\u002F\u002Fgithub.com\u002Flfr-ai\u002Fcopier-fullstack-template\u002Fblob\u002Fmain\u002Ftemplate\u002F.github\u002Fskills\u002Ftdd\u002FSKILL.md",[],[72],{"skillNo":77,"name":78,"nameZh":6,"description":79,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":80,"categories":81,"keywords":82,"publishedAt":21},"01M6QQG5AZPRWSR6SSCCDDPAM3","shadcn-ui","shadcn\u002Fui component conventions and composition patterns","https:\u002F\u002Fgithub.com\u002Flfr-ai\u002Fcopier-fullstack-template\u002Fblob\u002Fmain\u002Ftemplate\u002F.github\u002Fskills\u002Fshadcn-ui\u002FSKILL.md",[],[83,56,84,85,86,19,87,88,65,89,90,91],"shadcn ui","shadcn","composition patterns","presentation","patterns","ui component","component","src","Composition",{"skillNo":93,"name":94,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":95,"categories":96,"keywords":97,"publishedAt":21},"01M6QQG3WMMB8X8C4T8PR7WBV4","sdd","https:\u002F\u002Fgithub.com\u002Flfr-ai\u002Fcopier-fullstack-template\u002Fblob\u002Fmain\u002Ftemplate\u002F.github\u002Fskills\u002Fsdd\u002FSKILL.md",[],[94],{"skillNo":99,"name":100,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":101,"categories":102,"keywords":103,"publishedAt":21},"01M6QQG241NAC5PQFXFD01NR16","quality-gate","https:\u002F\u002Fgithub.com\u002Flfr-ai\u002Fcopier-fullstack-template\u002Fblob\u002Fmain\u002Ftemplate\u002F.github\u002Fskills\u002Fquality-gate\u002FSKILL.md",[],[104,105,67],"gate","quality gate",{"skillNo":107,"name":108,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":109,"categories":110,"keywords":111,"publishedAt":21},"01M6QQFX0CC1JX53M62YZYE1YC","python-conventions","https:\u002F\u002Fgithub.com\u002Flfr-ai\u002Fcopier-fullstack-template\u002Fblob\u002Fmain\u002Ftemplate\u002F.github\u002Fskills\u002Fpython-conventions\u002FSKILL.md",[],[19,112,113],"python","python conventions"]