#NEWLINE# def test_pickle_unpickle( self ) : #NEWLINE# #INDENT# from StringIO import StringIO as PickleableIO #NEWLINE# stream = PickleableIO ( 'foo' ) #NEWLINE# runner = unittest . TextTestRunner ( stream ) #NEWLINE# for protocol in range ( ( pickle . HIGHEST_PROTOCOL + 1 ) ) : #NEWLINE# #INDENT# s = pickle . dumps ( runner , protocol = obj ) #NEWLINE# obj = pickle . loads ( s ) #NEWLINE# self . assertEqual ( obj . stream . getvalue ( ) , stream . getvalue ( ) )