Browse Source

pytest: Do not re-print logs if we failed to find a log entry

CI always runs with TEST_DEBUG=1 which prints logs anyway, and testing
locally should also be done this way, combined with pytest which
captures the logs. No need to duplicate the functionality of pytest.

Signed-off-by: Christian Decker <decker.christian@gmail.com>
ppa-0.6.1
Christian Decker 7 years ago
committed by Rusty Russell
parent
commit
90527498bc
  1. 4
      tests/utils.py

4
tests/utils.py

@ -121,7 +121,6 @@ class TailableProc(object):
starting from last of the previous waited-for log entries (if any). We starting from last of the previous waited-for log entries (if any). We
fail if the timeout is exceeded or if the underlying process fail if the timeout is exceeded or if the underlying process
exits before all the `regexs` were found. exits before all the `regexs` were found.
""" """
logging.debug("Waiting for {} in the logs".format(regexs)) logging.debug("Waiting for {} in the logs".format(regexs))
exs = [re.compile(r) for r in regexs] exs = [re.compile(r) for r in regexs]
@ -131,9 +130,6 @@ class TailableProc(object):
while True: while True:
if time.time() > start_time + timeout: if time.time() > start_time + timeout:
print("Can't find {} in logs".format(exs)) print("Can't find {} in logs".format(exs))
with self.logs_cond:
for i in range(initial_pos, len(self.logs)):
print(" " + self.logs[i])
for r in exs: for r in exs:
if self.is_in_log(r): if self.is_in_log(r):
print("({} was previously in logs!)".format(r)) print("({} was previously in logs!)".format(r))

Loading…
Cancel
Save