MCPcopy Index your code
hub / github.com/RustPython/RustPython / get_state

Method get_state

Lib/test/libregrtest/results.py:61–82  ·  view source on GitHub ↗
(self, fail_env_changed: bool)

Source from the content-addressed store, hash-verified

59 self.env_changed))
60
61 def get_state(self, fail_env_changed: bool) -> str:
62 state = []
63 ansi = get_colors()
64 green = ansi.GREEN
65 red = ansi.BOLD_RED
66 reset = ansi.RESET
67 yellow = ansi.YELLOW
68 if self.bad:
69 state.append(f"{red}FAILURE{reset}")
70 elif fail_env_changed and self.env_changed:
71 state.append(f"{yellow}ENV CHANGED{reset}")
72 elif self.no_tests_run():
73 state.append(f"{yellow}NO TESTS RAN{reset}")
74
75 if self.interrupted:
76 state.append(f"{yellow}INTERRUPTED{reset}")
77 if self.worker_bug:
78 state.append(f"{red}WORKER BUG{reset}")
79 if not state:
80 state.append(f"{green}SUCCESS{reset}")
81
82 return ', '.join(state)
83
84 def get_exitcode(self, fail_env_changed: bool, fail_rerun: bool) -> int:
85 exitcode = 0

Callers

nothing calls this directly

Calls 4

no_tests_runMethod · 0.95
get_colorsFunction · 0.90
appendMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected