mirror of
https://github.com/jupyter/notebook.git
synced 2024-12-21 04:10:17 +08:00
Capture server logs when running notebook tests
This commit is contained in:
parent
c5d0f1614f
commit
c2644a20be
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user