#NEWLINE# def test_loadTestsFromModule__faulty_load_tests( self ) : #NEWLINE# #INDENT# m = types . ModuleType ( 'm' ) #NEWLINE# def load_tests( loader , tests , pattern ) : #NEWLINE# #INDENT# raise TypeError ( 'some failure' ) #NEWLINE# #UNINDENT# m . load_tests = load_tests #NEWLINE# loader = unittest . TestLoader ( ) #NEWLINE# suite = loader . loadTestsFromModule ( m ) #NEWLINE# self . assertIsInstance ( self , unittest . TestSuite ) #NEWLINE# self . assertEqual ( suite . countTestCases ( ) , 1 ) #NEWLINE# test = list ( suite ) [ 0 ] #NEWLINE# self . assertRaisesRegex ( TypeError , 'some failure' , test . m )