How to use test_skip_setup method in avocado

Best Python code snippet using avocado_python

test.py

Source:test.py Github

copy

Full Screen

1#!/usr/bin/env python2# ***** BEGIN LICENSE BLOCK *****3# Version: MPL 1.1/GPL 2.0/LGPL 2.14# 5# The contents of this file are subject to the Mozilla Public License6# Version 1.1 (the "License"); you may not use this file except in7# compliance with the License. You may obtain a copy of the License at8# http://www.mozilla.org/MPL/9# 10# Software distributed under the License is distributed on an "AS IS"11# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the12# License for the specific language governing rights and limitations13# under the License.14# 15# The Original Code is Komodo code.16# 17# The Initial Developer of the Original Code is ActiveState Software Inc.18# Portions created by ActiveState Software Inc are Copyright (C) 2000-200719# ActiveState Software Inc. All Rights Reserved.20# 21# Contributor(s):22# ActiveState Software Inc23# 24# Alternatively, the contents of this file may be used under the terms of25# either the GNU General Public License Version 2 or later (the "GPL"), or26# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),27# in which case the provisions of the GPL or the LGPL are applicable instead28# of those above. If you wish to allow use of your version of this file only29# under the terms of either the GPL or the LGPL, and not to allow others to30# use your version of this file under the terms of the MPL, indicate your31# decision by deleting the provisions above and replace them with the notice32# and other provisions required by the GPL or the LGPL. If you do not delete33# the provisions above, a recipient may use your version of this file under34# the terms of any one of the MPL, the GPL or the LGPL.35# 36# ***** END LICENSE BLOCK *****37"""The codeintel test suite entry point."""38import os39from os.path import exists40import sys41import logging42import testlib43import citestsupport44import clean_tests45log = logging.getLogger("test")46default_tags = ["-knownfailure", "-xpcom"]47def _skip_setup():48 TEST_SKIP_SETUP = os.environ.get("TEST_SKIP_SETUP", "0")49 return TEST_SKIP_SETUP not in ('0', '')50def setup():51 if _skip_setup():52 log.debug("skipping test setup ($TEST_SKIP_SETUP is true)")53 elif exists(citestsupport.test_db_base_dir):54 log.debug("rm `%s'", citestsupport.test_db_base_dir)55 citestsupport.rmtree(citestsupport.test_db_base_dir)56if __name__ == "__main__":57 try:58 retval = testlib.harness(setup_func=setup,59 default_tags=default_tags)60 sys.exit(retval)61 finally:62 # Remove the special unicode files added by the codeintel system,63 # otherwise buildbot and/or Python utilities may break when trying to64 # remove these files....

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run avocado automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful