Files
second-brain/knowledge/methods/testing.md
T
kiskaadee fb0ac3de1b refactor(brain): reorganize repository structure
Replace subject-based folder hierarchy with a document-type-based layout.

Filesystem now establishes broad ownership and locality:
- knowledge/ → concepts/ | technologies/ | methods/
- homelab/ → projects/homelab/plans/ | projects/homelab/guides/
- journal/ → records/journal/
- projects/ flat files → per-project sub-folders with overview.md
- knowledge/parking-lot.md → inbox/

Deleted files:
- Root-level Backend Residency operational files (AGENTS.md, CURRENT.md,
  ROADMAP.md, SKILLS.md, todo.md, todo.txt) — belong in backend-residency repo
- docs/ directory entirely (ADRs belong in bitetrack-api, remaining files unused)
- learning/ directory (backend-residency.md deleted; cicd guide moved to knowledge/methods/)
- projects/README.md (replaced by individual project overview files)
2026-09-05 21:42:55 -05:00

731 B

Testing Notes

Unit Testing vs. Integration Testing

  • Unit Testing: Tests individual components (e.g. functions, helper methods) in isolation. External dependencies (like databases or APIs) are mocked.
  • Integration Testing: Tests how different parts of the system work together (e.g. hitting an endpoint to ensure it writes to a test database and returns the correct response).

pytest best practices

  • Use fixtures (@pytest.fixture) for setup and teardown logic (e.g., creating and rolling back database sessions).
  • Keep tests fast by using in-memory databases (sqlite) or a separate Postgres test database that gets cleaned/re-seeded before each test.
  • Use pytest-cov to measure and monitor code coverage.