Skip to content

Commit 2c6cfa4

Browse files
committed
Disable capturing for setuponly output
1 parent de9ed5e commit 2c6cfa4

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

_pytest/python.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2525,7 +2525,12 @@ def execute(self, request):
25252525
return result
25262526

25272527
def _log_fixture_stack(self, what):
2528-
tw = self._fixturemanager.config.get_terminal_writer()
2528+
config = self._fixturemanager.config
2529+
capman = config.pluginmanager.getplugin('capturemanager')
2530+
if capman:
2531+
capman.suspendcapture()
2532+
2533+
tw = config.get_terminal_writer()
25292534
tw.line()
25302535
tw.write(' ' * 2 * self.scopenum)
25312536
tw.write('{step} {scope} {fixture}'.format(
@@ -2535,6 +2540,9 @@ def _log_fixture_stack(self, what):
25352540
if hasattr(self, 'cached_param'):
25362541
tw.write('[{}]'.format(self.cached_param))
25372542

2543+
if capman:
2544+
capman.resumecapture()
2545+
25382546
def __repr__(self):
25392547
return ("<FixtureDef name=%r scope=%r baseid=%r >" %
25402548
(self.argname, self.scope, self.baseid))

0 commit comments

Comments
 (0)