Skip to content

Conversation

@mdevolde
Copy link
Collaborator

docs: separated tests in files, added doc and typing, moved cli tests from bash to python

Why the pull request was made

Moved tests to files, added documentation and typed, and set up all tests in Python so that they can be maintained, added to, and easily performed coverage on the library.

Summary of changes

  • Separeted tests in different files
  • Added doc to test funcs
  • Added type annotations to test funcs
  • Moved CLI test (bash scripts) to python tests
  • Edited some pytest parameters
  • Added a coverage badge
  • Edited the way of handling stdin in CLI

Screenshots (if appropriate):

Not applicable.

How has this been tested?

Applied local tests.

Resources

Not applicable.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update (changes to documentation only)
  • Refactor / code style update (non-breaking change that improves code structure or readability)
  • Tests / CI improvement (adding or updating tests or CI configuration only)
  • Other (please describe):

Checklist

  • Followed the project's contributing guidelines.
  • Updated any relevant tests.
  • Updated any relevant documentation.
  • Added comments to your code where necessary.
  • Formatted your code, run the linters, checked types and tests.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR reorganizes the test suite by splitting tests from a monolithic file into separate, focused files based on functionality. It adds comprehensive documentation and type annotations to all test functions, and successfully migrates CLI tests from bash scripts to Python for better maintainability and coverage tracking.

Key changes:

  • Split test_major_functionality.py into 6 focused test modules (test_match.py, test_server_local.py, test_config.py, test_download.py, test_cli.py, test_api_public.py)
  • Migrated bash-based CLI tests to Python with parametrized tests
  • Modified __main__.py to support programmatic testing by accepting argv parameter and refactoring stdin handling
  • Added coverage badge generation to build process and README

Reviewed Changes

Copilot reviewed 17 out of 18 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
tests/test_server_local.py New file containing tests for local server functionality including process lifecycle and client-server connections
tests/test_match.py New file with tests for Match object functionality and text correction features
tests/test_config.py New file testing configuration options like caching, text length limits, and rule management
tests/test_download.py New file testing download functionality and language validation
tests/test_cli.py New file with CLI tests migrated from bash, using parametrized tests and stdin mocking
tests/test_api_public.py New file testing the public API with Spanish language validation
tests/test_major_functionality.py Removed - functionality split across new test files
tests/test_local.bash Removed - migrated to Python in test_cli.py
tests/test_remote.bash Removed - migrated to Python in test_cli.py
tests/__init__.py Added package docstring for test module
language_tool_python/__main__.py Modified to accept argv parameter for testability and refactored stdin handling logic
pytest.ini Added verbose flag to pytest options
pyproject.toml Extended mypy type checking to include tests directory
Makefile / make.bat Added coverage badge generation step after pytest
.github/workflows/test.yml Removed bash test execution, relying solely on pytest
README.md Added coverage badge linking to local SVG file
coverage-badge.svg Added SVG badge file showing 78.27% coverage

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@mdevolde mdevolde merged commit f17220b into jxmorris12:master Nov 19, 2025
8 checks passed
@mdevolde mdevolde deleted the tests branch November 19, 2025 15:57
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