diff options
author | Jonathan Maw <jonathan.maw@codethink.co.uk> | 2017-05-24 13:27:51 +0100 |
---|---|---|
committer | Jonathan Maw <jonathan.maw@codethink.co.uk> | 2017-05-25 12:05:15 +0100 |
commit | 04457a189484f08f1b8e5d495a3dbc9102d1f20c (patch) | |
tree | efe36bc1c07d7887ece8d10685a90edf83a9912d | |
parent | 98a4492b13d312aaeb2a3ea3c115e33a1a0c447c (diff) | |
download | buildstream-04457a189484f08f1b8e5d495a3dbc9102d1f20c.tar.gz |
Make logging go to stdout when the test suite is being run in CI
-rw-r--r-- | buildstream/plugin.py | 5 | ||||
-rw-r--r-- | setup.cfg | 4 | ||||
-rwxr-xr-x | setup.py | 1 |
3 files changed, 8 insertions, 2 deletions
diff --git a/buildstream/plugin.py b/buildstream/plugin.py index f66e5c072..59753d247 100644 --- a/buildstream/plugin.py +++ b/buildstream/plugin.py @@ -22,6 +22,7 @@ import os import datetime import subprocess import signal +import sys from subprocess import CalledProcessError from contextlib import contextmanager from weakref import WeakValueDictionary @@ -548,7 +549,9 @@ class Plugin(): # @contextmanager def _output_file(self): - if not self.__log: + if 'BST_TEST_SUITE' in os.environ: + yield sys.stdout + elif not self.__log: with open(os.devnull, "w") as output: yield output else: @@ -11,4 +11,6 @@ pep8ignore = doc/source/conf.py ALL tmp/* ALL */lib/python3* ALL - */bin/* ALL
\ No newline at end of file + */bin/* ALL +env = + D:BST_TEST_SUITE=True @@ -119,5 +119,6 @@ setup(name='BuildStream', 'pytest-datafiles', 'pytest-pep8', 'pytest-cov', + 'pytest-env', 'pytest'], zip_safe=False) |