##// END OF EJS Templates
Removed require.js scheme since it forces async event driven model,...
Removed require.js scheme since it forces async event driven model, this model does not work with the comm/widget communication model. We need to be able to load the dependencies before we send the show() message to the widget manager. Otherwise a race condition will exist where the widget manager may recieve the show message before the dependencies have been loaded (happened almost every time).

File last commit:

r13366:518e26e1
r14257:20896811
Show More
test_debug.py
55 lines | 1.6 KiB | text/x-python | PythonLexer
"""
Module with tests for debug
"""
#-----------------------------------------------------------------------------
# Copyright (c) 2013, the IPython Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
#-----------------------------------------------------------------------------
#-----------------------------------------------------------------------------
# Imports
#-----------------------------------------------------------------------------
import sys
from ...tests.base import TestsBase
from ..debug import DebugWriter
from IPython.utils.py3compat import PY3
if PY3:
from io import StringIO
else:
from StringIO import StringIO
#-----------------------------------------------------------------------------
# Class
#-----------------------------------------------------------------------------
class TestDebug(TestsBase):
"""Contains test functions for debug.py"""
def test_output(self):
"""Test debug writer output."""
# Capture the stdout. Remember original.
stdout = sys.stdout
stream = StringIO()
sys.stdout = stream
# Create stdout writer, get output
writer = DebugWriter()
writer.write('aaa', {'outputs': {'bbb': 'ccc'}})
output = stream.getvalue()
# Check output. Make sure resources dictionary is dumped, but nothing
# else.
assert 'aaa' not in output
assert 'bbb' in output
assert 'ccc' in output
# Revert stdout
sys.stdout = stdout