@@ -424,15 +424,18 @@ class Machine:
424424 output += out
425425 return output
426426
427− def fail(self, *commands: str) -> None:
427+ def fail(self, *commands: str) -> str:
428428 """Execute each command and check that it fails."""
429+ output = ""
429430 for command in commands:
430431 with self.nested("must fail: {}".format(command)):
431− status, output = self.execute(command)
432+ (status, out) = self.execute(command)
432433 if status == 0:
433434 raise Exception(
434435 "command `{}` unexpectedly succeeded".format(command)
435436 )
437+ output += out
438+ return output
436439
437440 def wait_until_succeeds(self, command: str) -> str:
438441 """Wait until a command returns success and return its output.