rustest 0.6.0__cp311-cp311-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.
Potentially problematic release.
This version of rustest might be problematic. Click here for more details.
- rustest/__init__.py +28 -0
- rustest/__main__.py +10 -0
- rustest/approx.py +160 -0
- rustest/cli.py +273 -0
- rustest/core.py +38 -0
- rustest/decorators.py +537 -0
- rustest/py.typed +0 -0
- rustest/reporting.py +63 -0
- rustest/rust.cp311-win_amd64.pyd +0 -0
- rustest/rust.py +23 -0
- rustest/rust.pyi +37 -0
- rustest-0.6.0.dist-info/METADATA +222 -0
- rustest-0.6.0.dist-info/RECORD +16 -0
- rustest-0.6.0.dist-info/WHEEL +4 -0
- rustest-0.6.0.dist-info/entry_points.txt +2 -0
- rustest-0.6.0.dist-info/licenses/LICENSE +21 -0
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: rustest
|
|
3
|
+
Version: 0.6.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
|
+
# rustest
|
|
40
|
+
|
|
41
|
+
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 **~2x faster** test execution with familiar syntax and minimal setup.
|
|
42
|
+
|
|
43
|
+
📚 **[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/)
|
|
44
|
+
|
|
45
|
+
## Why rustest?
|
|
46
|
+
|
|
47
|
+
- 🚀 **About 2x faster** than pytest on the rustest integration test suite
|
|
48
|
+
- ✅ Familiar `@fixture`, `@parametrize`, `@skip`, and `@mark` decorators
|
|
49
|
+
- 🔄 **Built-in async support** with `@mark.asyncio` (like pytest-asyncio)
|
|
50
|
+
- 🔍 Automatic test discovery (`test_*.py` and `*_test.py` files)
|
|
51
|
+
- 📝 **Built-in markdown code block testing** (like pytest-codeblocks, but faster)
|
|
52
|
+
- 🎯 Simple, clean API—if you know pytest, you already know rustest
|
|
53
|
+
- 🧮 Built-in `approx()` helper for tolerant numeric comparisons
|
|
54
|
+
- 🪤 `raises()` context manager for precise exception assertions
|
|
55
|
+
- 📦 Easy installation with pip or uv
|
|
56
|
+
- ⚡ Low-overhead execution keeps small suites feeling instant
|
|
57
|
+
|
|
58
|
+
## Performance
|
|
59
|
+
|
|
60
|
+
Rustest is designed for speed. Our latest benchmarks on the rustest integration suite (~200 tests) show a consistent **2.1x wall-clock speedup** over pytest:
|
|
61
|
+
|
|
62
|
+
| Test Runner | Wall Clock | Speedup | Command |
|
|
63
|
+
|-------------|------------|---------|---------|
|
|
64
|
+
| pytest | 1.33–1.59s | 1.0x (baseline) | `pytest tests/ examples/tests/ -q` |
|
|
65
|
+
| rustest | 0.69–0.70s | **~2.1x faster** | `python -m rustest tests/ examples/tests/` |
|
|
66
|
+
|
|
67
|
+
### Large Parametrized Stress Test
|
|
68
|
+
|
|
69
|
+
With **10,000 parametrized invocations**:
|
|
70
|
+
|
|
71
|
+
| Test Runner | Avg. Wall Clock | Speedup | Command |
|
|
72
|
+
|-------------|-----------------|---------|---------|
|
|
73
|
+
| pytest | 9.72s | 1.0x | `pytest benchmarks/test_large_parametrize.py -q` |
|
|
74
|
+
| rustest | 0.41s | **~24x faster** | `python -m rustest benchmarks/test_large_parametrize.py` |
|
|
75
|
+
|
|
76
|
+
**[📊 View Detailed Performance Analysis →](https://apex-engineers-inc.github.io/rustest/advanced/performance/)**
|
|
77
|
+
|
|
78
|
+
## Installation
|
|
79
|
+
|
|
80
|
+
Rustest supports Python **3.10 through 3.14**.
|
|
81
|
+
|
|
82
|
+
<!--pytest.mark.skip-->
|
|
83
|
+
```bash
|
|
84
|
+
# Using pip
|
|
85
|
+
pip install rustest
|
|
86
|
+
|
|
87
|
+
# Using uv
|
|
88
|
+
uv add rustest
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
**[📖 Installation Guide →](https://apex-engineers-inc.github.io/rustest/getting-started/installation/)**
|
|
92
|
+
|
|
93
|
+
## Quick Start
|
|
94
|
+
|
|
95
|
+
### 1. Write Your Tests
|
|
96
|
+
|
|
97
|
+
Create a file `test_math.py`:
|
|
98
|
+
|
|
99
|
+
```python
|
|
100
|
+
from rustest import fixture, parametrize, mark, approx, raises
|
|
101
|
+
import asyncio
|
|
102
|
+
|
|
103
|
+
@fixture
|
|
104
|
+
def numbers() -> list[int]:
|
|
105
|
+
return [1, 2, 3, 4, 5]
|
|
106
|
+
|
|
107
|
+
def test_sum(numbers: list[int]) -> None:
|
|
108
|
+
assert sum(numbers) == approx(15)
|
|
109
|
+
|
|
110
|
+
@parametrize("value,expected", [(2, 4), (3, 9), (4, 16)])
|
|
111
|
+
def test_square(value: int, expected: int) -> None:
|
|
112
|
+
assert value ** 2 == expected
|
|
113
|
+
|
|
114
|
+
@mark.slow
|
|
115
|
+
def test_expensive_operation() -> None:
|
|
116
|
+
result = sum(range(1000000))
|
|
117
|
+
assert result > 0
|
|
118
|
+
|
|
119
|
+
@mark.asyncio
|
|
120
|
+
async def test_async_operation() -> None:
|
|
121
|
+
# Example async operation
|
|
122
|
+
await asyncio.sleep(0.001)
|
|
123
|
+
result = 42
|
|
124
|
+
assert result == 42
|
|
125
|
+
|
|
126
|
+
def test_division_by_zero() -> None:
|
|
127
|
+
with raises(ZeroDivisionError, match="division by zero"):
|
|
128
|
+
1 / 0
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### 2. Run Your Tests
|
|
132
|
+
|
|
133
|
+
<!--pytest.mark.skip-->
|
|
134
|
+
```bash
|
|
135
|
+
# Run all tests
|
|
136
|
+
rustest
|
|
137
|
+
|
|
138
|
+
# Run specific tests
|
|
139
|
+
rustest tests/
|
|
140
|
+
|
|
141
|
+
# Filter by test name pattern
|
|
142
|
+
rustest -k "test_sum"
|
|
143
|
+
|
|
144
|
+
# Filter by marks
|
|
145
|
+
rustest -m "slow" # Run only slow tests
|
|
146
|
+
rustest -m "not slow" # Skip slow tests
|
|
147
|
+
rustest -m "slow and integration" # Run tests with both marks
|
|
148
|
+
|
|
149
|
+
# Show output during execution
|
|
150
|
+
rustest --no-capture
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
**[📖 Full Quick Start Guide →](https://apex-engineers-inc.github.io/rustest/getting-started/quickstart/)**
|
|
154
|
+
|
|
155
|
+
## Documentation
|
|
156
|
+
|
|
157
|
+
**[📚 Full Documentation](https://apex-engineers-inc.github.io/rustest)**
|
|
158
|
+
|
|
159
|
+
### Getting Started
|
|
160
|
+
- [Installation](https://apex-engineers-inc.github.io/rustest/getting-started/installation/)
|
|
161
|
+
- [Quick Start](https://apex-engineers-inc.github.io/rustest/getting-started/quickstart/)
|
|
162
|
+
|
|
163
|
+
### User Guide
|
|
164
|
+
- [Writing Tests](https://apex-engineers-inc.github.io/rustest/guide/writing-tests/)
|
|
165
|
+
- [Fixtures](https://apex-engineers-inc.github.io/rustest/guide/fixtures/)
|
|
166
|
+
- [Parametrization](https://apex-engineers-inc.github.io/rustest/guide/parametrization/)
|
|
167
|
+
- [Marks & Skipping](https://apex-engineers-inc.github.io/rustest/guide/marks/)
|
|
168
|
+
- [Test Classes](https://apex-engineers-inc.github.io/rustest/guide/test-classes/)
|
|
169
|
+
- [Assertion Helpers](https://apex-engineers-inc.github.io/rustest/guide/assertions/)
|
|
170
|
+
- [Markdown Testing](https://apex-engineers-inc.github.io/rustest/guide/markdown-testing/)
|
|
171
|
+
- [CLI Usage](https://apex-engineers-inc.github.io/rustest/guide/cli/)
|
|
172
|
+
- [Python API](https://apex-engineers-inc.github.io/rustest/guide/python-api/)
|
|
173
|
+
|
|
174
|
+
### API Reference
|
|
175
|
+
- [API Overview](https://apex-engineers-inc.github.io/rustest/api/overview/)
|
|
176
|
+
- [Decorators](https://apex-engineers-inc.github.io/rustest/api/decorators/)
|
|
177
|
+
- [Test Execution](https://apex-engineers-inc.github.io/rustest/api/core/)
|
|
178
|
+
- [Reporting](https://apex-engineers-inc.github.io/rustest/api/reporting/)
|
|
179
|
+
- [Assertion Utilities](https://apex-engineers-inc.github.io/rustest/api/approx/)
|
|
180
|
+
|
|
181
|
+
### Advanced Topics
|
|
182
|
+
- [Performance](https://apex-engineers-inc.github.io/rustest/advanced/performance/)
|
|
183
|
+
- [Comparison with pytest](https://apex-engineers-inc.github.io/rustest/advanced/comparison/)
|
|
184
|
+
- [Development Guide](https://apex-engineers-inc.github.io/rustest/advanced/development/)
|
|
185
|
+
|
|
186
|
+
## Feature Comparison with pytest
|
|
187
|
+
|
|
188
|
+
Rustest implements the 20% of pytest features that cover 80% of use cases, with a focus on raw speed and simplicity.
|
|
189
|
+
|
|
190
|
+
**[📋 View Full Feature Comparison →](https://apex-engineers-inc.github.io/rustest/advanced/comparison/)**
|
|
191
|
+
|
|
192
|
+
✅ **Supported:** Fixtures, parametrization, marks, test classes, conftest.py, markdown testing
|
|
193
|
+
🚧 **Planned:** Parallel execution, mark filtering, JUnit XML output
|
|
194
|
+
❌ **Not Planned:** Plugins, hooks, custom collectors (keeps rustest simple)
|
|
195
|
+
|
|
196
|
+
## Contributing
|
|
197
|
+
|
|
198
|
+
We welcome contributions! See the [Development Guide](https://apex-engineers-inc.github.io/rustest/advanced/development/) for setup instructions.
|
|
199
|
+
|
|
200
|
+
Quick reference:
|
|
201
|
+
|
|
202
|
+
<!--pytest.mark.skip-->
|
|
203
|
+
```bash
|
|
204
|
+
# Setup
|
|
205
|
+
git clone https://github.com/Apex-Engineers-Inc/rustest.git
|
|
206
|
+
cd rustest
|
|
207
|
+
uv sync --all-extras
|
|
208
|
+
uv run maturin develop
|
|
209
|
+
|
|
210
|
+
# Run tests
|
|
211
|
+
uv run poe pytests # Python tests
|
|
212
|
+
cargo test # Rust tests
|
|
213
|
+
|
|
214
|
+
# Format and lint
|
|
215
|
+
uv run pre-commit install # One-time setup
|
|
216
|
+
git commit -m "message" # Pre-commit hooks run automatically
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
## License
|
|
220
|
+
|
|
221
|
+
rustest is distributed under the terms of the MIT license. See [LICENSE](LICENSE).
|
|
222
|
+
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
rustest-0.6.0.dist-info/METADATA,sha256=OaAioWZ5wAX75e9VciefGvwIWd7fa-FkCMjODMyfea8,8671
|
|
2
|
+
rustest-0.6.0.dist-info/WHEEL,sha256=bNaa2-XeaoMXnkzV391Sm2NgCjpJ3A2VmfN6ZUnNTZA,96
|
|
3
|
+
rustest-0.6.0.dist-info/entry_points.txt,sha256=7fUa3LO8vudQ4dKG1sTRaDnxcMdBSZsWs9EyuxFQ7Lk,48
|
|
4
|
+
rustest-0.6.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=sGaH15n3vSSv84dmR_QAIDV-xwaUrX-MqwpWIp5ihjk,5904
|
|
8
|
+
rustest/cli.py,sha256=Y7I3sLMA7icsHFLdcGJMy0LElEcoqzrVrTkedE_vGTs,9474
|
|
9
|
+
rustest/core.py,sha256=2_kav-3XPhrtXnayQBDSc_tCaaaEj07rFHq5ln4Em8Q,1227
|
|
10
|
+
rustest/decorators.py,sha256=mUrnY09mn7x0--3OAB47WQRR2f8NtexVSUWAUGcHvyc,19240
|
|
11
|
+
rustest/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
12
|
+
rustest/reporting.py,sha256=g4jdlwjFoKF_fWA_sKfeDwmhDeHxPJQUqypa_E2XQlc,1686
|
|
13
|
+
rustest/rust.cp311-win_amd64.pyd,sha256=_S9o4dm79Gfx9jECXTufK9JthpxZ-cGjllPWHUYY7Os,1344000
|
|
14
|
+
rustest/rust.py,sha256=N_1C-uXRiC2qkV7ecKVcb51-XXyfhYNepd5zs-RIYOo,682
|
|
15
|
+
rustest/rust.pyi,sha256=D2PL2GamLpcwdBDZxFeWC1ZgJ01CkvWycU62LnVTMD0,799
|
|
16
|
+
rustest-0.6.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.
|