def test_runtestmulti(self):
class MyConfig:
class MyOption:
numproc = 7
option = MyOption()
l = []
def MyGreenPool(**kw):
l.append(kw)
# Building a Detox object will already call GreenPool(),
# so we have to let MyGreenPool being called twice before raise
if len(l) == 2:
raise ValueError
from detox import proc
setattr(proc, 'GreenPool', MyGreenPool)
with pytest.raises(ValueError):
d = proc.Detox(MyConfig())
d.runtestsmulti(['env1', 'env2', 'env3']) # Fake env list
assert l[0] == {} # When building Detox object
assert l[1] == {'size': 7} # When calling runtestsmulti
评论列表
文章目录