Skip to content

Refactor test cases for consistency and readability#28

Merged
hmasdev merged 6 commits into
mainfrom
chore/fix-code-style
Nov 15, 2025
Merged

Refactor test cases for consistency and readability#28
hmasdev merged 6 commits into
mainfrom
chore/fix-code-style

Conversation

@hmasdev

@hmasdev hmasdev commented Nov 15, 2025

Copy link
Copy Markdown
Owner
  • Updated string literals to use double quotes for consistency across test files.
  • Added missing commas in dictionary definitions to adhere to PEP 8 style guide.
  • Reorganized mock patches to use consistent string formatting.
  • Improved readability by aligning parameter names in pytest.mark.parametrize decorators.
  • Removed unnecessary blank lines and comments for cleaner code.
  • Ensured all test functions maintain a consistent structure and naming convention.

hmasdev and others added 3 commits November 16, 2025 01:43
- Updated string literals to use double quotes for consistency across test files.
- Added missing commas in dictionary definitions to adhere to PEP 8 style guide.
- Reorganized mock patches to use consistent string formatting.
- Improved readability by aligning parameter names in pytest.mark.parametrize decorators.
- Removed unnecessary blank lines and comments for cleaner code.
- Ensured all test functions maintain a consistent structure and naming convention.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 refactors test cases and application code to improve consistency and adhere to PEP 8 style guidelines. The changes focus on standardizing string quote usage, removing unnecessary blank lines, and improving code formatting.

  • Standardized all string literals to use double quotes throughout the codebase
  • Removed unnecessary blank lines after function definitions for cleaner code structure
  • Added missing trailing commas in multi-line data structures to prevent future diff noise

Reviewed Changes

Copilot reviewed 48 out of 48 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tests/utils/test_rerun.py Consolidated imports and removed blank lines after function definitions
tests/utils/test_japanese_string_utils.py Changed string quotes to double quotes and reformatted function signatures
tests/ui/test_factory.py Updated parametrize decorators and mock patch strings to use double quotes
tests/ui/test_cui.py Converted string literals to double quotes and reformatted function signatures
tests/test_typing_game.py Comprehensive quote conversion and formatting improvements including trailing commas
tests/test_config.py Quote standardization and blank line removal
tests/sentence_generator/test_utils.py Reformatted large list literals with one item per line for readability
tests/sentence_generator/test_static_sentence_generator.py Quote conversion and comprehension reformatting
tests/sentence_generator/test_openai_sentence_generator.py Reformatted typing target lists for better readability
tests/sentence_generator/test_huggingface_sentence_generator.py Added blank line after imports and converted quotes
tests/sentence_generator/test_factory.py Reformatted conditional list concatenation and converted quotes
tests/key_monitor/test_sshkeyboard.py Quote conversion and function signature simplification
tests/key_monitor/test_pynput.py Removed unnecessary blank lines and converted quotes
tests/key_monitor/test_factory.py Consolidated imports and quote conversion
simple_typing_application/utils/rerun.py Converted docstrings to double quotes and improved f-string formatting
simple_typing_application/utils/japanese_string_utils.py Docstring conversion and multi-line formatting improvements
simple_typing_application/ui/factory.py Quote conversion and multi-line string formatting
simple_typing_application/ui/cui.py Function signature simplification and quote conversion
simple_typing_application/ui/base.py Removed blank line after class definition
simple_typing_application/ui/init.py Removed trailing blank line from all list
simple_typing_application/typing_game.py Comprehensive quote conversion and code formatting improvements
simple_typing_application/sentence_generator/utils.py Docstring conversion and improved multi-line formatting
simple_typing_application/sentence_generator/static_sentence_generator.py Quote conversion and comprehension reformatting
simple_typing_application/sentence_generator/openai_sentence_generator.py Docstring conversion and f-string formatting
simple_typing_application/sentence_generator/huggingface_sentence_generator.py Quote conversion and function signature simplification
simple_typing_application/sentence_generator/factory.py Import organization and quote conversion
simple_typing_application/sentence_generator/base.py Removed blank line after class definition
simple_typing_application/sentence_generator/init.py Removed trailing blank line
simple_typing_application/models/typing_target_model.py Reformatted Field definition for readability
simple_typing_application/models/record_model.py Removed blank line after class definition
simple_typing_application/models/output_model.py Removed blank line after class definition
simple_typing_application/models/config_models/sentence_generator_config_model.py Quote conversion in default values
simple_typing_application/models/config_models/general_config_model.py Reformatted long default value assignments
simple_typing_application/main.py Quote conversion in click options and log level checks
simple_typing_application/key_monitor/sshkeyboard.py Quote conversion and blank line removal
simple_typing_application/key_monitor/pynput.py Quote conversion and docstring updates
simple_typing_application/key_monitor/factory.py Quote conversion and multi-line formatting
simple_typing_application/key_monitor/base.py Docstring conversion to double quotes
simple_typing_application/const/user_interface.py Quote conversion in enum values
simple_typing_application/const/sentence_generator.py Quote conversion in enum values
simple_typing_application/const/keys.py Quote conversion and blank line removal
simple_typing_application/const/key_monitor.py Quote conversion in enum values
simple_typing_application/const/hiragana_romaji_map.py Major reformatting of dictionary for readability
simple_typing_application/const/color.py Quote conversion in dictionary values
simple_typing_application/const/init.py Quote conversion in ASCII_CHARS and all
simple_typing_application/config.py Docstring and quote conversion
simple_typing_application/main.py Added blank line after import
simple_typing_application/init.py Quote conversion for version string

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

Comment thread tests/test_typing_game.py
Comment on lines 263 to +265

on_release_callback_of_typing_game = typing_game._TypingGame__on_release_callback # type: ignore # noqa
typing_game._key_monitor.set_on_release_callback.assert_called_once_with(on_release_callback_of_typing_game) # type: ignore # noqa

Copilot AI Nov 15, 2025

Copy link

Choose a reason for hiding this comment

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

[nitpick] The introduction of an intermediate variable on_release_callback_of_typing_game appears unnecessary. The original single-line assertion was more concise. This change adds complexity without clear benefit and makes the test harder to read.

Copilot uses AI. Check for mistakes.
Comment thread simple_typing_application/config.py Outdated
Comment thread simple_typing_application/typing_game.py Outdated
hmasdev and others added 3 commits November 16, 2025 02:26
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 48 out of 48 changed files in this pull request and generated no new comments.


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

@hmasdev hmasdev merged commit 0a53b24 into main Nov 15, 2025
29 checks passed
@hmasdev hmasdev deleted the chore/fix-code-style branch November 15, 2025 17:44
@hmasdev hmasdev restored the chore/fix-code-style branch November 15, 2025 17:47
@hmasdev hmasdev deleted the chore/fix-code-style branch November 16, 2025 02:17
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.

2 participants