<s> """<STR_LIT>""" <EOL> import os <EOL> import sys <EOL> import unittest <EOL> if not hasattr ( unittest . defaultTestLoader , '<STR_LIT>' ) : <EOL> try : <EOL> import unittest2 as unittest <EOL> except ImportError : <EOL> raise ImportError ( '<STR_LIT>' ) <EOL> def additional_tests ( ) : <EOL> setup_file = sys . modules [ '<STR_LIT:__main__>' ] . __file__ <EOL> setup_dir = os . path . abspath ( os . path . dirname ( setup_file ) ) <EOL> test_dir = os . path . join ( setup_dir , '<STR_LIT>' ) <EOL> test_suite = unittest . defaultTestLoader . discover ( test_dir ) <EOL> blacklist = [ ] <EOL> if '<STR_LIT>' in __file__ : <EOL> blacklist . append ( '<STR_LIT>' ) <EOL> return exclude_tests ( test_suite , blacklist ) <EOL> class SkipCase ( unittest . TestCase ) : <EOL> def skeleton_run_test ( self ) : <EOL> raise unittest . SkipTest ( "<STR_LIT>" ) <EOL> def exclude_tests ( suite , blacklist ) : <EOL> """<STR_LIT>""" <EOL> new_suite = unittest . TestSuite ( ) <EOL> for test_group in suite . _tests : <EOL> for test in test_group : <EOL> if not hasattr ( test , '<STR_LIT>' ) : <EOL> new_suite . addTest ( test ) <EOL> continue <EOL> for subtest in test . _tests : <EOL> method = subtest . _testMethodName <EOL> if method in blacklist : <EOL> setattr ( test , <EOL> method , <EOL> getattr ( SkipCase ( ) , '<STR_LIT>' ) ) <EOL> new_suite . addTest ( test ) <EOL> return new_suite </s>
