From 255788a2d23c203bf8619d0997b69f988ead1161 Mon Sep 17 00:00:00 2001 From: Oliverpool Date: Thu, 22 Oct 2015 19:39:23 +0200 Subject: [PATCH] Log the output in case of command failure --- test/test_compilation/test_compilation.py | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/test/test_compilation/test_compilation.py b/test/test_compilation/test_compilation.py index 3aad14eb..c4749257 100644 --- a/test/test_compilation/test_compilation.py +++ b/test/test_compilation/test_compilation.py @@ -6,11 +6,13 @@ import glob import os import subprocess import unittest +import logging from patacrep.encoding import open_read from .. import dynamic # pylint: disable=unused-import +LOGGER = logging.getLogger(__name__) class FileTest(unittest.TestCase, metaclass=dynamic.DynamicTest): """Test of songbook compilation. @@ -96,24 +98,14 @@ class FileTest(unittest.TestCase, metaclass=dynamic.DynamicTest): if steps: command.extend(['--steps', steps]) - return subprocess.check_call( - command, - stdin=subprocess.DEVNULL, - stdout=subprocess.DEVNULL, - stderr=subprocess.DEVNULL, - cwd=os.path.dirname(songbook), - ) - #temp fix for travis tests try: - val = subprocess.check_output( + subprocess.check_output( command, stderr=subprocess.STDOUT, universal_newlines=True, cwd=os.path.dirname(songbook), ) - print("###ok") - print(val) - print("ok###") + return 0 except subprocess.CalledProcessError as e: - print(e.output) - return 1 \ No newline at end of file + LOGGER.warning(e.output) + return e.returncode \ No newline at end of file