<s> import os <EOL> import sys <EOL> from django . conf import settings <EOL> from django . core . management . base import BaseCommand <EOL> from django . test . utils import get_runner <EOL> class Command ( BaseCommand ) : <EOL> help = '<STR_LIT>' <EOL> requires_system_checks = False <EOL> def __init__ ( self ) : <EOL> self . test_runner = None <EOL> super ( Command , self ) . __init__ ( ) <EOL> def run_from_argv ( self , argv ) : <EOL> """<STR_LIT>""" <EOL> option = '<STR_LIT>' <EOL> for arg in argv [ <NUM_LIT:2> : ] : <EOL> if arg . startswith ( option ) : <EOL> self . test_runner = arg [ len ( option ) : ] <EOL> break <EOL> super ( Command , self ) . run_from_argv ( argv ) <EOL> def add_arguments ( self , parser ) : <EOL> parser . add_argument ( <EOL> '<STR_LIT:args>' , metavar = '<STR_LIT>' , nargs = '<STR_LIT:*>' , <EOL> help = '<STR_LIT>' <EOL> ) <EOL> parser . add_argument ( <EOL> '<STR_LIT>' , '<STR_LIT>' , action = '<STR_LIT>' , dest = '<STR_LIT>' , default = True , <EOL> help = '<STR_LIT>' , <EOL> ) <EOL> parser . add_argument ( <EOL> '<STR_LIT>' , action = '<STR_LIT:store_true>' , dest = '<STR_LIT>' , default = False , <EOL> help = '<STR_LIT>' , <EOL> ) <EOL> parser . add_argument ( <EOL> '<STR_LIT>' , action = '<STR_LIT:store>' , dest = '<STR_LIT>' , <EOL> help = '<STR_LIT>' <EOL> '<STR_LIT>' , <EOL> ) <EOL> parser . add_argument ( <EOL> '<STR_LIT>' , action = '<STR_LIT:store>' , dest = '<STR_LIT>' , default = None , <EOL> help = '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' , <EOL> ) <EOL> test_runner_class = get_runner ( settings , self . test_runner ) <EOL> if hasattr ( test_runner_class , '<STR_LIT>' ) : <EOL> test_runner_class . add_arguments ( parser ) <EOL> def handle ( self , * test_labels , ** options ) : <EOL> from django . conf import settings <EOL> from django . test . utils import get_runner <EOL> TestRunner = get_runner ( settings , options [ '<STR_LIT>' ] ) <EOL> if options [ '<STR_LIT>' ] is not None : <EOL> os . environ [ '<STR_LIT>' ] = options [ '<STR_LIT>' ] <EOL> del options [ '<STR_LIT>' ] <EOL> test_runner = TestRunner ( ** options ) <EOL> failures = test_runner . run_tests ( test_labels ) <EOL> if failures : <EOL> sys . exit ( bool ( failures ) ) </s>
