feat: Add test scripts and runner for TheChart application

- Created demo_failing_test.py to demonstrate pre-commit blocking with a failing test.
- Added run_tests.py for executing all tests with coverage reporting.
- Introduced test.py as a quick test runner for the application, providing coverage reports and user-friendly output.
This commit is contained in:
William Valentin
2025-07-28 18:21:40 -07:00
parent c20c4478a6
commit 4c7da343eb
7 changed files with 688 additions and 437 deletions

View File

@@ -65,3 +65,23 @@ repos:
# - id: uv-export
# - id: pip-compile
# args: [requirements.in, -o, requirements.txt]
########################################################
# Run core tests before commit to ensure basic functionality
- repo: local
hooks:
- id: pytest-check
name: pytest-check (core tests)
entry: uv run pytest
language: system
pass_filenames: false
always_run: true
args:
[
--tb=short,
--quiet,
--no-cov,
"tests/test_data_manager.py::TestDataManager::test_init",
"tests/test_data_manager.py::TestDataManager::test_initialize_csv_creates_file_with_headers",
"tests/test_data_manager.py::TestDataManager::test_load_data_with_valid_data",
]
stages: [pre-commit]