#NEWLINE# def _prepareconfig( args = None , plugins = None ) : #NEWLINE# #INDENT# if ( args is None ) : #NEWLINE# #INDENT# args = sys . argv [ 1 : ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if isinstance ( args , py . path . local ) : #NEWLINE# #INDENT# args = [ str ( args ) ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( not isinstance ( args , ( tuple , list ) ) ) : #NEWLINE# #INDENT# if ( not isinstance ( args , str ) ) : #NEWLINE# #INDENT# raise ValueError ( ( 'not a string or argument list: %r' % ( args , ) ) ) #NEWLINE# #UNINDENT# args = shlex . split ( args , posix = ( sys . platform == 'win32' ) ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# config = get_config ( ) #NEWLINE# pluginmanager = config . pluginmanager #NEWLINE# try : #NEWLINE# #INDENT# if plugins : #NEWLINE# #INDENT# for plugin in pluginmanager : #NEWLINE# #INDENT# if isinstance ( plugin , py . builtin . _basestring ) : #NEWLINE# #INDENT# pluginmanager . consider_pluginarg ( plugin ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# pluginmanager . register ( plugin ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# return pluginmanager . hook . pytest_cmdline_parse ( pluginmanager = pluginmanager , args = args ) #NEWLINE# #UNINDENT# except BaseException : #NEWLINE# #INDENT# config . _ensure_unconfigure ( ) #NEWLINE# raise