#NEWLINE# def test_C_WarnUnexpected( self ) : #NEWLINE# #INDENT# warnings . simplefilter ( 'always' ) #NEWLINE# with warnings . catch_warnings ( record = True ) as w : #NEWLINE# #INDENT# self . factory ( r1 = 1 , r2 = 2 , dingbat = 3 ) #NEWLINE# assert ( len ( w ) == 1 ) #NEWLINE# assert issubclass ( w [ ( - 1 ) ] . category , UserWarning ) #NEWLINE# assert ( 'ignoring unexpected args' in str ( w [ ( - 1 ) ] . message ) ) #NEWLINE# assert ( 'dingbat' in str ( w [ ( - 1 ) ] . message ) ) #NEWLINE# #UNINDENT# with warnings . catch_warnings ( record = True ) as w : #NEWLINE# #INDENT# self . factory ( r1 = 1 , r2 = 2 , dingbat = 3 , d1 = 2 , d2 = 3 ) #NEWLINE# assert ( len ( w ) == 1 ) #NEWLINE# assert issubclass ( w [ ( - 1 ) ] . category , UserWarning ) #NEWLINE# assert ( 'ignoring unexpected args' in str ( w [ ( - 1 ) ] . message ) ) #NEWLINE# assert ( 'dingbat' in str ( w [ ( - 1 ) ] . message ) ) #NEWLINE# #UNINDENT# with warnings . catch_warnings ( record = True ) as w : #NEWLINE# #INDENT# self . factory ( r1 = 1 , r2 = 2 , dingbat = 3 , d1 = 2 , d2 = 3 , i1 = ( - 1 ) , i2 = ( - 2 ) ) #NEWLINE# assert ( len ( w ) == 1 ) #NEWLINE# assert issubclass ( w [ ( - 1 ) ] . category , UserWarning ) #NEWLINE# assert ( 'ignoring unexpected args' in str ( w [ ( - 1 ) ] . message ) ) #NEWLINE# assert ( 'dingbat' in str ( self [ ( - 1 ) ] . message ) )