Add ability to skip log capture.

Change-Id: I8f3ac5c469e9d530d1ac7776c7488d0c42cdf1ad
Reviewed-on: https://review.openstack.org/35329
Approved: James E. Blair <corvus@inaugust.com>
Reviewed-by: James E. Blair <corvus@inaugust.com>
Tested-by: Jenkins
diff --git a/.testr.conf b/.testr.conf
index c4ecf2c..5433c07 100644
--- a/.testr.conf
+++ b/.testr.conf
@@ -1,4 +1,4 @@
 [DEFAULT]
-test_command=OS_STDOUT_CAPTURE=1 OS_STDERR_CAPTURE=1 ${PYTHON:-python} -m subunit.run discover -t ./ tests $LISTOPT $IDOPTION
+test_command=OS_STDOUT_CAPTURE=${OS_STDOUT_CAPTURE:-1} OS_STDERR_CAPTURE=${OS_STDERR_CAPTURE:-1} OS_LOG_CAPTURE=${OS_LOG_CAPTURE:-1} ${PYTHON:-python} -m subunit.run discover -t ./ tests $LISTOPT $IDOPTION
 test_id_option=--load-list $IDFILE
 test_list_option=--list
diff --git a/tests/test_scheduler.py b/tests/test_scheduler.py
index da9b431..100b924 100644
--- a/tests/test_scheduler.py
+++ b/tests/test_scheduler.py
@@ -680,7 +680,9 @@
             stderr = self.useFixture(fixtures.StringStream('stderr')).stream
             self.useFixture(fixtures.MonkeyPatch('sys.stderr', stderr))
         self.useFixture(fixtures.NestedTempfile())
-        self.log_fixture = self.useFixture(fixtures.FakeLogger())
+        if (os.environ.get('OS_LOG_CAPTURE') == 'True' or
+            os.environ.get('OS_LOG_CAPTURE') == '1'):
+            self.useFixture(fixtures.FakeLogger())
 
         tmp_root = os.environ.get("ZUUL_TEST_ROOT", tempfile.mkdtemp())
         self.test_root = os.path.join(tmp_root, "zuul-test")