From 4a9f5b636ef63532569676c416caa149731e930b Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Sun, 10 Jan 2021 15:27:16 +0100 Subject: Added fail safe if leak check test timeout --- src/test/result.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/test/result.py') diff --git a/src/test/result.py b/src/test/result.py index e601f2a..2ae5e15 100644 --- a/src/test/result.py +++ b/src/test/result.py @@ -6,7 +6,7 @@ # By: charles +#+ +:+ +#+ # # +#+#+#+#+#+ +#+ # # Created: 2020/09/11 12:17:34 by charles #+# #+# # -# Updated: 2021/01/10 14:56:33 by cacharle ### ########.fr # +# Updated: 2021/01/10 15:25:45 by cacharle ### ########.fr # # # # ############################################################################ # @@ -48,8 +48,8 @@ class Result: self.set_colors() @staticmethod - def leak(cmd: str, leak_output: str = None): - return Result(cmd, None, None, None, leak_output) + def leak(cmd: str, captured: Captured): + return Result(cmd, None, None, captured, captured.output) def _search_leak_kind(self, kind: str) -> int: match = re.search( @@ -79,6 +79,8 @@ class Result: def passed(self): """Check if the result passed""" if self.leak_output is not None: + if self.actual.is_timeout: + return False return self.lost_bytes == 0 return self.actual == self.expected -- cgit