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/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)