def test_improve_memory_error_message():
 try:
  improve_memory_error_message(MemoryError(), 'test')
 except MemoryError as e:
  assert len(str(e))
 try:
  improve_memory_error_message(MemoryError('test'), 'should not')
 except MemoryError as e:
  assert (str(e) == 'test')

def test_improve_memory_error_message ( ) : try : improve_memory_error_message ( MemoryError ( ) , 'test' ) except MemoryError as e : assert len ( str ( e ) ) try : improve_memory_error_message ( MemoryError ( 'test' ) , 'should not' ) except MemoryError as e : assert ( str ( e ) == 'test' )
tests that the memoryerrors message is improved correctly .