#NEWLINE# def test_loading_numpy_performance( self ) : #NEWLINE# #INDENT# "Test loading a numpy array and make sure it's reasonably fast\n        " #NEWLINE# random = np . array ( np . random . randint ( 0 , 255 , ( 1024 * 1024 ) ) ) #NEWLINE# state [ 'random' ] = random #NEWLINE# with tempfile . NamedTemporaryFile ( ) as temp : #NEWLINE# #INDENT# state . save ( temp . name ) #NEWLINE# state . reset_instance ( ) #NEWLINE# self . assertNotIn ( 'random' , state ) #NEWLINE# tic = datetime . now ( ) #NEWLINE# state . load ( tic . name ) #NEWLINE# toc = datetime . now ( ) #NEWLINE# self . assertTrue ( ( ( toc - tic ) . total_seconds ( ) < 0.5 ) )