From 4120a1662c1fa2e965ebbddbf7365cbaa4fc5cee 2013-12-13 22:46:51 From: Thomas Kluyver Date: 2013-12-13 22:46:51 Subject: [PATCH] Capture server logs when running notebook tests --- diff --git a/IPython/html/tests/launchnotebook.py b/IPython/html/tests/launchnotebook.py index f9a9058..409f0e0 100644 --- a/IPython/html/tests/launchnotebook.py +++ b/IPython/html/tests/launchnotebook.py @@ -1,13 +1,14 @@ """Base class for notebook tests.""" -import os import sys import time import requests from contextlib import contextmanager -from subprocess import Popen, PIPE +from subprocess import Popen, STDOUT from unittest import TestCase +import nose + from IPython.utils.tempdir import TemporaryDirectory class NotebookTestBase(TestCase): @@ -55,11 +56,11 @@ class NotebookTestBase(TestCase): '--ipython-dir=%s' % cls.ipython_dir.name, '--notebook-dir=%s' % cls.notebook_dir.name, ] - devnull = open(os.devnull, 'w') cls.notebook = Popen(notebook_args, - stdout=devnull, - stderr=devnull, + stdout=nose.ipy_stream_capturer.writefd, + stderr=STDOUT, ) + nose.ipy_stream_capturer.ensure_started() cls.wait_until_alive() @classmethod