This directory contains tests for the Cross-Layer Transcoder (CLT) library. The testing strategy is divided into two main categories:
Located in tests/unit/, these tests verify that individual components of the library work correctly in isolation. Unit tests are designed to:
- Test specific functionality of a single class or function
- Mock dependencies to isolate the component being tested
- Run quickly and provide good coverage
- Help identify where issues originate
Located in tests/integration/, these tests verify that multiple components work together correctly. Integration tests are designed to:
- Test realistic user workflows
- Verify that components interact properly
- Use real (but small-scale) components instead of mocks
- Test data flow between components
To run all tests:
pytestTo run unit tests only:
pytest tests/unitTo run integration tests only:
pytest tests/integrationThe tests/integration/data/ directory contains fixtures for integration tests, including:
- Sample activation data
- Pre-trained model files
- Helper scripts to generate test data
These fixtures enable deterministic testing of model loading, inference, and training without requiring external data.
When adding new functionality to the library:
- Add unit tests for the new component in
tests/unit/ - Add integration tests in
tests/integration/for any new workflows
Use the @pytest.mark.integration marker for integration tests:
@pytest.mark.integration
def test_my_integration_test():
# Test code here
pass