feat: Set up Python testing infrastructure with Poetry and pytest#26
Open
llbbl wants to merge 1 commit intopaulfitz:masterfrom
Open
feat: Set up Python testing infrastructure with Poetry and pytest#26llbbl wants to merge 1 commit intopaulfitz:masterfrom
llbbl wants to merge 1 commit intopaulfitz:masterfrom
Conversation
- Configure Poetry for dependency management (package-mode disabled) - Add pytest, pytest-cov, and pytest-mock as dev dependencies - Create test directory structure with unit and integration subdirs - Configure pytest settings with custom markers and test discovery - Add comprehensive test fixtures in conftest.py - Create validation tests to verify infrastructure setup - Update .gitignore with testing and Claude-related entries
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 text-to-SQL models project using Poetry for dependency management and pytest as the testing framework.
Changes Made
Package Management
package-mode = false(dependency management only)pyproject.tomlwith project metadata and dependenciesTesting Framework Setup
Directory Structure:
pytest Configuration:
test_*.pyand*_test.pyunit,integration,slowTest Fixtures (conftest.py)
Created comprehensive fixtures for common testing scenarios:
temp_dir: Temporary directory managementsample_csv_file: CSV file creation for testingsample_sqlite_db: SQLite database with test datamock_config: Configuration dictionarymock_api_request/mock_sql_response: API testing helpersmock_model_predictions: Model output mockingreset_environment: Environment variable isolationcaptured_logs: Log capture utilitymock_http_response: HTTP response mockingValidation
test_infrastructure.pywith 12 validation testsOther Changes
.gitignorewith comprehensive Python patternsHow to Use
Install dependencies:
Run all tests:
or
Run specific test categories:
poetry run pytest -m unit poetry run pytest -m integration poetry run pytest -m "not slow"Run with coverage (when ready):
Notes
Next Steps
tests/unit/tests/integration/