o 6a @s*ddlZddlmZmZGdddZdS)N) assert_raisesassert_raises_regexc@sPeZdZdZddZddZddZdd Zd d Zd d Z ddZ ddZ dS)TestIndexErrorsz9Tests to exercise indexerrors not covered by other tests.cCsbtd}tt|jdgddtt|jdgddtt|jdgdddtt|jdgdddd S) ztake from a 0-length dimension)rrraxiswrap)r modeclipN)npemptyr IndexErrortake)selfxrC/usr/lib/python3/dist-packages/numpy/core/tests/test_indexerrors.pytest_arraytypes_fasttake s z(TestIndexErrors.test_arraytypes_fasttakecCstjdtd}tt|jdgtjdtd}tt|jdgddtt|jdgddtt|jdgtt|jdgdd tt|jdgd d dS) Ndtyperrr rrr )r r )rzerosobjectrrr)rdrrrtest_take_from_objectsz%TestIndexErrors.test_take_from_objectcCsxtjdtd}tt|jdtjdtd}tt|jdtjdtd}tt|jddtjdtd}tt|jdddS)Nrrr)rrr)rrrrritemitemsetrarrrtest_multiindex_exceptionssz*TestIndexErrors.test_multiindex_exceptionscCsttd}tt|jddtjdtd}tt|jddtd}tt|jddtjdtd}tt|jdddS)N)rrdrr)rrr)rrrrputrr#rrrtest_put_exceptions*s  z#TestIndexErrors.test_put_exceptionscsddtgdttfddttfddttfddttfddtgd ttfd dttfd dtgdttfd dttfd dtgd ttfddttfddtgdttfddttfddtgd ttfddttfddtgdttfddttfddtgd ttfddttfdddS)zcases in iterators.ccS |||<dSNrobjindvalrrrassign6 z9TestIndexErrors.test_iterators_exceptions..assign)r rrcdS)NrrNrrrr$rr:z;TestIndexErrors.test_iterators_exceptions..cr1)Nrrrrrrr3rrr4;r5c ddS)Nr2r rrr$r/rrr4< cr7)Nr6r rrr8rrr4=r9)r rrcr1)NrrNrrrr3rrr4@r5cr7)Nr:r rrr8rrr4Ar9c jdSN flatrr3rrr4D cjddSNr=rr>rr8rrr4Ecr;r<r>rr3rrr4Gr@crArBr>rr8rrr4HrCcjtdSr<r?rarrayrr3rrr4KcjtddSrBrErr8rrr4LcrDr<rErr3rrr4NrGcrHrBrErr8rrr4OrIcjtdgSr<rErr3rrr4RcjtdgdSrBrErr8rrr4ScrJr<rErr3rrr4UrKcrLrBrErr8rrr4VrMNrrrrrrr8rtest_iterators_exceptions4s6z)TestIndexErrors.test_iterators_exceptionscs$ddtdttfddtdttfddttfddtd ttfd dttfd dtd ttfd dtdttfddtdttfddttfddtd ttfddttfdddS)zcases from mapping.ccSr)r*rr+rrrr/[r0z,TestIndexErrors.test_mapping..assign)rr=cr1)N rrr3rrr4_r5z.TestIndexErrors.test_mapping..rrcr1)Nr=r rrr3rrr4br5cr7)NrSr rrr8rrr4cr9)rrcr1)Nr rrrr3rrr4er5cr7)NrTr rrr8rrr4fr9)r=cr7Nr=r rrr8rrr4ir9)rcr7rUrrr8rrr4kr9csdddgfSNr r rrr3rrr4nrGcsdddgfdSrVrrr8rrr4orIcsdddgfSNr rrrr3rrr4qrGcsdddgfdSrWrrr8rrr4rrINrNrOrr8r test_mappingXs&       zTestIndexErrors.test_mappingcs(tddttdfdddS)NrR)r rrrrzFtoo many indices for array: array is 2-dimensional, but 5 were indexedcsSr*rrr$indexrrr4{r5z.)rrrrrOrrYrtest_mapping_error_messagets  z*TestIndexErrors.test_mapping_error_messagecs`tdttfddttfddtdttfddttfdddS) zcases from methods.c)rrc dSNr&r!rr3rrr4r@z.TestIndexErrors.test_methods..c ddSNr&r r"rr3rrr4r9)rrcr\r]r^rr3rrr4r@cr_r`rarr3rrr4r9NrNrOrr3r test_methods}s  zTestIndexErrors.test_methodsN) __name__ __module__ __qualname____doc__rrr%r(rPrXr[rbrrrrrs   $ r)numpyr numpy.testingrrrrrrrs