MCPcopy Index your code
hub / github.com/python/cpython / RunTests

Class RunTests

Lib/test/libregrtest/runtests.py:79–198  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

77
78@dataclasses.dataclass(slots=True, frozen=True)
79class RunTests:
80 tests: TestTuple
81 fail_fast: bool
82 fail_env_changed: bool
83 match_tests: TestFilter
84 match_tests_dict: FilterDict | None
85 rerun: bool
86 forever: bool
87 pgo: bool
88 pgo_extended: bool
89 output_on_failure: bool
90 timeout: float | None
91 verbose: int
92 quiet: bool
93 hunt_refleak: HuntRefleak | None
94 test_dir: StrPath | None
95 use_junit: bool
96 coverage: bool
97 memory_limit: str | None
98 gc_threshold: int | None
99 use_resources: dict[str, str | None]
100 python_cmd: tuple[str, ...] | None
101 randomize: bool
102 random_seed: int | str
103 parallel_threads: int | None
104
105 def copy(self, **override) -> 'RunTests':
106 state = dataclasses.asdict(self)
107 state.update(override)
108 return RunTests(**state)
109
110 def create_worker_runtests(self, **override) -> WorkerRunTests:
111 state = dataclasses.asdict(self)
112 state.update(override)
113 return WorkerRunTests(**state)
114
115 def get_match_tests(self, test_name: TestName) -> FilterTuple | None:
116 if self.match_tests_dict is not None:
117 return self.match_tests_dict.get(test_name, None)
118 else:
119 return None
120
121 def get_jobs(self) -> int | None:
122 # Number of run_single_test() calls needed to run all tests.
123 # None means that there is not bound limit (--forever option).
124 if self.forever:
125 return None
126 return len(self.tests)
127
128 def iter_tests(self) -> Iterator[TestName]:
129 if self.forever:
130 while True:
131 yield from self.tests
132 else:
133 yield from self.tests
134
135 def json_file_use_stdout(self) -> bool:
136 # Use STDOUT in two cases:

Callers 2

copyMethod · 0.70
create_run_testsMethod · 0.70

Calls

no outgoing calls

Tested by 1

copyMethod · 0.56

Used in the wild real call sites across dependent graphs

searching dependent graphs…