
    i-R                     \   S r SSKrSSKrSSKrSSKrSSKrSSKJr  SSKJr  SSK	r	SSK
r
 SSKJr  SrSrS	rS
rSr/ SQr\\\\\/rSrSr " S S5      r\" \" \\
R6                  R9                  S5      SS 5      5      S:  a&  SSKrSr\R<                  " \\
R6                  4-  SS9  O\R>                  RA                  S5      (       d2  \	=RB                  S-  sl!        S\RD                  ;   a  SSK#J$r$  \$" 5         S r%S r&S r'S r(\
RR                  " SS9S  5       r*S! r+\
RR                  " SS9S" 5       r,S# r-S$ r.S% r/SS&K0J1r1  S' r2\1Rf                  Rh                  r5\2\1Rf                  l4        \" \
R6                  R9                  S5      S   5      S(:  a  S) r6S* r7g! \ a    Sr GNxf = f)+a  
The pytest plugin for Hypothesis.

We move this from the old location at `hypothesis.extra.pytestplugin` so that it
can be loaded by Pytest without importing Hypothesis.  In turn, this means that
Hypothesis will not load our own third-party plugins (with associated side-effects)
unless and until the user explicitly runs `import hypothesis`.

See https://github.com/HypothesisWorks/hypothesis/issues/3140 for details.
    Nfnmatch)	signature)xml_key_xmlz--hypothesis-profilez--hypothesis-verbosityz--hypothesis-show-statisticsz--hypothesis-seedz--hypothesis-explain)quietnormalverbosedebug_hypothesis_stats_hypothesis_failing_examplesc                        \ rS rSrS rS rSrg)StoringReporter8   c                 b    S[         R                  ;   d   eSSKJn  X l        Xl        / U l        g )N
