get detailed error instead of unknown result

This commit is contained in:
Suzy Wang 2023-05-24 12:54:30 -07:00
parent 7a4c3b9741
commit 62fc5bb3eb

View File

@ -1047,12 +1047,13 @@ class TestCase:
self.reference_file,
self.stdout_file,
],
encoding="latin-1",
stdout=PIPE,
universal_newlines=True,
).communicate()[0]
if diff.startswith("Binary files "):
diff += "Content of stdout:\n===================\n"
file = open(self.stdout_file, "r")
file = open(self.stdout_file, "rb")
diff += str(file.read())
file.close()
diff += "==================="