rustest 0.1.0__cp311-cp311-macosx_11_0_arm64.whl → 0.5.0__cp311-cp311-macosx_11_0_arm64.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.
@@ -1,487 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: rustest
3
- Version: 0.1.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.8
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: ruff>=0.1.9 ; extra == 'dev'
22
- Provides-Extra: dev
23
- License-File: LICENSE
24
- Summary: Rust powered pytest-compatible runner
25
- Author: rustest contributors
26
- Requires-Python: >=3.10
27
- Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
28
- Project-URL: Homepage, https://github.com/Apex-Engineers-Inc/rustest
29
- Project-URL: Repository, https://github.com/Apex-Engineers-Inc/rustest
30
-
31
- # rustest
32
-
33
- 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 **78x faster** test execution with familiar syntax and minimal setup.
34
-
35
- ## Why rustest?
36
-
37
- - 🚀 **78x faster** than pytest (measured on real-world integration tests)
38
- - ✅ Familiar `@fixture`, `@parametrize`, `@skip`, and `@mark` decorators
39
- - 🔍 Automatic test discovery (`test_*.py` and `*_test.py` files)
40
- - 🎯 Simple, clean API—if you know pytest, you already know rustest
41
- - 📦 Easy installation with pip or uv
42
- - ⚡ Sub-10ms execution for small test suites—tests feel instant
43
-
44
- ## Performance
45
-
46
- Rustest is designed for speed. Our benchmarks show **78x faster** execution compared to pytest on the rustest integration test suite (~199 tests):
47
-
48
- | Test Runner | Time | Tests/Second | Speedup |
49
- |-------------|------|--------------|---------|
50
- | pytest | 0.39s | 502 | 1.0x (baseline) |
51
- | rustest | 0.005s | 39,800 | **78x faster** |
52
-
53
- **Actual CI measurements:**
54
- - **pytest**: 196 passed, 5 skipped in 0.39s
55
- - **rustest**: 194 passed, 5 skipped in 0.005s
56
-
57
- **Why so fast?**
58
- - **Near-zero startup time**: Native Rust binary vs Python interpreter startup
59
- - **Rust-native test discovery**: Minimal imports until test execution
60
- - **Optimized fixture resolution**: Efficient dependency graph in Rust
61
- - **Efficient orchestration**: ~50-100μs per-test overhead vs ~1-2ms in pytest
62
-
63
- **Real-world impact:**
64
- - **200 tests**: 0.39s → 0.005s (instant feedback)
65
- - **1,000 tests**: ~2s → ~0.025s (tests complete before you can switch tabs)
66
- - **10,000 tests**: ~20s → ~0.25s (dramatically faster feedback loops)
67
-
68
- See [BENCHMARKS.md](BENCHMARKS.md) for detailed performance analysis and methodology.
69
-
70
- ## Installation
71
-
72
- Rustest supports Python **3.10 through 3.14**.
73
-
74
- ### Using pip
75
- ```bash
76
- pip install rustest
77
- ```
78
-
79
- ### Using uv
80
- ```bash
81
- uv add rustest
82
- ```
83
-
84
- ### For Development
85
- If you want to contribute to rustest, see [DEVELOPMENT.md](DEVELOPMENT.md) for setup instructions.
86
-
87
- ## Quick Start
88
-
89
- ### 1. Write Your Tests
90
-
91
- Create a file `test_math.py`:
92
-
93
- ```python
94
- from rustest import fixture, parametrize, mark
95
-
96
- @fixture
97
- def numbers() -> list[int]:
98
- return [1, 2, 3, 4, 5]
99
-
100
- def test_sum(numbers: list[int]) -> None:
101
- assert sum(numbers) == 15
102
-
103
- @parametrize("value,expected", [(2, 4), (3, 9), (4, 16)])
104
- def test_square(value: int, expected: int) -> None:
105
- assert value ** 2 == expected
106
-
107
- @mark.slow
108
- def test_expensive_operation() -> None:
109
- # This test is marked as slow for filtering
110
- result = sum(range(1000000))
111
- assert result > 0
112
- ```
113
-
114
- ### 2. Run Your Tests
115
-
116
- ```bash
117
- # Run all tests in the current directory
118
- rustest
119
-
120
- # Run tests in a specific directory
121
- rustest tests/
122
-
123
- # Run tests matching a pattern
124
- rustest -k "test_sum"
125
-
126
- # Show output during test execution
127
- rustest --no-capture
128
- ```
129
-
130
- ## Usage Examples
131
-
132
- ### CLI Usage
133
-
134
- ```bash
135
- # Run all tests in current directory
136
- rustest
137
-
138
- # Run tests in specific paths
139
- rustest tests/ integration/
140
-
141
- # Filter tests by name pattern
142
- rustest -k "user" # Runs test_user_login, test_user_signup, etc.
143
- rustest -k "auth" # Runs all tests with "auth" in the name
144
-
145
- # Control output capture
146
- rustest --no-capture # See print statements during test execution
147
- ```
148
-
149
- ### Python API Usage
150
-
151
- You can also run rustest programmatically from Python:
152
-
153
- ```python
154
- from rustest import run
155
-
156
- # Basic usage
157
- report = run(paths=["tests"])
158
- print(f"Passed: {report.passed}, Failed: {report.failed}")
159
-
160
- # With pattern filtering
161
- report = run(paths=["tests"], pattern="user")
162
-
163
- # Without output capture (see print statements)
164
- report = run(paths=["tests"], capture_output=False)
165
-
166
- # Access individual test results
167
- for result in report.results:
168
- print(f"{result.name}: {result.status} ({result.duration:.3f}s)")
169
- if result.status == "failed":
170
- print(f" Error: {result.message}")
171
- ```
172
-
173
- ### Writing Tests
174
-
175
- #### Basic Test Functions
176
-
177
- ```python
178
- def test_simple_assertion() -> None:
179
- assert 1 + 1 == 2
180
-
181
- def test_string_operations() -> None:
182
- text = "hello world"
183
- assert text.startswith("hello")
184
- assert "world" in text
185
- ```
186
-
187
- #### Using Fixtures
188
-
189
- Fixtures provide reusable test data and setup:
190
-
191
- ```python
192
- from rustest import fixture
193
-
194
- @fixture
195
- def database_connection() -> dict:
196
- # Setup: create a connection
197
- conn = {"host": "localhost", "port": 5432}
198
- return conn
199
- # Teardown happens automatically
200
-
201
- @fixture
202
- def sample_user() -> dict:
203
- return {"id": 1, "name": "Alice", "email": "alice@example.com"}
204
-
205
- def test_database_query(database_connection: dict) -> None:
206
- assert database_connection["host"] == "localhost"
207
-
208
- def test_user_email(sample_user: dict) -> None:
209
- assert "@" in sample_user["email"]
210
- ```
211
-
212
- #### Fixtures with Dependencies
213
-
214
- Fixtures can depend on other fixtures:
215
-
216
- ```python
217
- from rustest import fixture
218
-
219
- @fixture
220
- def api_url() -> str:
221
- return "https://api.example.com"
222
-
223
- @fixture
224
- def api_client(api_url: str) -> dict:
225
- return {"base_url": api_url, "timeout": 30}
226
-
227
- def test_api_configuration(api_client: dict) -> None:
228
- assert api_client["base_url"].startswith("https://")
229
- assert api_client["timeout"] == 30
230
- ```
231
-
232
- #### Yield Fixtures with Setup/Teardown
233
-
234
- Fixtures can use `yield` to perform cleanup after tests:
235
-
236
- ```python
237
- from rustest import fixture
238
-
239
- @fixture
240
- def database_connection():
241
- # Setup: create connection
242
- conn = create_db_connection()
243
- print("Database connected")
244
-
245
- yield conn
246
-
247
- # Teardown: close connection
248
- conn.close()
249
- print("Database connection closed")
250
-
251
- @fixture
252
- def temp_file():
253
- # Setup
254
- file = open("temp.txt", "w")
255
- file.write("test data")
256
-
257
- yield file
258
-
259
- # Teardown
260
- file.close()
261
- os.remove("temp.txt")
262
-
263
- def test_database_query(database_connection):
264
- result = database_connection.query("SELECT 1")
265
- assert result is not None
266
- ```
267
-
268
- #### Fixture Scopes
269
-
270
- Fixtures support different scopes to control when they are created and destroyed:
271
-
272
- ```python
273
- from rustest import fixture
274
-
275
- @fixture # Default: function scope - new instance per test
276
- def function_fixture() -> dict:
277
- return {"value": "reset each test"}
278
-
279
- @fixture(scope="class") # Shared across all tests in a class
280
- def class_database() -> dict:
281
- return {"connection": "db://test", "shared": True}
282
-
283
- @fixture(scope="module") # Shared across all tests in a module
284
- def module_config() -> dict:
285
- return {"env": "test", "timeout": 30}
286
-
287
- @fixture(scope="session") # Shared across entire test session
288
- def session_cache() -> dict:
289
- return {"global_cache": {}}
290
-
291
- # Fixtures can depend on fixtures with different scopes
292
- @fixture(scope="function")
293
- def request_handler(module_config: dict, session_cache: dict) -> dict:
294
- return {
295
- "config": module_config, # module-scoped
296
- "cache": session_cache, # session-scoped
297
- "request_id": id(object()) # unique per test
298
- }
299
- ```
300
-
301
- **Scope Behavior:**
302
- - `function` (default): New instance for each test function
303
- - `class`: Shared across all test methods in a test class
304
- - `module`: Shared across all tests in a Python module
305
- - `session`: Shared across the entire test session
306
-
307
- Scoped fixtures are especially useful for expensive setup operations like database connections, API clients, or configuration loading.
308
-
309
- **Using conftest.py for Shared Fixtures:**
310
-
311
- You can define fixtures in a `conftest.py` file to share them across multiple test files:
312
-
313
- ```python
314
- # conftest.py
315
- from rustest import fixture
316
-
317
- @fixture(scope="session")
318
- def database():
319
- """Shared database connection for all tests."""
320
- db = setup_database()
321
- yield db
322
- db.cleanup()
323
-
324
- @fixture(scope="module")
325
- def api_client():
326
- """API client shared across a module."""
327
- return create_api_client()
328
- ```
329
-
330
- All test files in the same directory (and subdirectories) can use these fixtures automatically.
331
-
332
- #### Parametrized Tests
333
-
334
- Run the same test with different inputs:
335
-
336
- ```python
337
- from rustest import parametrize
338
-
339
- @parametrize("input,expected", [
340
- (1, 2),
341
- (2, 4),
342
- (3, 6),
343
- ])
344
- def test_double(input: int, expected: int) -> None:
345
- assert input * 2 == expected
346
-
347
- # With custom test IDs for better output
348
- @parametrize("value,expected", [
349
- (2, 4),
350
- (3, 9),
351
- (4, 16),
352
- ], ids=["two", "three", "four"])
353
- def test_square(value: int, expected: int) -> None:
354
- assert value ** 2 == expected
355
- ```
356
-
357
- #### Combining Fixtures and Parameters
358
-
359
- ```python
360
- from rustest import fixture, parametrize
361
-
362
- @fixture
363
- def multiplier() -> int:
364
- return 10
365
-
366
- @parametrize("value,expected", [
367
- (1, 10),
368
- (2, 20),
369
- (3, 30),
370
- ])
371
- def test_multiply(multiplier: int, value: int, expected: int) -> None:
372
- assert multiplier * value == expected
373
- ```
374
-
375
- #### Skipping Tests
376
-
377
- ```python
378
- from rustest import skip, mark
379
-
380
- @skip("Not implemented yet")
381
- def test_future_feature() -> None:
382
- assert False
383
-
384
- @mark.skip(reason="Waiting for API update")
385
- def test_deprecated_api() -> None:
386
- assert False
387
- ```
388
-
389
- #### Using Marks to Organize Tests
390
-
391
- ```python
392
- from rustest import mark
393
-
394
- @mark.unit
395
- def test_calculation() -> None:
396
- assert 2 + 2 == 4
397
-
398
- @mark.integration
399
- def test_database_integration() -> None:
400
- # Integration test
401
- pass
402
-
403
- @mark.slow
404
- @mark.integration
405
- def test_full_workflow() -> None:
406
- # This test has multiple marks
407
- pass
408
- ```
409
-
410
- ### Test Output
411
-
412
- When you run rustest, you'll see clean, informative output:
413
-
414
- ```
415
- PASSED 0.001s test_simple_assertion
416
- PASSED 0.002s test_string_operations
417
- PASSED 0.001s test_database_query
418
- PASSED 0.003s test_square[two]
419
- PASSED 0.001s test_square[three]
420
- PASSED 0.002s test_square[four]
421
- SKIPPED 0.000s test_future_feature
422
- FAILED 0.005s test_broken_feature
423
- ----------------------------------------
424
- AssertionError: Expected 5, got 4
425
- at test_example.py:42
426
-
427
- 8 tests: 6 passed, 1 failed, 1 skipped in 0.015s
428
- ```
429
-
430
- ## Feature Comparison with pytest
431
-
432
- Rustest aims to provide the most commonly-used pytest features with dramatically better performance. Here's how the two compare:
433
-
434
- | Feature | pytest | rustest | Notes |
435
- |---------|--------|---------|-------|
436
- | **Core Test Discovery** |
437
- | `test_*.py` / `*_test.py` files | ✅ | ✅ | Rustest uses Rust for dramatically faster discovery |
438
- | Test function detection (`test_*`) | ✅ | ✅ | |
439
- | Test class detection (`Test*`) | ✅ | ✅ | via `unittest.TestCase` support |
440
- | Pattern-based filtering | ✅ | ✅ | `-k` pattern matching |
441
- | **Fixtures** |
442
- | `@fixture` decorator | ✅ | ✅ | Rust-based dependency resolution |
443
- | Fixture dependency injection | ✅ | ✅ | Much faster in rustest |
444
- | Fixture scopes (function/class/module/session) | ✅ | ✅ | Full support for all scopes |
445
- | Yield fixtures (setup/teardown) | ✅ | ✅ | Full support with cleanup |
446
- | Fixture parametrization | ✅ | 🚧 | Planned |
447
- | **Parametrization** |
448
- | `@parametrize` decorator | ✅ | ✅ | Full support with custom IDs |
449
- | Multiple parameter sets | ✅ | ✅ | |
450
- | Parametrize with fixtures | ✅ | ✅ | |
451
- | **Marks** |
452
- | `@mark.skip` / `@skip` | ✅ | ✅ | Skip tests with reasons |
453
- | Custom marks (`@mark.slow`, etc.) | ✅ | ✅ | Just added! |
454
- | Mark with arguments | ✅ | ✅ | `@mark.timeout(30)` |
455
- | Selecting tests by mark (`-m`) | ✅ | 🚧 | Mark metadata collected, filtering planned |
456
- | **Test Execution** |
457
- | Detailed assertion introspection | ✅ | ❌ | Uses standard Python assertions |
458
- | Parallel execution | ✅ (`pytest-xdist`) | 🚧 | Planned (Rust makes this easier) |
459
- | Test isolation | ✅ | ✅ | |
460
- | Stdout/stderr capture | ✅ | ✅ | |
461
- | **Reporting** |
462
- | Pass/fail/skip summary | ✅ | ✅ | |
463
- | Failure tracebacks | ✅ | ✅ | Full Python traceback support |
464
- | Duration reporting | ✅ | ✅ | Per-test timing |
465
- | JUnit XML output | ✅ | 🚧 | Planned |
466
- | HTML reports | ✅ (`pytest-html`) | 🚧 | Planned |
467
- | **Advanced Features** |
468
- | Plugins | ✅ | ❌ | Not planned (keeps rustest simple) |
469
- | Hooks | ✅ | ❌ | Not planned |
470
- | Custom collectors | ✅ | ❌ | Not planned |
471
- | `conftest.py` | ✅ | ✅ | Shared fixtures across test files |
472
- | **Developer Experience** |
473
- | Fully typed Python API | ⚠️ | ✅ | rustest uses `basedpyright` strict mode |
474
- | Fast CI/CD runs | ⚠️ | ✅ | 78x faster = dramatically shorter feedback loops |
475
-
476
- **Legend:**
477
- - ✅ Fully supported
478
- - 🚧 Planned or in progress
479
- - ⚠️ Partial support
480
- - ❌ Not planned
481
-
482
- **Philosophy:** Rustest implements the 20% of pytest features that cover 80% of use cases, with a focus on raw speed and simplicity. If you need advanced pytest features like plugins or custom hooks, stick with pytest. If you want fast, straightforward testing with familiar syntax, rustest is for you.
483
-
484
- ## License
485
-
486
- rustest is distributed under the terms of the MIT license. See [LICENSE](LICENSE).
487
-
@@ -1,14 +0,0 @@
1
- rustest-0.1.0.dist-info/METADATA,sha256=MxCLrEAs8gtwnesn3cpHVwnD-lzCdw7A03a2aTmxrvI,13963
2
- rustest-0.1.0.dist-info/WHEEL,sha256=dewdenAwp3PDth0u4HpQhcjieEs1_hiwRbm3WvCuoaI,104
3
- rustest-0.1.0.dist-info/entry_points.txt,sha256=7fUa3LO8vudQ4dKG1sTRaDnxcMdBSZsWs9EyuxFQ7Lk,48
4
- rustest-0.1.0.dist-info/licenses/LICENSE,sha256=s64ibUGtb6jEDBsYuxUFtMr_c4PaqYP-vj3YY6QtTGw,1075
5
- rustest/__init__.py,sha256=K7MyGPARnn97RSjk-E_x_1KjqD49RK4fII_sZ_0rdcc,439
6
- rustest/__main__.py,sha256=nqdz6DhrDze715SXxtzAYV2sie3CPoy7IvWCdcyHJEM,179
7
- rustest/_cli.py,sha256=kq9LAwHaJmZ-gnAlTsz7Ov8r1fiDvNoLf4hEI3sxhng,8700
8
- rustest/_decorators.py,sha256=EFcAmZfThiyj_J5l6fEx7Ix9LroXIBrOwa8QuxltNLI,6561
9
- rustest/_reporting.py,sha256=6nVcccX1dgEBW72wCOeOIl5I-OE-ukjJD0VQs56pwjo,1626
10
- rustest/_rust.cpython-311-darwin.so,sha256=RK7ZC1Z3ZNxKvXKNv6ub_mHbJ0mYb2mAGdlcRCgw34s,1466544
11
- rustest/_rust.py,sha256=k3nXhGiehOVY_S6w28rIdrc0CEc3gFLgwWVOEMcPOZo,660
12
- rustest/_rust.pyi,sha256=fDFLX0qj4G_bV1sHmTtRPI26grTDG_LFzPFEqp5vFGk,671
13
- rustest/core.py,sha256=xmBUpuPs0r0HQthc9J5dCQYkZnXqfxqIfSGkHeoqQS4,488
14
- rustest-0.1.0.dist-info/RECORD,,