Don't readd capturelog handler after log tests.

I don't really know why, but doing that ends up with something calling
sys.stdout.close()...

Fixes #856.
This commit is contained in:
Florian Bruhin 2015-08-07 00:09:02 +02:00
parent aa1ea9b063
commit 8aab87e2a2

View File

@ -27,6 +27,7 @@ import itertools
import sys
import pytest
import pytest_capturelog
from qutebrowser.utils import log
@ -64,7 +65,9 @@ def restore_loggers():
h.close()
root_logger.setLevel(original_logging_level)
for h in root_handlers:
root_logger.addHandler(h)
if not isinstance(h, pytest_capturelog.CaptureLogHandler):
# https://github.com/The-Compiler/qutebrowser/issues/856
root_logger.addHandler(h)
logging._acquireLock()
try:
logging._levelToName.clear()