##// END OF EJS Templates
Limit special-casing of _ variable to doctests....
Limit special-casing of _ variable to doctests. In doctests, _ *must* be special-cased and removed from the user's namespace because otherwise Python won't set it. But we were doing this special-casing unconditionally, making it impossible to write unittests that checked the _ variable after cell execution. This commit makes the special-casing of _ apply only in the doctest execution (where it's needed) and leaves normal unittests alone.

File last commit:

r2926:2be9133b
r3299:827b2686
Show More
test_message_spec.py
40 lines | 1010 B | text/x-python | PythonLexer
/ IPython / zmq / tests / test_message_spec.py
"""Test suite for our zeromq-based messaging specification.
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2010 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING.txt, distributed as part of this software.
#-----------------------------------------------------------------------------
import sys
import time
import nose.tools as nt
from ..blockingkernelmanager import BlockingKernelManager
from IPython.utils import io
def setup():
global KM
KM = BlockingKernelManager()
KM.start_kernel()
KM.start_channels()
# Give the kernel a chance to come up.
time.sleep(1)
def teardown():
io.rprint('Entering teardown...') # dbg
io.rprint('Stopping channels and kernel...') # dbg
KM.stop_channels()
KM.kill_kernel()
# Actual tests
def test_execute():
KM.xreq_channel.execute(code='x=1')
KM.xreq_channel.execute(code='print 1')