Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

unittest skip

class MyTestCase(unittest.TestCase):

    @unittest.skip("demonstrating skipping")
    def test_nothing(self):
        self.fail("shouldn't happen")

    @unittest.skipIf(mylib.__version__ < (1, 3),
                     "not supported in this library version")
    def test_format(self):
        # Tests that work for only a certain version of the library.
        pass

    @unittest.skipUnless(sys.platform.startswith("win"), "requires Windows")
    def test_windows_support(self):
        # windows specific testing code
        pass

    def test_maybe_skipped(self):
        if not external_resource_available():
            self.skipTest("external resource not available")
        # test code that depends on the external resource
        pass
Comment

PREVIOUS NEXT
Code Example
Python :: python round to two decimals 
Python :: check if there are duplicates in list 
Python :: python byte string 
Python :: try catch python 
Python :: python default dic 
Python :: writerows to existing csv python 
Python :: start python virtual 
Python :: python stack 
Python :: isaplha in python 
Python :: python argparse file argument 
Python :: moving averages python 
Python :: python order by date 
Python :: append dictionary to list python 
Python :: fcm_django 
Python :: read file contents python 
Python :: sqlite3 python 
Python :: python while loop 
Python :: python null 
Python :: python list of dictionaries to excel 
Python :: download python 2.7 for windows 10 
Python :: replace empty numbers in dataframe 
Python :: python tic tac toe 
Python :: python draw circle matplotlib 
Python :: cassandra python 
Python :: mongodb aggregate group 
Python :: increase axis ticks pyplot 
Python :: how to use fastapi ApiClient with pytest 
Python :: python dictionary default 
Python :: startapp django 
Python :: what is module in python 
ADD CONTENT
Topic
Content
Source link
Name
5+9 =