]> git-server-git.apps.pok.os.sepia.ceph.com Git - teuthology.git/commitdiff
Remove the pytest default TerminalReporter in the tests task 437/head
authorAndrew Schoen <aschoen@redhat.com>
Thu, 12 Feb 2015 21:19:25 +0000 (15:19 -0600)
committerAndrew Schoen <aschoen@redhat.com>
Fri, 13 Feb 2015 15:00:53 +0000 (09:00 -0600)
This fixes the issue of pytest IO Error failure in a scheduled job

Signed-off-by: Andrew Schoen <aschoen@redhat.com>
teuthology/task/tests/__init__.py

index bbed7e26a95d3040e5a0c1d55ac7141a2fc5185c..7b879aabcff9a3e3decbae126043de326132f6e9 100644 (file)
@@ -38,6 +38,15 @@ class TeuthologyContextPlugin(object):
         # pass the teuthology ctx and config to each test method
         metafunc.parametrize(["ctx", "config"], [(self.ctx, self.config),])
 
+    @pytest.mark.trylast
+    def pytest_configure(self, config):
+        # removes the default pytest TerminalReporter
+        # this fixes failures with scheduled jobs; when run by a worker
+        # there is no terminal to report to and pytest dies
+        standard_reporter = config.pluginmanager.getplugin('terminalreporter')
+        config.pluginmanager.unregister(standard_reporter)
+        log.info("removing pytest terminal reporter")
+
     # log the outcome of each test
     def pytest_runtest_makereport(self, __multicall__, item, call):
         report = __multicall__.execute()