Refactoring, use parametrized tests#32
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR refactors the test suite to use pytest's parametrize decorator, consolidating similar tests into more maintainable parametrized versions. Additionally, it includes a small performance improvement by pre-compiling the placeholder regex pattern.
Key changes:
- Consolidated similar test cases into parametrized tests across multiple test files
- Introduced
PLACEHOLDER_REGEXcompiled constant to avoid repeated regex compilation - Refactored
apywire/compiler.pywith extracted helper methods for better code organization
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_stdlib_compat.py | Consolidated 7 separate stdlib instantiation tests into 2 parametrized tests |
| tests/test_generator.py | Consolidated type default tests and invalid format tests into parametrized versions |
| tests/test_formats.py | Unified format roundtrip tests across JSON/TOML/INI into a single parametrized test class |
| tests/test_constant_placeholders.py | Consolidated constant expansion tests into parametrized versions |
| tests/test_compile_aio.py | Unified async compilation tests into parametrized versions |
| tests/test_cli.py | Consolidated CLI flag and format tests into parametrized versions |
| apywire/constants.py | Added pre-compiled PLACEHOLDER_REGEX constant for performance |
| apywire/wiring.py | Updated to use the pre-compiled PLACEHOLDER_REGEX |
| apywire/runtime.py | Updated to use the pre-compiled PLACEHOLDER_REGEX |
| apywire/compiler.py | Extracted multiple helper methods to improve code organization and reduce duplication |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
93245d4 to
b82b623
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 10 out of 10 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Brief description of changes.
Type of Change
Checklist