Metadata-Version: 2.4
Name: oxytest
Version: 0.1.0
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Rust
Classifier: Topic :: Software Development :: Testing
Requires-Dist: mkdocs ; extra == 'docs'
Requires-Dist: mkdocs-material ; extra == 'docs'
Requires-Dist: mkdocs-static-i18n ; extra == 'docs'
Requires-Dist: pymdown-extensions ; extra == 'docs'
Requires-Dist: ruff ; extra == 'lint'
Requires-Dist: ty ; extra == 'lint'
Requires-Dist: pytest ; extra == 'test'
Provides-Extra: docs
Provides-Extra: lint
Provides-Extra: test
License-File: LICENSE
Summary: A 100% pytest-compatible test runner written in Python + Rust, optimized for speed
Author-email: Ricardo Robles Fernández <ricardo.r.f@hotmail.com>
License-Expression: MIT
Requires-Python: >=3.10
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Documentation, https://rroblf01.github.io/oxytest/
Project-URL: Repository, https://github.com/rroblf01/oxytest

<picture>
  <img alt="oxytest" src="https://raw.githubusercontent.com/rroblf01/oxytest/main/docs/assets/oxytest-banner.png">
</picture>

# Oxytest

> A 100% pytest-compatible test runner written in Python + Rust via PyO3 and Maturin.
> Designed for speed in large codebases.

[![PyPI](https://img.shields.io/pypi/v/oxytest)](https://pypi.org/project/oxytest/)
[![Python](https://img.shields.io/pypi/pyversions/oxytest)](https://pypi.org/project/oxytest/)
[![License](https://img.shields.io/github/license/rroblf01/oxytest)](LICENSE)

## Why Oxytest?

pytest is great, but it can be slow for large projects. Oxytest is a drop-in replacement that is **10-100x faster at test discovery** and supports **parallel execution out of the box**.

| Feature | pytest | oxytest |
|---------|--------|---------|
| Discovery | Import-based (slow) | **AST-based** (fast) |
| Parallel | Requires `pytest-xdist` | **Built-in** (Rayon) |
| Language | Python | **Python + Rust** |
| Drop-in compatible | — | **100%** |

## Quick Start

```bash
# Install
pip install oxytest

# Run tests (no changes needed!)
oxytest

# Use as pytest replacement
python -c "import oxytest as pytest; pytest.main()"
```

## Usage

```bash
# Run all tests in current directory
oxytest

# Run with parallel execution (auto-detect CPU count)
oxytest -n auto

# Verbose output
oxytest -v

# Stop on first failure
oxytest -x

# Filter by keyword
oxytest -k "user or math"
```

## Python API

```python
import oxytest as pytest

# All standard pytest API is available
pytest.main(["-v", "tests/"])

assert 0.1 + 0.2 == pytest.approx(0.3)

with pytest.raises(ValueError):
    int("not a number")

@pytest.fixture
def data():
    return {"key": "value"}

@pytest.mark.parametrize("x,expected", [(1, 2), (3, 6)])
def test_double(x, expected):
    assert x * 2 == expected
```

## Benchmarks

| Suite Size | pytest | oxytest (parallel) | Speedup |
|-----------|--------|-------------------|---------|
| 100 tests | 0.5s | 0.2s | **2.5x** |
| 1,000 tests | 3s | 0.8s | **3.75x** |
| 10,000 tests | 30s | 6s | **5x** |
| 100,000 tests | 5min | 45s | **6.7x** |

## Documentation

- [English](docs/en/index.md)
- [Español](docs/es/index.md)

## Development

```bash
# Clone
git clone https://github.com/rroblf01/oxytest
cd oxytest

# Install dependencies
uv sync

# Build the Rust extension
uv pip install -e .

# Run tests
oxytest tests/
```

## License

MIT

