Skip to content

[Tests] Add unit tests for infrastructure/sqlite/task_repository.py #42

Description

@realrazdev

Summary

The src/raztodo/infrastructure/sqlite/task_repository.py module currently has missing test coverage:

Name                                                        Stmts   Miss Branch BrPart  Cover   Missing
--------------------------------------------------------------------------------------------------------
src/raztodo/infrastructure/sqlite/task_repository.py          157     20     34      4  87.43%   61-64, 110, 137-138, 157, 177, 239, 277-278, 280-285, 288, 298, 302->exit

This issue is limited to adding unit tests only. No production code changes should be necessary unless a bug is discovered.

Tasks

  • Add unit tests to cover the missing code paths and branches.
  • Use pytest.
  • Mock external dependencies where appropriate.
  • Ensure all existing tests continue to pass.

Validation

Run the test suite:

uv run coverage run -m pytest

Then verify the coverage report:

uv run coverage report -m

The missing lines and branches listed above should no longer appear in the Missing column.

Note

If the web-layer tests fail due to a missing fastapi installation, you can safely ignore those failures for this issue. fastapi is an optional dependency and is only required for running the web-layer tests.

Acceptance Criteria

  • The targeted missing code paths and branches are covered by tests.
  • No production code changes unless absolutely necessary.
  • All tests pass.
  • uv run coverage report -m confirms that the targeted missing lines are no longer reported.

What's next?

Thanks for contributing! We'd love to see another PR from you.

Looking for another task? Browse the open issues.

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueGood for newcomershelp wantedExtra attention is neededtestsUnit tests and test coverage improvements.

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions