rustest 0.8.0__cp312-cp312-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- rustest/__init__.py +28 -0
- rustest/__main__.py +10 -0
- rustest/approx.py +176 -0
- rustest/builtin_fixtures.py +309 -0
- rustest/cli.py +311 -0
- rustest/core.py +44 -0
- rustest/decorators.py +549 -0
- rustest/py.typed +0 -0
- rustest/reporting.py +63 -0
- rustest/rust.cp312-win_amd64.pyd +0 -0
- rustest/rust.py +23 -0
- rustest/rust.pyi +39 -0
- rustest-0.8.0.dist-info/METADATA +270 -0
- rustest-0.8.0.dist-info/RECORD +17 -0
- rustest-0.8.0.dist-info/WHEEL +4 -0
- rustest-0.8.0.dist-info/entry_points.txt +2 -0
- rustest-0.8.0.dist-info/licenses/LICENSE +21 -0
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: rustest
|
|
3
|
+
Version: 0.8.0
|
|
4
|
+
Classifier: Development Status :: 3 - Alpha
|
|
5
|
+
Classifier: Intended Audience :: Developers
|
|
6
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
7
|
+
Classifier: Programming Language :: Python :: 3
|
|
8
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
9
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
10
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
13
|
+
Classifier: Programming Language :: Rust
|
|
14
|
+
Classifier: Topic :: Software Development :: Testing
|
|
15
|
+
Requires-Dist: typing-extensions>=4.15
|
|
16
|
+
Requires-Dist: basedpyright>=1.19 ; extra == 'dev'
|
|
17
|
+
Requires-Dist: maturin>=1.4,<2 ; extra == 'dev'
|
|
18
|
+
Requires-Dist: poethepoet>=0.22 ; extra == 'dev'
|
|
19
|
+
Requires-Dist: pre-commit>=3.5 ; extra == 'dev'
|
|
20
|
+
Requires-Dist: pytest>=7.0 ; extra == 'dev'
|
|
21
|
+
Requires-Dist: pytest-asyncio>=1.2.0 ; extra == 'dev'
|
|
22
|
+
Requires-Dist: pytest-codeblocks>=0.17.0 ; extra == 'dev'
|
|
23
|
+
Requires-Dist: ruff>=0.1.9 ; extra == 'dev'
|
|
24
|
+
Requires-Dist: mkdocs>=1.5.0 ; extra == 'docs'
|
|
25
|
+
Requires-Dist: mkdocs-material>=9.5.0 ; extra == 'docs'
|
|
26
|
+
Requires-Dist: mkdocstrings[python]>=0.24.0 ; extra == 'docs'
|
|
27
|
+
Requires-Dist: mkdocs-autorefs>=0.5.0 ; extra == 'docs'
|
|
28
|
+
Provides-Extra: dev
|
|
29
|
+
Provides-Extra: docs
|
|
30
|
+
License-File: LICENSE
|
|
31
|
+
Summary: Rust powered pytest-compatible runner
|
|
32
|
+
Author: rustest contributors
|
|
33
|
+
Requires-Python: >=3.10
|
|
34
|
+
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
|
35
|
+
Project-URL: Homepage, https://github.com/Apex-Engineers-Inc/rustest
|
|
36
|
+
Project-URL: Repository, https://github.com/Apex-Engineers-Inc/rustest
|
|
37
|
+
Project-URL: Documentation, https://apex-engineers-inc.github.io/rustest
|
|
38
|
+
|
|
39
|
+
<div align="center">
|
|
40
|
+
|
|
41
|
+

