From 2c6cfa42faac3e1ac996fb6932d275a82c28397f Mon Sep 17 00:00:00 2001 From: Steffen Allner Date: Wed, 22 Jun 2016 12:14:35 +0200 Subject: [PATCH] Disable capturing for setuponly output --- _pytest/python.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/_pytest/python.py b/_pytest/python.py index 142a07acf..f02c54441 100644 --- a/_pytest/python.py +++ b/_pytest/python.py @@ -2525,7 +2525,12 @@ class FixtureDef: return result def _log_fixture_stack(self, what): - tw = self._fixturemanager.config.get_terminal_writer() + config = self._fixturemanager.config + capman = config.pluginmanager.getplugin('capturemanager') + if capman: + capman.suspendcapture() + + tw = config.get_terminal_writer() tw.line() tw.write(' ' * 2 * self.scopenum) tw.write('{step} {scope} {fixture}'.format( @@ -2535,6 +2540,9 @@ class FixtureDef: if hasattr(self, 'cached_param'): tw.write('[{}]'.format(self.cached_param)) + if capman: + capman.resumecapture() + def __repr__(self): return ("" % (self.argname, self.scope, self.baseid))