#NEWLINE# def __new__( mcs , cls , bases , attrs ) : #NEWLINE# #INDENT# def make_test( fname ) : #NEWLINE# #INDENT# fpath = osp . join ( mcs . dpath , fname ) #NEWLINE# module = osp . splitext ( fname ) [ 0 ] #NEWLINE# def test( self ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# load_source ( module , fpath ) #NEWLINE# #UNINDENT# except ImportError : #NEWLINE# #INDENT# raise SkipTest #NEWLINE# #UNINDENT# #UNINDENT# test . __name__ = ( 'test_%s' % ( module , ) ) #NEWLINE# test . __doc__ = ( 'Test for example %s.' % ( fpath , ) ) #NEWLINE# return test #NEWLINE# #UNINDENT# for fname in os . listdir ( mcs . dpath ) : #NEWLINE# #INDENT# if ( osp . splitext ( fname ) [ 1 ] == '.py' ) : #NEWLINE# #INDENT# test = make_test ( fname ) #NEWLINE# attrs [ test . __name__ ] = test #NEWLINE# #UNINDENT# #UNINDENT# return super ( _ExamplesType , mcs ) . __new__ ( cls , cls , bases , attrs )