##// END OF EJS Templates
Open 0.10.2 branch for development....
Open 0.10.2 branch for development. I don't expect to see much happen in this branch, but we'll have it available so people can contribute bug fixes and make pull requests. If we get enough contributions here, eventually we'll put a 0.10.2 release out.

File last commit:

r1960:51f38f50
r3134:8f60cada
Show More
test_contexts.py
46 lines | 1.1 KiB | text/x-python | PythonLexer
# Tell nose to skip this module
__test__ = {}
#from __future__ import with_statement
# XXX This file is currently disabled to preserve 2.4 compatibility.
#def test_simple():
if 0:
# XXX - for now, we need a running cluster to be started separately. The
# daemon work is almost finished, and will make much of this unnecessary.
from IPython.kernel import client
mec = client.MultiEngineClient(('127.0.0.1',10105))
try:
mec.get_ids()
except ConnectionRefusedError:
import os, time
os.system('ipcluster -n 2 &')
time.sleep(2)
mec = client.MultiEngineClient(('127.0.0.1',10105))
mec.block = False
import itertools
c = itertools.count()
parallel = RemoteMultiEngine(mec)
mec.pushAll()
## with parallel as pr:
## # A comment
## remote() # this means the code below only runs remotely
## print 'Hello remote world'
## x = range(10)
## # Comments are OK
## # Even misindented.
## y = x+1
## with pfor('i',sequence) as pr:
## print x[i]
print pr.x + pr.y