rustest 0.14.0__cp313-cp313-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.
- rustest/__init__.py +39 -0
- rustest/__main__.py +10 -0
- rustest/approx.py +176 -0
- rustest/builtin_fixtures.py +1137 -0
- rustest/cli.py +135 -0
- rustest/compat/__init__.py +3 -0
- rustest/compat/pytest.py +1141 -0
- rustest/core.py +56 -0
- rustest/decorators.py +968 -0
- rustest/fixture_registry.py +130 -0
- rustest/py.typed +0 -0
- rustest/reporting.py +63 -0
- rustest/rust.cpython-313-darwin.so +0 -0
- rustest/rust.py +23 -0
- rustest/rust.pyi +43 -0
- rustest-0.14.0.dist-info/METADATA +151 -0
- rustest-0.14.0.dist-info/RECORD +20 -0
- rustest-0.14.0.dist-info/WHEEL +4 -0
- rustest-0.14.0.dist-info/entry_points.txt +2 -0
- rustest-0.14.0.dist-info/licenses/LICENSE +21 -0
rustest/core.py
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"""High level Python API wrapping the Rust extension."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from collections.abc import Sequence
|
|
6
|
+
|
|
7
|
+
from . import rust
|
|
8
|
+
from .reporting import RunReport
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def run(
|
|
12
|
+
*,
|
|
13
|
+
paths: Sequence[str],
|
|
14
|
+
pattern: str | None = None,
|
|
15
|
+
mark_expr: str | None = None,
|
|
16
|
+
workers: int | None = None,
|
|
17
|
+
capture_output: bool = True,
|
|
18
|
+
enable_codeblocks: bool = True,
|
|
19
|
+
last_failed_mode: str = "none",
|
|
20
|
+
fail_fast: bool = False,
|
|
21
|
+
pytest_compat: bool = False,
|
|
22
|
+
verbose: bool = False,
|
|
23
|
+
ascii: bool = False,
|
|
24
|
+
no_color: bool = False,
|
|
25
|
+
) -> RunReport:
|
|
26
|
+
"""Execute tests and return a rich report.
|
|
27
|
+
|
|
28
|
+
Args:
|
|
29
|
+
paths: Files or directories to collect tests from
|
|
30
|
+
pattern: Substring to filter tests by (case insensitive)
|
|
31
|
+
mark_expr: Mark expression to filter tests (e.g., "slow", "not slow", "slow and integration")
|
|
32
|
+
workers: Number of worker slots to use (experimental)
|
|
33
|
+
capture_output: Whether to capture stdout/stderr during test execution
|
|
34
|
+
enable_codeblocks: Whether to enable code block tests from markdown files
|
|
35
|
+
last_failed_mode: Last failed mode: "none", "only", or "first"
|
|
36
|
+
fail_fast: Exit instantly on first error or failed test
|
|
37
|
+
pytest_compat: Enable pytest compatibility mode (intercept 'import pytest')
|
|
38
|
+
verbose: Show verbose output with hierarchical test structure
|
|
39
|
+
ascii: Use ASCII characters instead of Unicode symbols for output
|
|
40
|
+
no_color: Disable colored output
|
|
41
|
+
"""
|
|
42
|
+
raw_report = rust.run(
|
|
43
|
+
paths=list(paths),
|
|
44
|
+
pattern=pattern,
|
|
45
|
+
mark_expr=mark_expr,
|
|
46
|
+
workers=workers,
|
|
47
|
+
capture_output=capture_output,
|
|
48
|
+
enable_codeblocks=enable_codeblocks,
|
|
49
|
+
last_failed_mode=last_failed_mode,
|
|
50
|
+
fail_fast=fail_fast,
|
|
51
|
+
pytest_compat=pytest_compat,
|
|
52
|
+
verbose=verbose,
|
|
53
|
+
ascii=ascii,
|
|
54
|
+
no_color=no_color,
|
|
55
|
+
)
|
|
56
|
+
return RunReport.from_py(raw_report)
|