From c709453933adf53371f5d68ca49662299ed1232c Mon Sep 17 00:00:00 2001 From: Andrew Schoen Date: Thu, 12 Feb 2015 15:19:25 -0600 Subject: [PATCH] Remove the pytest default TerminalReporter in the tests task This fixes the issue of pytest IO Error failure in a scheduled job Signed-off-by: Andrew Schoen --- teuthology/task/tests/__init__.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/teuthology/task/tests/__init__.py b/teuthology/task/tests/__init__.py index bbed7e26a9..7b879aabcf 100644 --- a/teuthology/task/tests/__init__.py +++ b/teuthology/task/tests/__init__.py @@ -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() -- 2.39.5