<s> import sys <EOL> from os . path import dirname , abspath , splitext <EOL> from os import listdir <EOL> from optparse import OptionParser <EOL> where_am_i = dirname ( abspath ( __file__ ) ) <EOL> sys . path . insert ( <NUM_LIT:0> , where_am_i ) <EOL> files = listdir ( where_am_i ) <EOL> for file in files : <EOL> name , extension = splitext ( file ) <EOL> if extension == "<STR_LIT>" : <EOL> sys . path . insert ( <NUM_LIT:0> , file ) <EOL> from django . conf import settings <EOL> if not settings . configured : <EOL> settings . configure ( <EOL> DATABASE_ENGINE = '<STR_LIT>' , <EOL> DATABASES = { <EOL> '<STR_LIT:default>' : { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> } , <EOL> } , <EOL> INSTALLED_APPS = [ <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> ] , <EOL> ROOT_URLCONF = '<STR_LIT>' , <EOL> DEBUG = False , <EOL> ) <EOL> from django_nose import NoseTestSuiteRunner <EOL> def runtests ( * test_args , ** kwargs ) : <EOL> if not test_args : <EOL> test_args = [ '<STR_LIT>' ] <EOL> kwargs . setdefault ( '<STR_LIT>' , False ) <EOL> test_runner = NoseTestSuiteRunner ( ** kwargs ) <EOL> failures = test_runner . run_tests ( test_args ) <EOL> sys . exit ( failures ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> parser = OptionParser ( ) <EOL> parser . add_option ( '<STR_LIT>' , dest = '<STR_LIT>' , action = '<STR_LIT:store>' , default = <NUM_LIT:1> , type = int ) <EOL> parser . add_options ( NoseTestSuiteRunner . options ) <EOL> ( options , args ) = parser . parse_args ( ) <EOL> runtests ( * args , ** options . __dict__ ) </s>
