Instruction file imported from taksan/omniscribe (
.cursor/rules/testing-python.mdc). Copyright stays with the author.
Testing
- All tests must pass; failing suite is blocking.
- Don’t delete or weaken tests without explicit direction.
- Removing an API → remove or rewrite tests that referenced it (stale tests are bugs).
- Logic that can be unit-tested should have tests.
- Run
pytest tests/before considering work complete.
Python style
- Imports at top of file (inline only to break circular imports).
- No emojis in code unless the user asks.
- Prefer
@propertyfor simple derived values. - Use type hints consistently; remove unused imports.
- Prefer constants/enums over magic strings where the codebase already uses them (e.g. status enums in model layer — not in nodes per architecture rule).
- Use
Optional[T](orT | None) whenNoneis a valid return.
TDD
- Prefer test-first: add or adjust tests, then implement.
- When a bug is reported, try to write a test to reproduce, then implement fix