run-tests
Run tests for the wc_simd project using pytest. Use this skill to run all tests, specific test files, or individual test functions. Invoke with /run-tests.
When & Why to Use This Skill
This Claude skill provides a robust interface for executing and managing pytest-based test suites within the wc_simd project. It streamlines the quality assurance process by allowing developers to run comprehensive tests, analyze code coverage, and perform deep-dive debugging directly through the agent, ensuring high code reliability and faster development cycles.
Use Cases
- Automated Regression Testing: Execute the full test suite using /run-tests to ensure that new code changes haven't introduced bugs into the existing wc_simd codebase.
- Targeted Feature Validation: Run specific test files such as tests/test_pyspark.py or individual test functions to verify specific components without the overhead of the entire suite.
- Code Coverage Analysis: Generate detailed HTML coverage reports to identify untested code paths and improve the overall testing density of the project.
- Rapid Debugging: Utilize advanced pytest flags like --pdb to drop into an interactive debugger on failure or -s to view print statements for immediate troubleshooting.
- Efficient Iteration: Use the --lf flag to run only the tests that failed in the previous run, significantly reducing the feedback loop during bug fixing.
| name | run-tests |
|---|---|
| description | Run tests for the wc_simd project using pytest. Use this skill to run all tests, specific test files, or individual test functions. Invoke with /run-tests. |
Testing
This skill runs tests for the wc_simd project using pytest.
Run All Tests
pytest
Run Specific Test File
pytest tests/test_pyspark.py
Run Specific Test Function
pytest tests/test_pyspark.py::test_function_name
Run with Verbose Output
pytest -v
Run with Coverage
pytest --cov=wc_simd --cov-report=html
Run Only Failed Tests
pytest --lf
Run Tests Matching Pattern
pytest -k "embed" # Run tests with "embed" in name
Test Files
| File | Description |
|---|---|
tests/test_pyspark.py |
PySpark integration tests |
tests/test_embed.py |
Embedding service tests |
tests/test_llm.py |
LLM integration tests |
Prerequisites
Ensure dependencies are installed:
uv sync
For Spark tests, ensure Docker Spark is running:
cd spark_docker_s3 && docker compose up -d --build
Debugging Tests
# Drop into debugger on failure
pytest --pdb
# Show print statements
pytest -s
# Show local variables on failure
pytest -l