<s> """<STR_LIT>""" <EOL> from django . conf import settings <EOL> from django . test . simple import DjangoTestSuiteRunner <EOL> from django . test . utils import setup_test_environment , teardown_test_environment <EOL> import xmlrunner <EOL> class XMLTestRunner ( DjangoTestSuiteRunner ) : <EOL> def run_tests ( self , test_labels , extra_tests = None , ** kwargs ) : <EOL> """<STR_LIT>""" <EOL> setup_test_environment ( ) <EOL> settings . DEBUG = False <EOL> verbosity = getattr ( settings , '<STR_LIT>' , <NUM_LIT:1> ) <EOL> if isinstance ( verbosity , bool ) : <EOL> verbosity = ( <NUM_LIT:1> , <NUM_LIT:2> ) [ verbosity ] <EOL> descriptions = getattr ( settings , '<STR_LIT>' , False ) <EOL> output = getattr ( settings , '<STR_LIT>' , '<STR_LIT:.>' ) <EOL> suite = self . build_suite ( test_labels , extra_tests ) <EOL> old_config = self . setup_databases ( ) <EOL> result = xmlrunner . XMLTestRunner ( <EOL> verbosity = verbosity , descriptions = descriptions , <EOL> output = output ) . run ( suite ) <EOL> self . teardown_databases ( old_config ) <EOL> teardown_test_environment ( ) <EOL> return len ( result . failures ) + len ( result . errors ) </s>
