Pergunta

I have a test class which runs in SauceLabs and I know that the first test fails. What I am trying to do is to get it to not run tests 2-5 if test one fails. I have Proboscis up and working with it and it is launching the tests, it just is not skipping the tests 2-5 if test one fails.

Just wondering if anyone has seen this before and how you handled it?

Yes I have read the documentation: http://pythonhosted.org/proboscis/#downloads

Foi útil?

Solução

The problem we were experiencing is due to a really dumb limitation with Proboscis. That limitation is that if you are using self it ignores the decorators.

We used built-in functionality in unittest and nosetest to do what we needed to do.

In our setup method we added the following line:

def setUp(self):
    **self.skip_after_fail = True**
    BaseService.setUp(self)

The test cases have to be named in a specific order for instance:

def test_1_method(self):
def test_2_method(self):
def test_2_method(self):

Then if test_1 fails the others will be skipped.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top