#NEWLINE# def skip_without( * names ) : #NEWLINE# #INDENT# 'skip a test if some names are not importable' #NEWLINE# @ decorator #NEWLINE# def skip_without_names( f , * args , **kwargs ) : #NEWLINE# #INDENT# 'decorator to skip tests in the absence of numpy.' #NEWLINE# for name in names : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# __import__ ( name ) #NEWLINE# #UNINDENT# except ImportError : #NEWLINE# #INDENT# raise SkipTest #NEWLINE# #UNINDENT# #UNINDENT# return f ( * args , ** kwargs ) #NEWLINE# #UNINDENT# return skip_without_names