如何使用noestests实现多处理的全局setUp()

2024-09-30 01:37:41 发布

您现在位置:Python中文网/ 问答频道 /正文

到目前为止,我用了一个很好的测试程序。在

为了确保我的设置只执行一次,我使用了一个布尔变量

def setUp(self):
  if not self.setupOk:
    selTest.setupOk = True
    # start selenium
    # do other stuff which will be needed for all other tests to be able to run

现在我想用选项--processes=5运行nosetests

如何确保setUp(self)只由一个进程执行(而其他进程正在等待)。在

我试着和

^{pr2}$

但这似乎行不通。在


Tags: toselftrueif进程defseleniumsetup

热门问题