feat: Add comprehensive Python testing infrastructure with Poetry#14
Open
llbbl wants to merge 1 commit intoahmedfgad:masterfrom
Open
feat: Add comprehensive Python testing infrastructure with Poetry#14llbbl wants to merge 1 commit intoahmedfgad:masterfrom
llbbl wants to merge 1 commit intoahmedfgad:masterfrom
Conversation
- Set up Poetry as package manager with pyproject.toml configuration - Add pytest, pytest-cov, and pytest-mock as development dependencies - Configure pytest with coverage reporting (80% threshold, HTML/XML outputs) - Create test directory structure with unit/integration subdirectories - Add shared pytest fixtures in conftest.py for common testing needs - Configure custom test markers (unit, integration, slow) - Add comprehensive .gitignore for Python development - Include validation tests to verify setup functionality
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.
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.tomlrequirements.txtto Poetrypoetry.lockfor reproducible buildsTesting Framework
Project Structure
Configuration (pyproject.toml)
@pytest.mark.unit,@pytest.mark.integration,@pytest.mark.slowpoetry run testandpoetry run testsworkShared 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.xmlRunning 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.