3

As I understand, parameterized.expand([1, 2, 3]) will create three test cases. I would like to know how can I skip only one of them?

I know that @unitest.skip() will skip the whole 3 test cases, I only wanna to skip one of them.

Here is a simple code

from nose_parameterized import parameterized
import unittest

class Read(unittest.TestCase):
    @parameterized.expand(['1', '2', '3', '4'])
    def test000_test1(self, operation):
        print operation
        self.assertGreater(5, int(operation))
falsetru
  • 357,413
  • 63
  • 732
  • 636
IslamTaha
  • 1,056
  • 1
  • 10
  • 17

1 Answers1

2

I did this trick while some one may be find another pro method.

from nose_parameterized import parameterized
import unittest


class Read(unittest.TestCase):
    @parameterized.expand(['1', '2', '3', '4'])
    def test000_test1(self, operation):
        if operation == '2':
            self.skipTest('REASON')
    self.assertGreater(5, int(operation))
IslamTaha
  • 1,056
  • 1
  • 10
  • 17