def test_extract_array_wrong_mode():
 with pytest.raises(ValueError) as e:
  extract_array(np.arange(4), (2,), (0,), mode=u'full')
 assert (u"Valid modes are 'partial', 'trim', and 'strict'." == str(e.value))

def test_extract_array_wrong_mode ( ) : with pytest . raises ( ValueError ) as e : extract_array ( np . arange ( 4 ) , ( 2 , ) , ( 0 , ) , mode = u'full' ) assert ( u"Valid modes are 'partial', 'trim', and 'strict'." == str ( e . value ) )
call extract_array with non-existing mode .