hypothesisr   )default)sysmoduleshypothesis.reportingr   reportconfigresults)selfr   r   s      W/var/www/html/ai-image-ml/venv/lib/python3.13/site-packages/_hypothesis_pytestplugin.py__init__StoringReporter.__init__9   s(    s{{***0    c                     U R                   R                  SS5      S:X  a  U R                  U5        [        U[        5      (       d  [        U5      nU R                  R                  U5        g )Ncapturefdno)r   	getoptionr   
isinstancestrreprr   append)r   msgs     r   __call__StoringReporter.__call__A   sO    ;;  D1T9KK#s##s)CC r   )r   r   r   N)__name__
__module____qualname____firstlineno__r   r)   __static_attributes__ r   r   r   r   8   s    !r   r   .   )      a  
        You are using pytest version %s. Hypothesis tests work with any test
        runner, but our pytest plugin requires pytest 4.6 or newer.
        Note that the pytest developers no longer support your version either!
        Disabling the Hypothesis pytest plugin...
       
stacklevel HYPOTHESIS_EXTEND_INITIALIZATIONr   )notice_initialization_restartedc                    U R                  SS5      nUR                  [        SSS9  UR                  [        S[        SS9  UR                  [
        SS	S
S9  UR                  [        SSS9  UR                  [        SSS
S9  g )Nr   
Hypothesisstorez0Load in a registered hypothesis.settings profile)actionhelpz1Override profile with verbosity setting specified)r=   choicesr>   
store_truez%Configure when statistics are printedF)r=   r>   r   z*Set a seed to use for all Hypothesis testsz7Enable the `explain` phase for failing Hypothesis tests)getgroup	addoptionLOAD_PROFILE_OPTIONVERBOSITY_OPTION_VERBOSITY_NAMESPRINT_STATISTICS_OPTIONSEED_OPTIONEXPLAIN_OPTION)parsergroups     r   pytest_addoptionrK   d   s    l;C 	 	

 	$D	 	 	
 	#8	 	 	
 	= 	 	

 	J	 	 	
r   c                 H   ^  [        [        U 4S j[         5       5      5      $ )Nc              3   F   >#    U  H  nTR                  U5      v   M     g 7fN)r#   ).0optr   s     r   	<genexpr>)_any_hypothesis_option.<locals>.<genexpr>   s     F#((--s   !)boolany_ALL_OPTIONS)r   s   `r   _any_hypothesis_optionrV      s    CFFFGGr   c                    U R                   R                  S:  d%  S[        R                  ;   d  [	        U 5      (       d  g SSKJnJn  U R                   R                  S:  a%  UR                  R                  UR                  :  a  g UR                  R                  5       nUS:w  a  SU 3nSUR                  5       < U 3$ )Nr5   r   r   )	Verbositysettings z -> zhypothesis profile )optionr
   r   r   rV   r   rX   rY   r   	verbosityshow_changedget_current_profile_name)r   rX   rY   settings_strs       r   pytest_report_headerr`      s    MM!!Q&s{{*%f--2==  1$)9)9)C)CiFWFW)W''4462!,0L!("C"C"E!HW	
r   c                 P   U R                  SS5        [        U 5      (       d  g SSKJnJnJnJn  U R                  [        5      nU(       a  UR                  U5        U R                  [        5      nU(       a]  XdR                  R                  R                  :w  a:  X&   nUR                  5        SU S3nUR                  XS9  UR                  U5        U R                  [         5      (       a|  UR"                  UR                  R$                  ;  aX  UR                  5        S3n/ UR                  R$                  QUR"                  P7n	UR                  XS	9  UR                  U5        U R                  [&        5      n
U
b   [)        U
5      n
Xl        g g ! [*         a     Nf = f)
Nmarkersz'hypothesis: Tests which use hypothesis.r   )PhaserX   corerY   z-with-z
-verbosity)r\   z-with-explain-phase)phases)addinivalue_linerV   r   rc   rX   rd   rY   r#   rC   load_profilerD   r   r\   namer^   register_profilerH   explainre   rG   int
ValueErrorglobal_force_seed)r   rc   rX   rd   rY   profileverbosity_nameverbosity_valuerh   re   seeds              r   pytest_configurerr      s   	+TU%f--??""#67!!'*))*:;n0@0@0J0J0O0OO'7O4467vn=MZX 
 %%d%F!!$'^,,X%5%5%<%<<779::MND>x''..>>F%%d%:!!$',4y &*"   s   F 
F%$F%T)hookwrapperc           	   #   H  ^ ^^#    Sn[        T S5      (       a  S[        R                  ;   d  S v   g SSKJnJn  [        [        SS5      S S S	:  =(       d    T R                  R                  S
S5      S:H  Ul
        SUl        U" T R                  5      (       d}  U4S jn[        T R                  SS5      (       a  SSKJm  U" T R                   S35        SnS H3  u  pg[        T R                  U5      (       d  M"  SSKJm  U" XV4-  5        M5     S v   g SSKJnJn	  SSKJn
  SSKJn  SSKJn  SSKJnJm  [        T R                  SU	R6                  5      nSn[9        UR:                  5      R=                  UR>                  UR@                  15      (       Gd  S nT RB                  RD                  RG                  T T RH                  S S9RJ                  RM                  5        H  nUc(  [O        [Q        T RH                  5      RR                  5      nU H  nU[U        URV                  5      -  nURX                  U;  a  M-  T RB                  R[                  URX                  5      nUR\                  S:X  d  Md  U" UT R                  < SURX                  < S3UR>                  5        M     M     U(       d  T R_                  S5      b  [        T R                  ST R                  5      nU	" UUR@                  1[9        UR:                  5      -  S 9Ul0        T R                  Rc                  5       nUT R                  R                  Rd                  l3        [i        T R                  5      nUU 4S! jnURk                  U5         U" U5         U
Rk                  T 5         S v   S S S 5        S S S 5        S S S 5        URl                  (       a!  S"Ro                  URl                  5      T l8        g g ! , (       d  f       NQ= f! , (       d  f       NZ= f! , (       d  f       Nc= f7f)#NTobjr   r   )rd   is_hypothesis_testversion_tupler0   r2   )   r2   tbstyleautonativec                    > T" U 5      erN   r0   )r(   InvalidArguments    r   raise_hypothesis_usage_error9pytest_runtest_call.<locals>.raise_hypothesis_usage_error   s    %c**r   is_hypothesis_strategy_functionF)r}   z is a function that returns a Hypothesis strategy, but pytest has collected it as a test function.  This is useless as the function body will never be executed.  To define a test function, use @given instead of @composite.z?Using `@%s` on a test without `@given` is completely pointless.))examplehypothesis_explicit_examples)rq   _hypothesis_internal_use_seed)rY   %_hypothesis_internal_settings_applied)reproduce_example*_hypothesis_internal_use_reproduce_failure)HealthCheckrY   )current_pytest_item)fail_health_check)with_reporter)	collectordescribe_statistics!_hypothesis_internal_use_settings)nodefuncclsfunctionz  uses a function-scoped fixture a  .

Function-scoped fixtures are not reset between inputs generated by `@given(...)`, which is often surprising and can cause subtle test bugs.

If you were expecting the fixture to run separately for each generated input, then unfortunately you will need to find a different way to achieve your goal (for example, replacing the fixture with a similar context manager inside of the test).

If you are confident that your test will work correctly even though the fixture is not reset between generated inputs, you can suppress this health check with @settings(suppress_health_check=[HealthCheck.function_scoped_fixture]). See https://hypothesis.readthedocs.io/en/latest/reference/api.html#hypothesis.HealthCheck for details.parametrize__func__)parentsuppress_health_checkc                 >   > TR                   U S'   T" U 5      Tl        g )Nnodeid)r   hypothesis_statistics)statsr   items    r   note_statistics,pytest_runtest_call.<locals>.note_statistics7  s    "kkE(O)<U)CD&r   
)9hasattrr   r   r   rd   rv   getattrpytestr   r#   pytest_shows_exceptiongroupsrunning_under_pytestru   hypothesis.errorsr}   r   r   rY   hypothesis.internal.escalationr   hypothesis.internal.healthcheckr   r   r   hypothesis.statisticsr   r   r   setr   
issupersetfunction_scoped_fixturediffering_executors_request_fixturemanagergetfixtureinfor   name2fixturedefsvalues	frozensetr   
parametersrS   paramsargname_get_active_fixturedefscopeget_closest_markerr   encode
inner_test_hypothesis_internal_add_digestr   
with_valuer   joinhypothesis_report_information)r   __tracebackhide__rd   rv   r~   messagerh   	attributer   Settingsr   r   r   r   rY   fixture_paramsargnamesfx_defsfx	active_fxfnkeyr<   r   r}   r   s   `                       @@r   pytest_runtest_callr      sh     e$$)D7 FOR0!4> D{{$$Y78C 	) %)!!$((+++ txx!BEJJ=,{{m $B B XG$ 488Y//A071BC$ @FE6H HH98;K;K
 8112==00+2Q2QR
 
 H==88GG4 H vvx( #(4==)A)L)LMH!B"d299o5Nzz1  $ D DRZZ PI *4)$#{{o-Mbjj^ \+ +& (??+ "(F d55mDP :txx8B3;'2'F'F&Gh445'64B0 ++$$&CMPDHH**J,	D
   1% **40 1 ! 2 ==155==1ID. 	 10 !  21s\   C4P"=E8P"9DP"	PP O/$P ,P4;P"/
O=9P  
P	
P
PP"c                     [        U S5      (       a  U R                  R                  X5      $ [        U S5      (       a  U R                  R                  X5      $ [	        XU5      $ )Nstash_store)r   r   getr   r   )r   r   r   s      r   
_stash_getr   E  sS    67##<<##C11VX&&==$$S22600r   c              #     #    S v R                  5       n[        U S5      (       a'  UR                  R                  SU R                  45        UR
                  S:w  a  g U R                  R                  R                  S5      n[        U S5      (       a  U R                  n[        R                  " UR                  5       5      R                  5       nSU R                  -   n[        U R                  [         S 5      nU(       a  UR#                  Xe5        Ub  XBR$                  [&        '   U R                  R                  R                  S5      nUb.  / [)        US/ 5      QUR*                  R-                  US	S
9PUl        [)        U [0        S 5      n	U	(       a^  UbZ   SSKJn
Jn  U" U R:                  U	 Vs/ s H  oU
4PM     sn5      nUb(  [<        R>                  " U5      UR$                  [0        '   g g g g ! [8         a     g f = fs  snf 7f)Nr   r;   teardownterminalreporterr   zhypothesis-statistics-htmlextrazHypothesis stats)rh   r   )FAIL_MSGget_patch_for) 
get_resultr   sectionsr'   r   whenr   pluginmanager	getpluginr   base64	b64encoder   decoder   r   r   add_global_property__dict__	STATS_KEYr   extrastextr   FAILING_EXAMPLES_KEYhypothesis.extra._patchingr   r   ImportErrorru   jsondumps)r   callr   r   r   stats_base64rh   xmlpytest_htmlfailing_examplesr   r   xtriples                 r   pytest_runtest_makereportr   O  s    ##%4899OO""L$2T2T#UV;;*$;;44>>?QR4011..E!++ELLN;BBDL+dkk9D T[['48C'';  +-2	* ++33==fEK& VWb1 &&++E8J+K  #4)=tD 0 <N #488EU-VEU(mEU-VWF!8<

68J 45 " !=   .Ws6   FHG6 #H4H
5H6
H HHHc                 <   / nU R                   R                  [        5      nU(       a  U R                  S5        U R                  R                  5        H  nU H  nUR                  R                  [        5      nU(       a  U(       a  U R                  US-   5        UR                  R                  [        5      nU(       d  Ml  UR                  [        R                  " U5      5        M     M     SSKJn  U(       a7  U R                  S5        [!        U5       H  nU R                  SU 35        M     U(       aP  SSKJn	Jn
Jn  U
" U5      n U	" 5         U" U5      nU(       d  U R                  S5        U R                  SU S	35        g g ! [*         a     g f = f)
NzHypothesis Statisticsz

r   )	_WROTE_TOr;   zobservations written to )
gc_patches
make_patch
save_patchz`git apply z'` to add failing examples to your code.)r   r#   rF   sectionr   r   r   r   r   
write_liner   r'   r   loads!hypothesis.internal.observabilityr   sortedr   r   r   r   	Exception)r   r   print_statsreportsr   r   examplesr   fnamer   r   r   patchs                r   pytest_terminal_summaryr     s]   &--778OP$$%<='--446G!++I6[$//?!??../CD8$++DJJx,@A " 7 	@$$\2	* ++.Fug,NO + UU/0E"5)  ((6''eW$KL   s   F 
FFc                    S[         R                  ;  a  g SSKJn  SnU  HP  n[	        U[
        R                  5      (       d  M$  U" UR                  5      (       d  M=  UR                  S5        SnMR     U(       a  SSK	J
n  U" 5         g g )Nr   r   rv   FT)_get_local_constants)r   r   r   rv   r$   r   Functionru   
add_marker(hypothesis.internal.conjecture.providersr  )itemsrv   has_hypothesis_testsr   r  s        r   pytest_collection_modifyitemsr    sl    s{{*1$D$005G5Q5Q-'+$ 
   V "  r   c                 6    [         =R                  S-  sl        g )Nr5   )_hypothesis_globalsin_initialization)sessions    r   pytest_sessionstartr    s    --2-r   )fixturesc                     S[         R                  ;   a,  SSKJn  U" U5      (       a  [	        SUR
                   S35      e[        X5      $ )Nr   r   r  z!Can't apply @pytest.fixture() to z9 because it is already decorated with @hypothesis.given())r   r   r   rv   RuntimeErrorr+   
_orig_call)r   r   rv   s      r   _ban_given_callr    sQ    3;;&5!(++"78I8I7J KG G  $))r   rx   c                    ^ U R                   =mS:X  aT  U R                  5       (       a?  [        U4S jUR                  S5       5       5      (       d  [        R
                  " SSS9  gg )Nz.hypothesisc              3   <   >#    U  H  n[        TU5      v   M     g 7frN   r   )rO   prh   s     r   rQ   (pytest_ignore_collect.<locals>.<genexpr>  s     U6TGD!,,6Ts   norecursedirszSkipping collection of '.hypothesis' directory - this usually means you've explicitly set the `norecursedirs` pytest config option, replacing rather than extending the default ignores.r5   r6   T)rh   is_dirrT   getiniwarningswarn)collection_pathr   rh   s     @r   pytest_ignore_collectr    s`     )----?#**,,UfmmO6TUUUS  !	 r   c                      g)zCRequired for `pluggy` to load a plugin from setuptools entrypoints.Nr0   r0   r   r   loadr    s    r   )8__doc__r   r   osr   r  r   inspectr   r
  r   _pytest.junitxmlr   r   rC   rD   rF   rG   rH   rE   rU   r   r   r   tuplemaprk   __version__splitPYTEST_TOO_OLD_MESSAGEr  environr   r  r   hypothesis.configurationr9   rK   rV   r`   rr   hookimplr   r   r   r   r  r  _pytestr  r  FixtureFunctionMarkerr)   r  r  r  r0   r   r   <module>r.     s  	   	 
     ( - + 8 !':   	5 ! !& 	S&$$**3/3	45> MM(F,>,>+@@QO ::>><==--2-3;;& Q+-
>H
&"*H __&EJ 'EJN1 __&0K '0Kd$L#,3 !	* //88J.=H""+
6##C(+,1	$NQ  Gs   F F+*F+