

Also from Kynth Studios


Also from Kynth Studios


Also from Kynth Studios
1234## Pytest Tests567- Look first to `app.factories.*` instead of `app.models.*` to generate any required database state8 - For example, to create and persist a `Distribution` record `DistributionFactory.save()`9 - If a factory doesn't exist for the model you are working with, create one.10 - You can customize one or more params in a factory using `DistributionFactory.save(host="custom_host.com)`11- Use `faker` factory to generate emails, etc.12- Do not mock or patch unless I instruct you to. Test as much of the application stack as possible in each test.13- If you get lazy attribute errors, or need a database session to share across logic, use the `db_session` fixture to fix the issue.14 - Note that when writing route tests a `db_session` is not needed for the logic inside of the route.15- When testing Stripe, use the sandbox API. Never mock out Stripe interactions unless explicitly told to.16- Omit obvious docstrs and comments. Add comments for non-obvious but easy-to-miss lines that are key to what the test is checking.17- If a docstring needs formatting, use markdown. Use Google Style.1819### Example Test2021Below is an example test, you'll notice the following:2223- Docstr is omitted since the purpose of the test is obvious24- Comment about the `county` is added since it's the main point of the test25- Newline between test setup, functionality under test, and assertions against result26- `api_app_url_path_for` helper is used instead of hardcoded routes2728```python29from app.generated.fastapi_typed_routes import api_app_url_path_for30import json3132def test_calculate_quote_unknown_county(client):33 payload = {34 "subscriber": {"age": 35, "gender": "M"},35 # fake county to ensure error is thrown36 "county": "NotACounty",37 }3839 response = client.post(40 api_app_url_path_for("composite_quote"),41 json=payload,42 )4344 assert_status(response, status.HTTP_422_UNPROCESSABLE_CONTENT)45```4647### File Structure4849* If there's more than a handful of tests in a folder, you should probably create subfolders.50* File name should be related to the file or primary class / functionality the test is covering. Do not add a component to the test name that exists in the test file path.51 * Example: `app/routes/unauthenticated/quote.py` should be `tests/routes/unauthenticated/quote_test.py`52* `tests/routes/{unauthenticated,authenticated}` and a handful of top-level test files for fastapi API route testing.53* `tests/integration/` for browser tests54
One repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| iloveitaly/llm-ide-rules.cursor/rules/python.mdc · 13 | Cursor rules | setupstyletypesdo-not | 88/100 | 14 days ago | |
| iloveitaly/llm-ide-rules.cursor/rules/alembic-migrations.mdc · 13 | Cursor rules | no sections | 50/100 | 14 days ago | |
| iloveitaly/llm-ide-rules.cursor/rules/fastapi.mdc · 13 | Cursor rules | no sections | 24/100 | 14 days ago | |
| iloveitaly/llm-ide-rules.cursor/rules/general.mdc · 13 | Cursor rules | teststyledo-notagent-behaviour+1 | 92/100 | 14 days ago | |
| iloveitaly/llm-ide-rules.cursor/rules/justfiles.mdc · 13 | Cursor rules | do-not | 31/100 | 14 days ago | |
| iloveitaly/llm-ide-rules.cursor/rules/pytest-integration-tests.mdc · 13 | Cursor rules | teststyletesting-strategy | 73/100 | 14 days ago | |
| iloveitaly/llm-ide-rules.cursor/rules/pytest-tests.mdc · 13 | Cursor rules | testarchtesting-strategyapi+1 | 61/100 | 14 days ago | |
| iloveitaly/llm-ide-rules.cursor/rules/python-app.mdc · 13 | Cursor rules | styledatabasedocs | 61/100 | 14 days ago | |
| iloveitaly/llm-ide-rules.cursor/rules/python-route-tests.mdc · 13 | Cursor rules | api | 24/100 | 14 days ago | |
| iloveitaly/llm-ide-rules.cursor/rules/react-router.mdc · 13 | Cursor rules | testing-strategy | 57/100 | 14 days ago | |
| iloveitaly/llm-ide-rules.cursor/rules/react.mdc · 13 | Cursor rules | styletesting-strategyuido-not | 60/100 | 14 days ago | |
| iloveitaly/llm-ide-rules.cursor/rules/shell.mdc · 13 | Cursor rules | no sections | 4/100 | 14 days ago | |
| iloveitaly/llm-ide-rules.cursor/rules/typescript.mdc · 13 | Cursor rules | styletypessecurity | 63/100 | 14 days ago | |
| iloveitaly/llm-ide-rules.github/copilot-instructions.md · 13 | Copilot instructions | teststyledo-notagent-behaviour+1 | 92/100 | 14 days ago | |
| iloveitaly/llm-ide-rules.github/instructions/alembic-migrations.instructions.md · 13 | Copilot instructions | no sections | 50/100 | 14 days ago | |
| iloveitaly/llm-ide-rules.github/instructions/fastapi.instructions.md · 13 | Copilot instructions | no sections | 16/100 | 14 days ago | |
| iloveitaly/llm-ide-rules.github/instructions/justfiles.instructions.md · 13 | Copilot instructions | do-not | 31/100 | 14 days ago | |
| iloveitaly/llm-ide-rules.github/instructions/pytest-integration-tests.instructions.md · 13 | Copilot instructions | teststyletesting-strategy | 65/100 | 14 days ago | |
| iloveitaly/llm-ide-rules.github/instructions/python-app.instructions.md · 13 | Copilot instructions | styledatabasedocs | 61/100 | 14 days ago | |
| iloveitaly/llm-ide-rules.github/instructions/python-route-tests.instructions.md · 13 | Copilot instructions | api | 16/100 | 14 days ago |
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| pytorch/pytorch.github/copilot-instructions.md · 102k | Copilot instructions | setupbuildteststyle+5 | 100/100 | 14 days ago | |
| hiyouga/LlamaFactory.github/copilot-instructions.md · 74k | Copilot instructions | setupbuildtestlint-format+5 | 97/100 | 13 days ago | |
| doubts-suplab/eeik-bootstrap.github/instructions/cdk-terraform.instructions.md · 1 | Copilot instructions | teststylearchtypes+2 | 96/100 | today | |
| darkmatter/nixmac.github/copilot-instructions.md · 25 | Copilot instructions | setupbuildtestlint-format+8 | 96/100 | 14 days ago | |
| doubts-suplab/eeik-bootstrap.github/instructions/java-quality.instructions.md · 1 | Copilot instructions | testlint-formatstyletesting-strategy+3 | 93/100 | today | |
| doubts-suplab/eeik-bootstrap.github/instructions/python.instructions.md · 1 | Copilot instructions | testlint-formatstyletypes+3 | 93/100 | today | |
| iloveitaly/llm-ide-rules.github/copilot-instructions.md · 13 | Copilot instructions | teststyledo-notagent-behaviour+1 | 92/100 | 14 days ago | |
| gasbasd/mtg-utils.github/copilot-instructions.md · 0 | Copilot instructions | setupbuildtestlint-format+3 | 89/100 | 8 days ago |
A badge carrying the measured quality of the strongest agent config file in this repository, out of 100. It reads from this index every time somebody loads your page, so it changes when the measurement changes and there is nothing to keep up to date. Free, no account, and the value is not something you or we can set by hand.
[](https://rulestack.kynth.studio/configs/iloveitaly-llm-ide-rules-github-instructions-pytest-tests-instructions)Would rather not hotlink us? Every badge is also served in shields.io’s endpoint schema, so shields renders the image and your readers never talk to our domain:
Published by Toolproof, the masthead over this index and eight others. The method behind the number is at toolproof.kynth.studio/methodology, and the whole thing is readable as JSON with no key at /api.