Contributing
Development Setup
# Clone the repository
git clone https://github.com/rroblf01/oxytest
cd oxytest
# Install dependencies
uv sync
# Build the Rust extension in development mode
uv pip install -e .
# Run tests
oxytest tests/
Project Structure
oxytest/
├── src/ # Rust source code
│ ├── lib.rs # PyO3 module entry point
│ ├── types.rs # TestItem and TestResult classes
│ ├── discovery.rs # AST-based test discovery
│ └── runner.rs # Test execution (sequential + parallel)
├── python/
│ └── oxytest/
│ ├── __init__.py # Package exports
│ ├── __main__.py # python -m oxytest entry point
│ ├── _compat.py # pytest API compatibility layer
│ ├── _core.pyi # Type stubs for Rust module
│ ├── _fixtures.py # Fixture system (tmp_path, capsys, etc.)
│ ├── _plugin.py # Plugin system (pluggy-based hooks)
│ ├── _assert.py # Assert rewriting for comparison diffs
│ └── _migrate.py # Import migration tool (pytest ↔ oxytest)
├── tests/ # Test suite for oxytest itself
│ └── sample_tests/ # Sample tests used for integration testing
├── docs/ # Documentation
│ ├── en/ # English documentation
│ └── es/ # Spanish documentation
├── benchmarks/ # Performance benchmarks
├── pyproject.toml # Python package configuration
├── Cargo.toml # Rust crate configuration
└── mkdocs.yml # Documentation site configuration
Building
The Rust extension is built automatically when installing the package:
# Development install
uv pip install -e .
# Production build
uv pip install .
To run the Rust build manually:
cargo build --release
Testing
# Run sample tests (30 tests, 9 expected failures)
oxytest tests/sample_tests/ -v
# Run oxytest's own test suite
uv run python -m oxytest tests/ -v --tb=no
# Run Rust tests
cargo test
# Test failure output (9 tests, all should fail)
oxytest tests/sample_tests/test_failures.py --tb=short
Code Style
- Python: follow PEP 8
- Rust: follow
cargo clippysuggestions - Keep the pytest API compatibility layer as thin as possible
- Prefer pushing logic into Rust for performance-critical paths
Pull Request Process
- Fork the repository
- Create a feature branch
- Make your changes
- Run the test suite
- Submit a pull request
Release Process
- Update version in
pyproject.tomlandCargo.toml - Run full test suite and benchmarks
- Create a signed tag
- Push tag to trigger PyPI release via GitHub Actions