Capture server logs when running notebook tests

This commit is contained in:
Thomas Kluyver 2013-12-09 12:33:03 -08:00
parent c5d0f1614f
commit c2644a20be

View File

@ -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