feat: Set up comprehensive Python testing infrastructure with Poetry #56
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 for MELD
Summary
This PR establishes a comprehensive testing infrastructure for the MELD (Multimodal EmotionLines Dataset) project using Poetry as the package manager and pytest as the testing framework.
Changes Made
Package Management
pyproject.toml
with Poetry configuration for dependency managementbaseline
andutils
modulesTesting Infrastructure
tests/
- Root testing directorytests/unit/
- For unit teststests/integration/
- For integration tests__init__.py
files for proper Python package recognitionTest Configuration
pytest Configuration: Comprehensive pytest settings in
pyproject.toml
:unit
,integration
,slow
Coverage Configuration:
baseline
andutils
moduleshtmlcov/
directoryShared Test Fixtures
Created comprehensive fixtures in
conftest.py
:temp_dir
: Temporary directory for test file operationsmock_config
: Configuration dictionary for testingsample_dialogue_data
: Sample MELD dialogue structureemotion_labels
: List of 7 MELD emotionssentiment_labels
: List of 3 MELD sentimentsmock_csv_data
: Creates mock CSV files for data loading testsmock_pickle_data
: Mock data structure for pickle file testingdata_path
: Creates mock data directory structurereset_environment
: Ensures clean environment for each testcapture_stdout
: Captures print statements for testingValidation Tests
Created
test_setup_validation.py
to verify the infrastructure:Build Configuration
.gitignore
file including:__pycache__
,*.pyc
, etc.).pytest_cache/
,coverage.xml
,htmlcov/
).claude/*
)Poetry Scripts
Configured convenient test commands:
poetry run test
- Run all tests with coveragepoetry run tests
- Alternative command (both work identically)How to Use
Install Dependencies:
Run Tests:
Run Specific Test Types:
View Coverage Reports:
htmlcov/index.html
in a browsercoverage.xml
for CI toolsNotes
Next Steps
Developers can now:
tests/unit/
tests/integration/