#NEWLINE# def test_unflushed( self ) : #NEWLINE# #INDENT# '\n        Any warnings emitted by a test which are not flushed are emitted to the\n        Python warning system.\n        ' #NEWLINE# result = TestResult ( ) #NEWLINE# case = Mask . MockTests ( 'test_unflushed' ) #NEWLINE# case . run ( result ) #NEWLINE# warningsShown = self . flushWarnings ( [ Mask . MockTests . test_unflushed ] ) #NEWLINE# self . assertEqual ( warningsShown [ 0 ] [ 'message' ] , 'some warning text' ) #NEWLINE# self . assertIdentical ( warningsShown [ 0 ] [ 'category' ] , UserWarning ) #NEWLINE# where = case . test_unflushed . im_func . func_code #NEWLINE# filename = where . co_filename #NEWLINE# lineno = ( where . co_firstlineno + 4 ) #NEWLINE# self . assertEqual ( warningsShown [ 0 ] [ 'filename' ] , warningsShown ) #NEWLINE# self . assertEqual ( warningsShown [ 0 ] [ 'lineno' ] , lineno ) #NEWLINE# self . assertEqual ( len ( warningsShown ) , 1 )