#NEWLINE# def test_cleanup( self ) : #NEWLINE# #INDENT# cleanup_args = [ None ] #NEWLINE# def cleanup( x ) : #NEWLINE# #INDENT# self . assertIsNone ( cleanup_args [ 0 ] ) #NEWLINE# cleanup_args [ 0 ] = x #NEWLINE# return 'TESTed' #NEWLINE# #UNINDENT# class Page ( BasePage ) : #NEWLINE# #INDENT# foo = livescrape . Css ( 'h1.foo' , cleanup = cleanup ) #NEWLINE# #UNINDENT# x = Page ( ) #NEWLINE# self . assertEqual ( x . foo , 'TESTed' ) #NEWLINE# self . assertEqual ( cleanup_args [ 0 ] , 'Heading' )