Fixed integration with other modules/tests
This commit is contained in:
parent
8b2c91836b
commit
0564b52c0e
|
@ -102,7 +102,8 @@ class PdbInvoke(object):
|
|||
def pytest_exception_interact(self, node, call, report):
|
||||
capman = node.config.pluginmanager.getplugin("capturemanager")
|
||||
if capman:
|
||||
out, err = capman.suspend_global_capture(in_=True)
|
||||
capman.suspend_global_capture(in_=True)
|
||||
out, err = capman.snap_global_capture()
|
||||
sys.stdout.write(out)
|
||||
sys.stdout.write(err)
|
||||
_enter_pdb(node, call.excinfo, report)
|
||||
|
|
|
@ -51,7 +51,8 @@ def _show_fixture_action(fixturedef, msg):
|
|||
config = fixturedef._fixturemanager.config
|
||||
capman = config.pluginmanager.getplugin("capturemanager")
|
||||
if capman:
|
||||
out, err = capman.suspend_global_capture()
|
||||
capman.suspend_global_capture()
|
||||
out, err = capman.snap_global_capture()
|
||||
|
||||
tw = config.get_terminal_writer()
|
||||
tw.line()
|
||||
|
|
|
@ -890,10 +890,6 @@ def test_live_logging_suspends_capture(has_capture_manager, request):
|
|||
yield
|
||||
self.calls.append("exit disabled")
|
||||
|
||||
# sanity check
|
||||
assert CaptureManager.suspend_capture_item
|
||||
assert CaptureManager.resume_global_capture
|
||||
|
||||
class DummyTerminal(six.StringIO):
|
||||
def section(self, *args, **kwargs):
|
||||
pass
|
||||
|
|
|
@ -70,19 +70,23 @@ class TestCaptureManager(object):
|
|||
try:
|
||||
capman = CaptureManager(method)
|
||||
capman.start_global_capturing()
|
||||
outerr = capman.suspend_global_capture()
|
||||
capman.suspend_global_capture()
|
||||
outerr = capman.snap_global_capture()
|
||||
assert outerr == ("", "")
|
||||
outerr = capman.suspend_global_capture()
|
||||
capman.suspend_global_capture()
|
||||
outerr = capman.snap_global_capture()
|
||||
assert outerr == ("", "")
|
||||
print("hello")
|
||||
out, err = capman.suspend_global_capture()
|
||||
capman.suspend_global_capture()
|
||||
out, err = capman.snap_global_capture()
|
||||
if method == "no":
|
||||
assert old == (sys.stdout, sys.stderr, sys.stdin)
|
||||
else:
|
||||
assert not out
|
||||
capman.resume_global_capture()
|
||||
print("hello")
|
||||
out, err = capman.suspend_global_capture()
|
||||
capman.suspend_global_capture()
|
||||
out, err = capman.snap_global_capture()
|
||||
if method != "no":
|
||||
assert out == "hello\n"
|
||||
capman.stop_global_capturing()
|
||||
|
|
Loading…
Reference in New Issue