Skip to content

Commit

Permalink
CBQE-807: remove unittest.skipIf feature from pytests
Browse files Browse the repository at this point in the history
Change-Id: I90280d5db65282515dd3ab3127400db53a9a7ac5
Reviewed-on: http://review.couchbase.org/22591
Reviewed-by: Volker Mische <volker.mische@gmail.com>
Tested-by: buildbot <build@couchbase.com>
Reviewed-by: Iryna Mironava <irynamironava@yandex.ru>
  • Loading branch information
andreibaranouski committed Nov 19, 2012
1 parent 0694741 commit 457deff
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 14 deletions.
5 changes: 2 additions & 3 deletions pytests/uibasetest.py
Expand Up @@ -22,7 +22,6 @@




class BaseUITestCase(unittest.TestCase): class BaseUITestCase(unittest.TestCase):
skip_setup_failed = False
# selenium thread # selenium thread


def _start_selenium(self): def _start_selenium(self):
Expand Down Expand Up @@ -70,7 +69,6 @@ def _is_selenium_running(self):
return True return True
return False return False


@unittest.skipIf(skip_setup_failed, "setup was failed")
def setUp(self): def setUp(self):
try: try:
self.log = logger.Logger.get_logger() self.log = logger.Logger.get_logger()
Expand Down Expand Up @@ -109,7 +107,8 @@ def setUp(self):
self.servers[0].port)) self.servers[0].port))
self.driver.maximize_window() self.driver.maximize_window()
except Exception as ex: except Exception as ex:
skip_setup_failed = True self.input.test_params["stop-on-failure"] = True
self.log.error("SETUP WAS FAILED. ALL TESTS WILL BE SKIPPED")
self.fail(ex) self.fail(ex)


@staticmethod @staticmethod
Expand Down
5 changes: 2 additions & 3 deletions pytests/viewmergetests.py
Expand Up @@ -20,9 +20,7 @@




class ViewMergingTests(BaseTestCase): class ViewMergingTests(BaseTestCase):
skip_setup_failed = False


@unittest.skipIf(skip_setup_failed, "setup was failed")
def setUp(self): def setUp(self):
try: try:
if 'first_case' not in TestInputSingleton.input.test_params: if 'first_case' not in TestInputSingleton.input.test_params:
Expand All @@ -45,7 +43,8 @@ def setUp(self):
if 'first_case' in TestInputSingleton.input.test_params: if 'first_case' in TestInputSingleton.input.test_params:
self.create_ddocs() self.create_ddocs()
except Exception as ex: except Exception as ex:
skip_setup_failed = True self.input.test_params["stop-on-failure"] = True
self.log.error("SETUP WAS FAILED. ALL TESTS WILL BE SKIPPED")
self.fail(ex) self.fail(ex)


def tearDown(self): def tearDown(self):
Expand Down
10 changes: 2 additions & 8 deletions pytests/viewquerytests.py
Expand Up @@ -41,9 +41,6 @@ def stopped(self):
return self._stop.isSet() return self._stop.isSet()


class ViewQueryTests(unittest.TestCase): class ViewQueryTests(unittest.TestCase):
skip_setup_failed = False

@unittest.skipIf(skip_setup_failed, "setup was failed")
def setUp(self): def setUp(self):
try: try:
ViewBaseTests.common_setUp(self) ViewBaseTests.common_setUp(self)
Expand All @@ -64,11 +61,8 @@ def setUp(self):
else: else:
ViewBaseTests._create_multiple_buckets(self, replica=self.replica) ViewBaseTests._create_multiple_buckets(self, replica=self.replica)
except Exception as ex: except Exception as ex:
skip_setup_failed = True self.input.test_params["stop-on-failure"] = True
try: self.log.error("SETUP WAS FAILED. ALL TESTS WILL BE SKIPPED")
self.tearDown()
except:
pass
self.fail(ex) self.fail(ex)


def tearDown(self): def tearDown(self):
Expand Down

0 comments on commit 457deff

Please sign in to comment.