j7i;dZddlmZddlmZddlZddlmZddlm Z ddlm Z ddl m Z dd l mZdd lmZddlZeeeZdd Zej*d ddZddZddZddZy)zASubmit failure or test session information to a pastebin service.) annotations)StringION)IO)Config)create_terminal_writer)Parser)StashKey)TerminalReporterc Z|jd}|jdddddddgd y) Nzterminal reportingz --pastebinmodestorepastebinfailedallz3Send failed|all info to bpaste.net pastebin service)metavaractiondestdefaultchoiceshelp)getgroup addoption)parsergroups Y/mnt/ssd/data/python-lab/ChefSystem/venv/lib/python3.12/site-packages/_pytest/pastebin.pypytest_addoptionrs< OO0 1E OO 5! BT)trylastcjjdk(rrjjd}|Tt j dj t<|jjfd}||j_ yyy)Nrterminalreporterzw+bc|fi|t|tr|jd}jtj |y)Nutf-8) isinstancestrencodestashpastebinfile_keywrite)skwargsconfigoldwrites r tee_writez#pytest_configure..tee_write.s@%f%a%)A -.44Q7r) optionr pluginmanager getplugintempfile TemporaryFiler&r'_twr()r+trr-r,s` @rpytest_configurer5"sv }}&  ! ! + +,> ? >-5-C-CE-JFLL) *vv||H 8 %BFFL  'rct|jvr|jt}|jd|j}|j |jt=|j j d}|jjd=|jddt|}|jd|dyy)Nrr r(=$Sending information to Paste Servicezpastebin session-log:  ) r'r&seekreadcloser/r0r3__dict__ write_sepcreate_new_paste write_line)r+ pastebinfile sessionlogr4 pastebinurls rpytest_unconfigurerD7s6<<'||$45 !!&&(  LL) *  ! ! + +,> ? FFOOG $ S@A&z2  .{m2>?(rcddl}ddlm}ddlm}ddlm}|ddd}d } ||||jd  jjd }|jd} | r|d| jdSd|zdzS#|$r,}|5d |cdddcYd}~S#1swYnxYwYd}~^d}~wt$r}d |cYd}~Sd}~wwxYw)zCreate a new paste using the bpaste.net service. :contents: Paste contents string. :returns: URL to the pasted contents, or an error message. rN) HTTPError) urlencode)urlopentext1week)codelexerexpiryzhttps://bpa.stascii)datar"zbad response: zhref="/raw/(\w+)"z/show/zbad response: invalid format ('z')) re urllib.errorrF urllib.parserGurllib.requestrHr%r;decodeOSErrorsearchr) contentsrQrFrGrHparamsurlresponseems rr?r?Hs &&&7 CF C$ Ci/66w? @ E E G N Nw W  &1AfQWWQZL))08;dBB (  (#A3' ( ( ( ( $s##$sG )r+r.rstatsr>longrepr reprtraceback reprentries reprfilelocAttributeError_getfailureheadlinerr toterminalgetvaluelenr?r@)r repmsgfiletwr)rCs rpytest_terminal_summaryrnes %%..(:#)))""3(NO#))(3 DC @ll00<r}srG"!1,"- '8BuI&( %%(@"C:Dr