in java/ext/javadoctest.py [0:0]
def clean_output(self, output: str):
lines = output.split("\n")
# Remove log lines from output
lines = [l for l in lines if not l.startswith("[INFO]")]
lines = [l for l in lines if not l.startswith("[WARNING]")]
lines = [l for l in lines if not l.startswith("Download")]
lines = [l for l in lines if not l.startswith("Progress")]
result = "\n".join(lines)
# Sometimes the testoutput content is smushed onto the same line as
# following log line, probably just when the testcode code doesn't print
# its own final newline. This example is the only case I found so I
# didn't pull out the re module (i.e., this works)
result = result.replace(
"[INFO] ------------------------------------------------------------------------",
"",
)
# Convert all tabs to 4 spaces, Sphinx seems to eat tabs even if we
# explicitly put them in the testoutput block so we instead modify
# the output
result = (4 * " ").join(result.split("\t"))
return result.strip()