|
|
42
|
+
|
|
43
|
+
</div>
|
|
44
|
+
|
|
45
|
+
Rustest (pronounced like Russ-Test) is a Rust-powered test runner that aims to provide the most common pytest ergonomics with a focus on raw performance. Get **massive speedups (8.5× average, up to 19× faster)** with familiar syntax and minimal setup.
|
|
46
|
+
|
|
47
|
+
📚 **[Full Documentation](https://apex-engineers-inc.github.io/rustest)** | [Getting Started](https://apex-engineers-inc.github.io/rustest/getting-started/quickstart/) | [User Guide](https://apex-engineers-inc.github.io/rustest/guide/writing-tests/) | [API Reference](https://apex-engineers-inc.github.io/rustest/api/overview/)
|
|
48
|
+
|
|
49
|
+
## Why rustest?
|
|
50
|
+
|
|
51
|
+
- 🚀 **8.5× average speedup** over pytest on the synthetic benchmark matrix (peaking at 19× on 5k-test suites)
|
|
52
|
+
- ✅ Familiar `@fixture`, `@parametrize`, `@skip`, and `@mark` decorators
|
|
53
|
+
- 🔄 **Built-in async support** with `@mark.asyncio` (like pytest-asyncio)
|
|
54
|
+
- 🔍 Automatic test discovery (`test_*.py` and `*_test.py` files)
|
|
55
|
+
- 📝 **Built-in markdown code block testing** (like pytest-codeblocks, but faster)
|
|
56
|
+
- 🎯 Simple, clean API—if you know pytest, you already know rustest
|
|
57
|
+
- 🧮 Built-in `approx()` helper for tolerant numeric comparisons
|
|
58
|
+
- 🪤 `raises()` context manager for precise exception assertions
|
|
59
|
+
- 📦 Easy installation with pip or uv
|
|
60
|
+
- ⚡ Low-overhead execution keeps small suites feeling instant
|
|
61
|
+
|
|
62
|
+
## Performance
|
|
63
|
+
|
|
64
|
+
Rustest is designed for speed. The new benchmark matrix generates identical pytest and rustest suites ranging from 1 to 5,000 tests and runs each command five times. Rustest delivers an **8.5× average speedup** and reaches **19× faster** execution on the largest suite:
|
|
65
|
+
|
|
66
|
+
| Test Count | pytest (mean) | rustest (mean) | Speedup | pytest tests/s | rustest tests/s |
|
|
67
|
+
|-----------:|--------------:|---------------:|--------:|----------------:|-----------------:|
|
|
68
|
+
| 1 | 0.428s | 0.116s | 3.68x | 2.3 | 8.6 |
|
|
69
|
+
| 5 | 0.428s | 0.120s | 3.56x | 11.7 | 41.6 |
|
|
70
|
+
| 20 | 0.451s | 0.116s | 3.88x | 44.3 | 171.7 |
|
|
71
|
+
| 100 | 0.656s | 0.133s | 4.93x | 152.4 | 751.1 |
|
|
72
|
+
| 500 | 1.206s | 0.146s | 8.29x | 414.4 | 3436.1 |
|
|
73
|
+
| 1,000 | 1.854s | 0.171s | 10.83x | 539.4 | 5839.4 |
|
|
74
|
+
| 2,000 | 3.343s | 0.243s | 13.74x | 598.3 | 8219.9 |
|
|
75
|
+
| 5,000 | 7.811s | 0.403s | 19.37x | 640.2 | 12399.7 |
|
|
76
|
+
|
|
77
|
+
### What speedup should you expect?
|
|
78
|
+
|
|
79
|
+
- **Tiny suites (≤20 tests):** Expect **~3–4× faster** runs. Startup costs dominate here, so both runners feel instant, but rustest still trims a few hundred milliseconds on every run.
|
|
80
|
+
- **Growing suites (≈100–500 tests):** Expect **~5–8× faster** execution. Once you have a few dozen files, rustest's lean discovery and fixture orchestration start to compound.
|
|
81
|
+
- **Large suites (≥1,000 tests):** Expect **~11–19× faster** runs. Bigger suites amortize startup overhead entirely, letting rustest's Rust core stretch its legs and deliver order-of-magnitude gains.
|
|
82
|
+
|
|
83
|
+
Highlights:
|
|
84
|
+
|
|
85
|
+
- **8.5× average speedup** across the matrix (geometric mean 7.0×)
|
|
86
|
+
- **16.2× weighted speedup** when weighting by the number of executed tests
|
|
87
|
+
- **1.45s total runtime** for rustest vs **16.18s** for pytest across all suites
|
|
88
|
+
|
|
89
|
+
Reproduce the matrix locally:
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
python3 profile_tests.py --runs 5
|
|
93
|
+
python3 generate_comparison.py
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### Real-world integration suite (~200 tests)
|
|
97
|
+
|
|
98
|
+
Our integration suite remains a great proxy for day-to-day use and still shows a **~2.1× wall-clock speedup**:
|
|
99
|
+
|
|
100
|
+
| Test Runner | Wall Clock | Speedup | Command |
|
|
101
|
+
|-------------|------------|---------|---------|
|
|
102
|
+
| pytest | 1.33–1.59s | 1.0x (baseline) | `pytest tests/ examples/tests/ -q` |
|
|
103
|
+
| rustest | 0.69–0.70s | **~2.1x faster** | `python -m rustest tests/ examples/tests/` |
|
|
104
|
+
|
|
105
|
+
### Large parametrized stress test
|
|
106
|
+
|
|
107
|
+
With **10,000 parametrized invocations**:
|
|
108
|
+
|
|
109
|
+
| Test Runner | Avg. Wall Clock | Speedup | Command |
|
|
110
|
+
|-------------|-----------------|---------|---------|
|
|
111
|
+
| pytest | 9.72s | 1.0x | `pytest benchmarks/test_large_parametrize.py -q` |
|
|
112
|
+
| rustest | 0.41s | **~24x faster** | `python -m rustest benchmarks/test_large_parametrize.py` |
|
|
113
|
+
|
|
114
|
+
**[📊 View Detailed Performance Analysis →](https://apex-engineers-inc.github.io/rustest/advanced/performance/)**
|
|
115
|
+
|
|
116
|
+
## Installation
|
|
117
|
+
|
|
118
|
+
Rustest supports Python **3.10 through 3.14**.
|
|
119
|
+
|
|
120
|
+
<!--pytest.mark.skip-->
|
|
121
|
+
```bash
|
|
122
|
+
# Using pip
|
|
123
|
+
pip install rustest
|
|
124
|
+
|
|
125
|
+
# Using uv
|
|
126
|
+
uv add rustest
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
**[📖 Installation Guide →](https://apex-engineers-inc.github.io/rustest/getting-started/installation/)**
|
|
130
|
+
|
|
131
|
+
## Quick Start
|
|
132
|
+
|
|
133
|
+
### 1. Write Your Tests
|
|
134
|
+
|
|
135
|
+
Create a file `test_math.py`:
|
|
136
|
+
|
|
137
|
+
```python
|
|
138
|
+
from rustest import fixture, parametrize, mark, approx, raises
|
|
139
|
+
import asyncio
|
|
140
|
+
|
|
141
|
+
@fixture
|
|
142
|
+
def numbers() -> list[int]:
|
|
143
|
+
return [1, 2, 3, 4, 5]
|
|
144
|
+
|
|
145
|
+
def test_sum(numbers: list[int]) -> None:
|
|
146
|
+
assert sum(numbers) == approx(15)
|
|
147
|
+
|
|
148
|
+
@parametrize("value,expected", [(2, 4), (3, 9), (4, 16)])
|
|
149
|
+
def test_square(value: int, expected: int) -> None:
|
|
150
|
+
assert value ** 2 == expected
|
|
151
|
+
|
|
152
|
+
@mark.slow
|
|
153
|
+
def test_expensive_operation() -> None:
|
|
154
|
+
result = sum(range(1000000))
|
|
155
|
+
assert result > 0
|
|
156
|
+
|
|
157
|
+
@mark.asyncio
|
|
158
|
+
async def test_async_operation() -> None:
|
|
159
|
+
# Example async operation
|
|
160
|
+
await asyncio.sleep(0.001)
|
|
161
|
+
result = 42
|
|
162
|
+
assert result == 42
|
|
163
|
+
|
|
164
|
+
def test_division_by_zero() -> None:
|
|
165
|
+
with raises(ZeroDivisionError, match="division by zero"):
|
|
166
|
+
1 / 0
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
### 2. Run Your Tests
|
|
170
|
+
|
|
171
|
+
<!--pytest.mark.skip-->
|
|
172
|
+
```bash
|
|
173
|
+
# Run all tests
|
|
174
|
+
rustest
|
|
175
|
+
|
|
176
|
+
# Run specific tests
|
|
177
|
+
rustest tests/
|
|
178
|
+
|
|
179
|
+
# Filter by test name pattern
|
|
180
|
+
rustest -k "test_sum"
|
|
181
|
+
|
|
182
|
+
# Filter by marks
|
|
183
|
+
rustest -m "slow" # Run only slow tests
|
|
184
|
+
rustest -m "not slow" # Skip slow tests
|
|
185
|
+
rustest -m "slow and integration" # Run tests with both marks
|
|
186
|
+
|
|
187
|
+
# Rerun only failed tests
|
|
188
|
+
rustest --lf # Last failed only
|
|
189
|
+
rustest --ff # Failed first, then all others
|
|
190
|
+
|
|
191
|
+
# Exit on first failure
|
|
192
|
+
rustest -x # Fail fast
|
|
193
|
+
|
|
194
|
+
# Combine options
|
|
195
|
+
rustest --ff -x # Run failed tests first, stop on first failure
|
|
196
|
+
|
|
197
|
+
# Show output during execution
|
|
198
|
+
rustest --no-capture
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
**[📖 Full Quick Start Guide →](https://apex-engineers-inc.github.io/rustest/getting-started/quickstart/)**
|
|
202
|
+
|
|
203
|
+
## Documentation
|
|
204
|
+
|
|
205
|
+
**[📚 Full Documentation](https://apex-engineers-inc.github.io/rustest)**
|
|
206
|
+
|
|
207
|
+
### Getting Started
|
|
208
|
+
- [Installation](https://apex-engineers-inc.github.io/rustest/getting-started/installation/)
|
|
209
|
+
- [Quick Start](https://apex-engineers-inc.github.io/rustest/getting-started/quickstart/)
|
|
210
|
+
|
|
211
|
+
### User Guide
|
|
212
|
+
- [Writing Tests](https://apex-engineers-inc.github.io/rustest/guide/writing-tests/)
|
|
213
|
+
- [Fixtures](https://apex-engineers-inc.github.io/rustest/guide/fixtures/)
|
|
214
|
+
- [Parametrization](https://apex-engineers-inc.github.io/rustest/guide/parametrization/)
|
|
215
|
+
- [Marks & Skipping](https://apex-engineers-inc.github.io/rustest/guide/marks/)
|
|
216
|
+
- [Test Classes](https://apex-engineers-inc.github.io/rustest/guide/test-classes/)
|
|
217
|
+
- [Assertion Helpers](https://apex-engineers-inc.github.io/rustest/guide/assertions/)
|
|
218
|
+
- [Markdown Testing](https://apex-engineers-inc.github.io/rustest/guide/markdown-testing/)
|
|
219
|
+
- [CLI Usage](https://apex-engineers-inc.github.io/rustest/guide/cli/)
|
|
220
|
+
- [Python API](https://apex-engineers-inc.github.io/rustest/guide/python-api/)
|
|
221
|
+
|
|
222
|
+
### API Reference
|
|
223
|
+
- [API Overview](https://apex-engineers-inc.github.io/rustest/api/overview/)
|
|
224
|
+
- [Decorators](https://apex-engineers-inc.github.io/rustest/api/decorators/)
|
|
225
|
+
- [Test Execution](https://apex-engineers-inc.github.io/rustest/api/core/)
|
|
226
|
+
- [Reporting](https://apex-engineers-inc.github.io/rustest/api/reporting/)
|
|
227
|
+
- [Assertion Utilities](https://apex-engineers-inc.github.io/rustest/api/approx/)
|
|
228
|
+
|
|
229
|
+
### Advanced Topics
|
|
230
|
+
- [Performance](https://apex-engineers-inc.github.io/rustest/advanced/performance/)
|
|
231
|
+
- [Comparison with pytest](https://apex-engineers-inc.github.io/rustest/advanced/comparison/)
|
|
232
|
+
- [Development Guide](https://apex-engineers-inc.github.io/rustest/advanced/development/)
|
|
233
|
+
|
|
234
|
+
## Feature Comparison with pytest
|
|
235
|
+
|
|
236
|
+
Rustest implements the 20% of pytest features that cover 80% of use cases, with a focus on raw speed and simplicity.
|
|
237
|
+
|
|
238
|
+
**[📋 View Full Feature Comparison →](https://apex-engineers-inc.github.io/rustest/advanced/comparison/)**
|
|
239
|
+
|
|
240
|
+
✅ **Supported:** Fixtures, parametrization, marks, test classes, conftest.py, markdown testing
|
|
241
|
+
🚧 **Planned:** Parallel execution, mark filtering, JUnit XML output
|
|
242
|
+
❌ **Not Planned:** Plugins, hooks, custom collectors (keeps rustest simple)
|
|
243
|
+
|
|
244
|
+
## Contributing
|
|
245
|
+
|
|
246
|
+
We welcome contributions! See the [Development Guide](https://apex-engineers-inc.github.io/rustest/advanced/development/) for setup instructions.
|
|
247
|
+
|
|
248
|
+
Quick reference:
|
|
249
|
+
|
|
250
|
+
<!--pytest.mark.skip-->
|
|
251
|
+
```bash
|
|
252
|
+
# Setup
|
|
253
|
+
git clone https://github.com/Apex-Engineers-Inc/rustest.git
|
|
254
|
+
cd rustest
|
|
255
|
+
uv sync --all-extras
|
|
256
|
+
uv run maturin develop
|
|
257
|
+
|
|
258
|
+
# Run tests
|
|
259
|
+
uv run poe pytests # Python tests
|
|
260
|
+
cargo test # Rust tests
|
|
261
|
+
|
|
262
|
+
# Format and lint
|
|
263
|
+
uv run pre-commit install # One-time setup
|
|
264
|
+
git commit -m "message" # Pre-commit hooks run automatically
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
## License
|
|
268
|
+
|
|
269
|
+
rustest is distributed under the terms of the MIT license. See [LICENSE](LICENSE).
|
|
270
|
+
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
rustest-0.8.0.dist-info/METADATA,sha256=rQo4VTLKDDTEtHRsA06OqCdtYg6ZXvP2ALWyGYa4a4Y,11348
|
|
2
|
+
rustest-0.8.0.dist-info/WHEEL,sha256=M1DN_cdEL9MiMVOnA_mgpqWn-huMwVTFfEx_RmZww1E,97
|
|
3
|
+
rustest-0.8.0.dist-info/entry_points.txt,sha256=7fUa3LO8vudQ4dKG1sTRaDnxcMdBSZsWs9EyuxFQ7Lk,48
|
|
4
|
+
rustest-0.8.0.dist-info/licenses/LICENSE,sha256=Ci0bB0T1ZGkqIV237Zp_Bv8LIJJ0Vxwc-AhLhgDgAoQ,1096
|
|
5
|
+
rustest/__init__.py,sha256=LL9UloOClzeNO6A-iMkEFtHDrBTAhRLko3sXy55H0QA,542
|
|
6
|
+
rustest/__main__.py,sha256=yMhaWvxGAV46BYY8fB6GoRy9oh8Z8YrS9wlZI3LmoyY,188
|
|
7
|
+
rustest/approx.py,sha256=cO-O9OSqdTfMtY1ohlbzVOu2SZfSTatCVt_X_zz3BNM,6585
|
|
8
|
+
rustest/builtin_fixtures.py,sha256=KG2DC8djYstCoPkHC_FCnJkQlSIhQMU5L_ACpLmacSI,10089
|
|
9
|
+
rustest/cli.py,sha256=6etivUqjdnHgYShXobtrEFFhjW2PuetWuj8hwM4gRuI,10496
|
|
10
|
+
rustest/core.py,sha256=ORTAlkeuu6nC2Q43hg-VJY6PN1HUiaMoP1vu_WH-8cs,1505
|
|
11
|
+
rustest/decorators.py,sha256=Hw5OYj4P2vPTy9BnYUcLvcWhOfGiRmPNFkMPZRHFUt8,19740
|
|
12
|
+
rustest/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
13
|
+
rustest/reporting.py,sha256=g4jdlwjFoKF_fWA_sKfeDwmhDeHxPJQUqypa_E2XQlc,1686
|
|
14
|
+
rustest/rust.cp312-win_amd64.pyd,sha256=lP3GYOMGC8HNcetQIiLX2BtVl7meGZLzN25NznEZqj8,1417216
|
|
15
|
+
rustest/rust.py,sha256=N_1C-uXRiC2qkV7ecKVcb51-XXyfhYNepd5zs-RIYOo,682
|
|
16
|
+
rustest/rust.pyi,sha256=ltvSC9_ZUpuRgq9cShN93YLxaxt9c1B2AqBswpk1nfY,849
|
|
17
|
+
rustest-0.8.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Apex Engineers Inc
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|