feat: Add comprehensive Python testing infrastructure with Poetry #14
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.
Add Complete Python Testing Infrastructure
Summary
This PR establishes a comprehensive testing infrastructure for the PyGAD CNN project, providing a solid foundation for test-driven development and continuous integration.
Changes Made
Package Management
pyproject.toml
requirements.txt
to Poetrypoetry.lock
for reproducible buildsTesting Framework
Project Structure
Configuration (pyproject.toml)
@pytest.mark.unit
,@pytest.mark.integration
,@pytest.mark.slow
poetry run test
andpoetry run tests
workShared Fixtures (conftest.py)
temp_dir
: Temporary directory managementsample_input_data
&sample_output_data
: CNN test datamock_config
: Configuration dictionary for testingsample_conv_layer
&sample_pool_layer
: Layer configurationsreset_random_seed
: Ensures reproducible testscapture_stdout
: For testing print statementsmock_file_operations
: File I/O mockingDevelopment Environment
htmlcov/
andcoverage.xml
Running Tests
Install Dependencies
Run All Tests
Run Specific Test Types
View Coverage Report
Notes
Next Steps
Developers can now immediately start writing unit and integration tests for the CNN implementation using the established infrastructure.