#NEWLINE# def sql_fixture( dshape , schema = None ) : #NEWLINE# #INDENT# @ pytest . yield_fixture ( params = ( True , False ) ) #NEWLINE# def fixture( request , url ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# t = resource ( url , dshape = dshape , schema = ( next ( names ) if ( schema is new_schema ) else schema ) ) #NEWLINE# #UNINDENT# except sa . exc . OperationalError as e : #NEWLINE# #INDENT# pytest . skip ( str ( e ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# bind = t . bind #NEWLINE# if ( not request . param ) : #NEWLINE# #INDENT# t . metadata . bind = None #NEWLINE# #UNINDENT# ( yield ( t , bind ) ) #NEWLINE# #UNINDENT# finally : #NEWLINE# #INDENT# t . metadata . bind = bind #NEWLINE# drop ( t ) #NEWLINE# if t . schema : #NEWLINE# #INDENT# bind . execute ( sa . sql . ddl . DropSchema ( t . schema ) ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# return fixture