#NEWLINE# def test_warn( self ) : #NEWLINE# #INDENT# def f( ) : #NEWLINE# #INDENT# warnings . warn ( 'yo' ) #NEWLINE# return 3 #NEWLINE# #UNINDENT# warnings . simplefilter ( 'ignore' , UserWarning ) #NEWLINE# assert_equal ( assert_warns ( UserWarning , f ) , 3 ) #NEWLINE# assert_equal ( sys . modules [ 'warnings' ] . filters , [ ] ) #NEWLINE# assert_raises ( AssertionError , assert_no_warnings , f ) #NEWLINE# assert_equal ( assert_no_warnings ( ( lambda x : x ) , 1 ) , 1 )