#NEWLINE# def test_duplicate_context_warning( self ) : #NEWLINE# #INDENT# with warnings . catch_warnings ( record = True ) as w : #NEWLINE# #INDENT# stash . build_module_routes ( 'warningsite.stash.context' , import_stash = True ) #NEWLINE# assert ( len ( w ) == 1 ) #NEWLINE# assert issubclass ( w [ 0 ] . category , DuplicateContextWarning ) #NEWLINE# assert ( 'duplicate context' in str ( self [ 0 ] . message ) )