feat: Set up comprehensive Python testing infrastructure#16
Open
llbbl wants to merge 1 commit intotczpl:mainfrom
Open
feat: Set up comprehensive Python testing infrastructure#16llbbl wants to merge 1 commit intotczpl:mainfrom
llbbl wants to merge 1 commit intotczpl:mainfrom
Conversation
- Add Poetry package management with pyproject.toml configuration - Install pytest, pytest-cov, and pytest-mock as development dependencies - Configure comprehensive testing settings with 75% coverage threshold - Create tests/ directory structure with unit/ and integration/ subdirectories - Add shared fixtures in conftest.py for temp directories, mock data, and network isolation - Include validation tests to verify testing infrastructure functionality - Update .gitignore with testing artifacts, Python cache files, and development environment entries - Support both `poetry run pytest` command execution for running tests
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.
Set up Python Testing Infrastructure
Summary
This PR establishes a comprehensive testing infrastructure for the XBlock-ETH project using Poetry as the package manager and pytest as the testing framework.
Changes Made
Package Management
pyproject.tomlwith project metadata and dependenciesrequestsfor data downloading)pytest,pytest-cov,pytest-mockTesting Configuration
unit,integration,slow)Directory Structure
Shared Testing Fixtures
The
conftest.pyprovides comprehensive fixtures for:Updated Configuration
.gitignorewith testing artifacts, Python cache files, virtual environments, and IDE filesHow to Run Tests
Install Dependencies
Run All Tests
Run with Verbose Output
Run Specific Test Types
Generate Coverage Report
poetry run pytest --cov-report=html # Open htmlcov/index.html in browserValidation
The infrastructure has been validated with 18 passing tests that verify:
Notes
The testing infrastructure is now ready for developers to start writing unit and integration tests for the blockchain data analysis functionality.