Skip to content

feat: Refactor and improve test suite#22

Merged
randomparity merged 5 commits into
mainfrom
feat/improve-test-coverage
Sep 8, 2025
Merged

feat: Refactor and improve test suite#22
randomparity merged 5 commits into
mainfrom
feat/improve-test-coverage

Conversation

@randomparity

Copy link
Copy Markdown
Owner

This commit significantly improves the test suite by refactoring the tests into a more logical structure and adding new tests to increase coverage.

  • Refactored the monolithic tests/test_main.py into smaller, focused files: test_main.py, test_reviewer.py, test_utils.py, and test_formatters.py.
  • Added numerous new tests for main.py and reviewer.py, with a focus on negative paths and edge cases as requested.
  • Increased test coverage for main.py from 61% to 70%.
  • Increased test coverage for reviewer.py from 83% to 89%.
  • Increased overall project test coverage from 79% to 85%.
  • Added a test for the last remaining uncovered line in utils.py, bringing the project closer to full coverage for utility functions.

This commit significantly improves the test suite by refactoring the tests into a more logical structure and adding new tests to increase coverage.

- Refactored the monolithic `tests/test_main.py` into smaller, focused files: `test_main.py`, `test_reviewer.py`, `test_utils.py`, and `test_formatters.py`.
- Added numerous new tests for `main.py` and `reviewer.py`, with a focus on negative paths and edge cases as requested.
- Increased test coverage for `main.py` from 61% to 70%.
- Increased test coverage for `reviewer.py` from 83% to 89%.
- Increased overall project test coverage from 79% to 85%.
- Added a test for the last remaining uncovered line in `utils.py`, bringing the project closer to full coverage for utility functions.
This commit updates the project to support Python versions from 3.9 to 3.13, dropping support for 3.7 and 3.8 due to CI difficulties.

- Updated `pyproject.toml` to set `requires-python = ">=3.9"` and adjusted the classifiers accordingly.
- Modified `tox.ini` to run tests against the new range of Python versions.
- Updated the GitHub Actions CI workflow to test against a matrix of Python 3.9 through 3.13.
- Updated the `README.md` to reflect the new minimum Python version requirement.
This commit fixes a CI failure where tox would not allow the `make` command to be executed. The `make` command is now explicitly allowed by adding it to the `allowlist_externals` in `tox.ini`.
This commit fixes a CI failure by running the linting, formatting, and testing commands directly within the tox environment, rather than using the `make ci` target.

The `Makefile` is designed for local development and expects a `.venv/` directory, which is not created by tox. This change decouples the CI test execution from the local development setup, making the CI more robust.
This commit applies the `black` code formatter to the test files to ensure they adhere to the project's code style.
@randomparity randomparity merged commit 0023def into main Sep 8, 2025
5 checks passed
@randomparity randomparity deleted the feat/improve-test-coverage branch September 8, 2025 04:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant