##// END OF EJS Templates
reflect revised apply_bound pattern
reflect revised apply_bound pattern

File last commit:

r3655:e5c37613
r3655:e5c37613
Show More
__init__.py
48 lines | 1.2 KiB | text/x-python | PythonLexer
MinRK
some initial tests for newparallel
r3637 """toplevel setup/teardown for parallel tests."""
MinRK
add message tracking to client, add/improve tests
r3654 import tempfile
MinRK
added preliminary tests for zmq.parallel
r3595 import time
MinRK
add message tracking to client, add/improve tests
r3654 from subprocess import Popen, PIPE, STDOUT
MinRK
added preliminary tests for zmq.parallel
r3595
MinRK
reflect revised apply_bound pattern
r3655 from IPython.zmq.parallel import client
MinRK
added preliminary tests for zmq.parallel
r3595
MinRK
some initial tests for newparallel
r3637 processes = []
MinRK
add message tracking to client, add/improve tests
r3654 blackhole = tempfile.TemporaryFile()
MinRK
some initial tests for newparallel
r3637
# nose setup/teardown
MinRK
added preliminary tests for zmq.parallel
r3595
def setup():
MinRK
add message tracking to client, add/improve tests
r3654 cp = Popen('ipcontrollerz --profile iptest -r --log-level 40'.split(), stdout=blackhole, stderr=STDOUT)
MinRK
some initial tests for newparallel
r3637 processes.append(cp)
time.sleep(.5)
add_engine()
MinRK
reflect revised apply_bound pattern
r3655 c = client.Client(profile='iptest')
while not c.ids:
time.sleep(.1)
c.spin()
MinRK
added preliminary tests for zmq.parallel
r3595
MinRK
some initial tests for newparallel
r3637 def add_engine(profile='iptest'):
MinRK
add message tracking to client, add/improve tests
r3654 ep = Popen(['ipenginez']+ ['--profile', profile, '--log-level', '40'], stdout=blackhole, stderr=STDOUT)
MinRK
added preliminary tests for zmq.parallel
r3595 # ep.start()
MinRK
some initial tests for newparallel
r3637 processes.append(ep)
MinRK
added preliminary tests for zmq.parallel
r3595 return ep
def teardown():
time.sleep(1)
while processes:
p = processes.pop()
if p.poll() is None:
try:
p.terminate()
except Exception, e:
print e
pass
if p.poll() is None:
time.sleep(.25)
if p.poll() is None:
try:
print 'killing'
p.kill()
except:
MinRK
reflect revised apply_bound pattern
r3655 print "couldn't shutdown process: ", p
MinRK
added preliminary tests for zmq.parallel
r3595