stubtest_third_party.py, mypy_test.py: just print everything to stdout (#11809)

This commit is contained in:
Alex Waygood
2024-04-22 11:50:47 +01:00
committed by GitHub
parent e974246714
commit 1a86b3b3fe
2 changed files with 35 additions and 41 deletions

View File

@@ -41,19 +41,19 @@ def strip_comments(text: str) -> str:
def print_command(cmd: str | Iterable[str]) -> None:
if not isinstance(cmd, str):
cmd = " ".join(cmd)
print(colored(f"Running: {cmd}", "blue"), file=sys.stderr)
print(colored(f"Running: {cmd}", "blue"))
def print_error(error: str, end: str = "\n", fix_path: tuple[str, str] = ("", "")) -> None:
error_split = error.split("\n")
old, new = fix_path
for line in error_split[:-1]:
print(colored(line.replace(old, new), "red"), file=sys.stderr)
print(colored(error_split[-1], "red"), end=end, file=sys.stderr)
print(colored(line.replace(old, new), "red"))
print(colored(error_split[-1], "red"), end=end)
def print_success_msg() -> None:
print(colored("success", "green"), file=sys.stderr)
print(colored("success", "green"))
def print_divider() -> None:
@@ -61,9 +61,9 @@ def print_divider() -> None:
This can be useful to divide terminal output into separate sections.
"""
print(file=sys.stderr)
print("*" * 70, file=sys.stderr)
print(file=sys.stderr)
print()
print("*" * 70)
print()
# ====================================================================