bgjddlmZddlmZddlmZddlZddlmZddlmZddl m Z ddl m Z dd l mZerdd lmZd Zd e d dfdZejded dfdZde d dfdZGddZdS))List)Optional) TYPE_CHECKINGN)nodes)Config)Parser)Session) TestReport)Cachezcache/stepwiseparserreturnc|d}|dddddd|d d ddd d dS) Ngeneralz--swz --stepwise store_trueFstepwisezBExit on test failure and continue from last failing test next time)actiondefaultdesthelpz --sw-skipz--stepwise-skip stepwise_skipz_Ignore the first failing test but stop on the next failing test. Implicitly enables --stepwise.)getgroup addoption)r groups a/builddir/build/BUILD/cloudlinux-venv-1.0.7/venv/lib/python3.11/site-packages/_pytest/stepwise.pypytest_addoptionrs{ OOI & &E OO  Q  OO ) configc|jjr d|j_|dr*|jt |ddSdS)NTrstepwiseplugin)optionrr getoption pluginmanagerregisterStepwisePlugin)rs rpytest_configurer%'sd }"&!%   ##P%%nV&<&<>NOOOOOPPrsessionc|jdsL|jjJt|jdrdS|jjt gdSdS)Nr workerinput)rr!cachehasattrsetSTEPWISE_CACHE_DIRr&s rpytest_sessionfinishr.0sr > # #J / /9~#/// 7>= 1 1  F  !3R8888899rceZdZdeddfdZdeddfdZdedeej ddfdZ d e ddfd Z de efd Zd d ZdS)r$rr Nc||_d|_d|_|jJ|j|_|jt d|_|d|_dS)Nr) rr& report_statusr)getr, lastfailedr!skip)selfrs r__init__zStepwisePlugin.__init__<s` *. |'''"L )-8JD)Q)Q **?;; rr&c||_dS)Nr-)r6r&s rpytest_sessionstartz"StepwisePlugin.pytest_sessionstartEs  ritemsc|js d|_dSd}t|D]\}}|j|jkr|}n| d|_dSd|d|_|d|}|d|=|j|dS)Nz)no previously failed tests, not skipping.z/previously failed test not found, not skipping.z skipping z already passed items.)r:)r4r2 enumeratenodeidhookpytest_deselected)r6rr: failed_indexindexitem deselecteds rpytest_collection_modifyitemsz,StepwisePlugin.pytest_collection_modifyitemsHs !LD  F $U++  KE4{do--$ .  !RD   !Q\!Q!Q!QD } }-Jm|m$ K ) ) ) ; ; ; ; ;rreportc|jrJ|jr |j|jkrd|_d|_dS|j|_|jJd|j_dS|jdkr|j|jkr d|_dSdSdS)NFz0Test failed, continuing from this test next run.call)failedr5r=r4r& shouldstopwhen)r6rEs rpytest_runtest_logreportz'StepwisePlugin.pytest_runtest_logreport`s = +y =DO33&*DO! #)-|///F ''' {f$$=DO33&*DOOO%$33rcd|jddkr|jr d|jSdS)Nverboserz stepwise: )rr!r2r6s rpytest_report_collectionfinishz-StepwisePlugin.pytest_report_collectionfinishxs; ;  + +q 0 0T5G 04 244 4trc~t|jdrdS|jt|jdS)Nr()r*rr)r+r,r4rNs rr.z#StepwisePlugin.pytest_sessionfinish}s< 4; . .  F )4?;;;;;r)r N)__name__ __module__ __qualname__rr7r r9rrItemrDr rKrstrrOr.rrr$r$;sr`st !!!!!!,,,,,, &&&&&&,++++++%V*PVPPPPP9'9d9999G<G<G<G<G<G<G<G<G<G