+
     h=  c                   s    ^ RI Ht ^ RIHt ^ RIHtHt ^ RIt^ RI	t	^ RI
t
^ RIt^ RIt^ RIt^ RIHtHtHtHt  ! R R]4      tR# )i    )contextmanager)BytesIO)TestCasemockN)FormatChecker
exceptions	protocols
validatorsc                   s   a  ] tR t^t o R tR tR tR tR tR t	R t
R tR	 tR
 tR tR tR tR tR tR tR tR tR tR tR tR tR tRtV tR# )TestDeprecationsc                s(   RpV P                  \        V4      ;_uu_ 4       p^ RIHp RRR4       V P	                  X\
        P                  P                  R4      4       V P	                  XP                  \        4       R#   + '       g   i     La; i)zI
As of v4.0.0, __version__ is deprecated in favor of importlib.metadata.
z.Accessing jsonschema.__version__ is deprecated)__version__N
jsonschema)
assertWarnsRegexDeprecationWarningr
   r	   assertEqual	importlibZmetadataZversionfilename__file__)selfmessagewr	      &   G/usr/lib/python3.14/site-packages/jsonschema/tests/test_deprecations.pytest_versionZTestDeprecations.test_version   sj    
 C""#5w??1. @ 	i&8&8&@&@&NOX.	 @?s   BB	c                
   RpV P                  \        V4      ;_uu_ 4       p^ RIHp RRR4       V P	                  X\
        P                  4       V P	                  XP                  \        4       R#   + '       g   i     LR; i)z}
As of v4.0.0, importing ErrorTree from jsonschema.validators is
deprecated in favor of doing so from jsonschema.exceptions.
z2Importing ErrorTree from jsonschema.validators is 	ErrorTreeN)r   r   jsonschema.validatorsr   r   r   r   r   r   r   r   r   r   r   test_validators_ErrorTreeZ*TestDeprecations.test_validators_ErrorTree   s_     G""#5w??17 @ 	J$8$89X.	 @?   A22B	c                r   )zy
As of v4.18.0, importing ErrorTree from the package root is
deprecated in favor of doing so from jsonschema.exceptions.
z9Importing ErrorTree directly from the jsonschema package r   N)r   r   r
   r   r   r   r   r   r   r   r   test_import_ErrorTreeZ&TestDeprecations.test_import_ErrorTree)   s_     N""#5w??1, @ 	J$8$89X.	 @?r   c                s   \         P                  ! RR.R7      p\         P                  ! 4       p\         P                  ! V.R7      pRpV P                  \        V4      ;_uu_ 4       pW2R&   RRR4       V P                  VR,          V4       V P                  XP                  \        4       R#   + '       g   i     LK; i)z=
As of v4.20.0, setting items on an ErrorTree is deprecated.
z
some errorfoo)Zpath)ZerrorszErrorTree.__setitem__ is N)r   ZValidationErrorr   r   r   r   r   r   )r   eZtreeZsubtreer   r   s   &     r   test_ErrorTree_setitemZ'TestDeprecations.test_ErrorTree_setitem6   s    
 &&|5'B##%&&qc2-""#5w??1!K @ 	eg.X.	 @?s   'B//B?	c                r   )z{
As of v4.18.0, importing FormatError from the package root is
deprecated in favor of doing so from jsonschema.exceptions.
z;Importing FormatError directly from the jsonschema package )FormatErrorN)r   r   r
   r"   r   r   r   r   )r   r   r   r"   r   r   test_import_FormatErrorZ(TestDeprecations.test_import_FormatErrorF   s_     P""#5w??1. @ 	j&<&<=X.	 @?r   c                r   )zx
As of v4.19.0, importing Validator from the package root is
deprecated in favor of doing so from jsonschema.protocols.
z9Importing Validator directly from the jsonschema package )	ValidatorN)r   r   r
   r$   r   r   r   r   )r   r   r   r$   r   r   test_import_ValidatorZ&TestDeprecations.test_import_ValidatorS   s_     N""#5w??1, @ 	I$7$78X.	 @?r   c                s   RpV P                  \        V4      ;_uu_ 4       p\        P                  pRRR4       V P                  X\        P                  4       V P                  XP
                  \        4       R#   + '       g   i     LR; i)zI
As of v4.0.0, accessing jsonschema.validators.validators is
deprecated.
z8Accessing jsonschema.validators.validators is deprecatedN)r   r   r   r   Z_VALIDATORSr   r   r   r   r   valuer   r   test_validators_validatorsZ+TestDeprecations.test_validators_validators`   sg     M""#5w??1))E @ 	
 6 67X.	 @?   A<<B	c                s   RpV P                  \        V4      ;_uu_ 4       p\        P                  pRRR4       V P	                  X\        P
                  4       V P	                  XP                  \        4       R#   + '       g   i     LR; i)zK
As of v4.0.0, accessing jsonschema.validators.meta_schemas is
deprecated.
z:Accessing jsonschema.validators.meta_schemas is deprecatedN)r   r   r   Zmeta_schemasr   Z_META_SCHEMASr   r   r&   r   r   test_validators_meta_schemasZ-TestDeprecations.test_validators_meta_schemasm   sg     O""#5w??1++E @ 	
 8 89X.	 @?r)   c           	     sh   \         P                  P                  / 4      pRpV P                  \        V4      ;_uu_ 4       pVP                  R4      ;_uu_ 4         RRR4       RRR4       V P                  XP                  \        4       R#   + '       g   i     L:; i  + '       g   i     LE; i)z3
As of v4.0.0, RefResolver.in_scope is deprecated.
z.jsonschema.RefResolver.in_scope is deprecated r   N)	r   _RefResolverZfrom_schemar   r   Zin_scoper   r   r   )r   resolverr   r   r   r   test_RefResolver_in_scopeZ*TestDeprecations.test_RefResolver_in_scopez   s}    
 **66r:B""#5w??1""5)) * @ 	X. *) @?s$    B!B	B!BB!!B1	c                s4   \         P                  ! / 4      pRpV P                  \        V4      ;_uu_ 4       pVP	                  RRR/4      pRRR4       V P                  X4       V P                  XP                  \        4       R#   + '       g   i     LC; i)zb
As of v4.0.0, calling is_valid with two arguments (to provide a
different schema) is deprecated.
z5Passing a schema to Validator.is_valid is deprecated r   typenumberN)	r   Draft7Validatorr   r   is_validZassertFalser   r   r   )r   	validatorr   r   Zresult   &    r   %test_Validator_is_valid_two_argumentsZ6TestDeprecations.test_Validator_is_valid_two_arguments   sz     ..r2	I""#5w??1''/ABF @ 	 X.	 @?s   BB	c                sN   \         P                  ! / 4      pRpV P                  \        V4      ;_uu_ 4       pVP	                  RRR/4      w  pRRR4       V P                  XP                  R4       V P                  XP                  \        4       R#   + '       g   i     LN; i)ze
As of v4.0.0, calling iter_errors with two arguments (to provide a
different schema) is deprecated.
z8Passing a schema to Validator.iter_errors is deprecated r   r.   r/   N)	r   r0   r   r   Ziter_errorsr   r2   r   r   )r   r2   r   r   Zerrorr3   r   (test_Validator_iter_errors_two_argumentsZ9TestDeprecations.test_Validator_iter_errors_two_arguments   s     ..r2	L""#5w??1**5682DEFE @ 	&1X.	 @?s   BB$	c                s>   \         P                  ! / 4      pRpV P                  \        V4      ;_uu_ 4       pV P	                  VP
                  \         P                  4       RRR4       V P                  XP                  \        4       R#   + '       g   i     L2; i)z<
As of v4.18.0, accessing Validator.resolver is deprecated.
z&Accessing Draft7Validator.resolver is N)
r   r0   r   r   assertIsInstancer,   r+   r   r   r   )r   r2   r   r   r   r   test_Validator_resolverZ(TestDeprecations.test_Validator_resolver   sq    
 ..r2	:""#5w??1!!)"4"4j6M6MN @ 	X. @?s   +BB	c                s   RpV P                  \        V4      ;_uu_ 4       p^ RIHp RRR4       T P	                  XP
                  \        4       V P                  \        V4      ;_uu_ 4       p^ RIHp RRR4       V P	                  VP
                  \        4       R#   + '       g   i     L; i  + '       g   i     LE; i)z1
As of v4.18.0, RefResolver is fully deprecated.
z$jsonschema.RefResolver is deprecated)RefResolverN)r   r   r
   r8   r   r   r   r   )r   r   r   r8   r   r   test_RefResolverZ!TestDeprecations.test_RefResolver   s    
 9""#5w??1. @X.""#5w??19 @X. @? @?s   B.B2B/	2C	c                s
   RpV P                  \        V4      ;_uu_ 4       p^ RIHp RRR4       T P	                  X\
        P                  4       V P	                  XP                  \        4       V P                  \        V4      ;_uu_ 4       p^ RI	Hp RRR4       V P	                  V\
        P                  4       V P	                  VP                  \        4       R#   + '       g   i     L; i  + '       g   i     Le; i)zt
As of v4.18.0, RefResolutionError is deprecated in favor of directly
catching errors from the referencing library.
z6jsonschema.exceptions.RefResolutionError is deprecatedRefResolutionErrorN)
r   r   r
   r;   r   r   Z_RefResolutionErrorr   r   Zjsonschema.exceptions)r   r   r   r;   r   r   test_RefResolutionErrorZ(TestDeprecations.test_RefResolutionError   s     K""#5w??15 @ 	+Z-K-KLX.""#5w??1@ @ 	+Z-K-KLX. @? @?s   CC2C/	2D	c                s   \         P                  ! RR/4      pV P                  \        P                  P
                  4      ;_uu_ 4       pVP                  ^4       RRR4       \        P                  P                  RR7      pV P                  XP                  \        VP                  4      3VR34       R#   + '       g   i     Le; i)z
This behavior is the intended behavior (i.e. it's not deprecated), but
given we do "tricksy" things in the iterim to wrap exceptions in a
multiple inheritance subclass, we need to be extra sure it works and
stays working.
$refurn:nothingN)refUnresolvable: urn:nothing)
r   Draft202012ValidatorassertRaisesreferencingr   Unresolvablevalidater   	exceptionstr)r   r2   r    Zexpectedr   r   #test_catching_Unresolvable_directlyZ4TestDeprecations.test_catching_Unresolvable_directly   s     33V]4KL	{55BBCCqr" D ))66=6I[[#akk*+23	
	 DCs   
B99C		c                sv   V P                  \        4      ;_uu_ 4        ^ RIHp RRR4       \        P
                  ! RR/4      pV P                  \        P                  P                  4      ;_uu_ 4       pVP                  ^4       RRR4       V P                  X4      ;_uu_ 4       pVP                  ^4       RRR4       V P                  XP                  \        VP                  4      3XP                  R34       R#   + '       g   i     L; i  + '       g   i     L; i  + '       g   i     Lu; i)z
Until RefResolutionError is removed, it is still possible to catch
exceptions from reference resolution using it, even though they may
have been raised by referencing.
r:   Nr=   r>   r@   )assertWarnsr   r
   r;   r   rA   rB   rC   r   rD   rE   r   rF   rG   r   r;   r2   Zur    r3   r   1test_catching_Unresolvable_via_RefResolutionErrorZBTestDeprecations.test_catching_Unresolvable_via_RefResolutionError   s     0115 2 33V]4KL	{55BBCCqr" D 122ar" 3 	[[#akk*+[[56	
 21
 DC 32s#   D6D)D(D	D%	(D8	c                s   V P                  \        4      ;_uu_ 4        ^ RIHp RRR4       \        P
                  ! RR/4      pV P                  \        P                  P                  4      ;_uu_ 4       pVP                  ^4       RRR4       V P                  X4      ;_uu_ 4       pVP                  ^4       RRR4       V P                  XP                  XP                  04       V P                  VP                  VP                  04       R#   + '       g   i     L; i  + '       g   i     L; i  + '       g   i     L; i)zC
Ensure the wrapped referencing errors are hashable when possible.
r:   Nr=   r>   )rI   r   r
   r;   r   rA   rB   rC   r   rD   rE   assertInrF   rJ   r3   r   (test_WrappedReferencingError_hashabilityZ9TestDeprecations.test_WrappedReferencingError_hashability   s     0115 2 33V]4KL	{55BBCCqr" D 122ar" 3 	akkAKK=1akkAKK=1 21
 DC 32s#   D6D&)D9D#	&D6	9E		c           
     s   RpV P                  \        V4      ;_uu_ 4       p ! R R\        P                  4      pRRR4       V P	                  XP
                  \        4       V P                  \        V4      ;_uu_ 4       p ! R R\        P                  ! / R7      4      pRRR4       R#   + '       g   i     Ly; i  + '       g   i     R# ; i)a+  
As of v4.12.0, subclassing a validator class produces an explicit
deprecation warning.

This was never intended to be public API (and some comments over the
years in issues said so, but obviously that's not a great way to make
sure it's followed).

A future version will explicitly raise an error.
z!Subclassing validator classes is c                       ] tR tRtRtR# )=TestDeprecations.test_Validator_subclassing.<locals>.Subclassi   N__name__
__module____qualname____firstlineno____static_attributes__rP       r   SubclassrO         rW   rX   Nc                   rN   )DTestDeprecations.test_Validator_subclassing.<locals>.AnotherSubclassi  rP   NrQ   rP   rW   r   AnotherSubclassrZ     rY   rW   r[   )Zmeta_schema)r   r   r   rA   r   r   r   Zcreate)r   r   r   rX   r[   r3   r   test_Validator_subclassingZ+TestDeprecations.test_Validator_subclassing
  s     6""#5w??1:::  @ 	X.""#5w??1*"3"3"C  @? @? @??s   B,!B?,B<	?C	c                s@   V P                  \        P                  P                  RR4       RpV P	                  \
        V4      ;_uu_ 4       p\        P                  ! R4       RRR4       V P                  XP                  \        4       R#   + '       g   i     L2; i)zL
As of v4.14.0, FormatChecker.cls_checks is deprecated without
replacement.
ZboomNzFormatChecker.cls_checks )

addCleanupr   ZcheckersZpopr   r   Z
cls_checksr   r   r   )r   r   r   s   &  r   test_FormatChecker_cls_checksZ.TestDeprecations.test_FormatChecker_cls_checks!  so     	..22FDA-""#5w??1$$V, @ 	X. @?s   BB	c                s    RpV P                  \        V4      ;_uu_ 4       p^ RIHp RRR4       T P	                  X\
        P                  P                  4       V P                  XP                  \        4       RpV P                  \        V4      ;_uu_ 4       p^ RIHp RRR4       T P	                  X\
        P                  P                  4       V P                  VP                  \        4       RpV P                  \        V4      ;_uu_ 4       p^ RIHp RRR4       T P	                  X\
        P                  P                  4       V P                  VP                  \        4       RpV P                  \        V4      ;_uu_ 4       p^ R	IHp RRR4       T P	                  X\
        P                   P                  4       V P                  VP                  \        4       R
pV P                  \        V4      ;_uu_ 4       p^ RIHp RRR4       T P	                  X\
        P$                  P                  4       V P                  VP                  \        4       RpV P                  \        V4      ;_uu_ 4       p^ RIHp RRR4       T P	                  X\
        P(                  P                  4       V P                  VP                  \        4       V P+                  \,        4      ;_uu_ 4        ^ RIHp	 RRR4       R#   + '       g   i     EL; i  + '       g   i     EL; i  + '       g   i     EL; i  + '       g   i     EL; i  + '       g   i     ELR; i  + '       g   i     L; i  + '       g   i     R# ; i)zo
As of v4.16.0, accessing jsonschema.draftn_format_checker is deprecated
in favor of Validator.FORMAT_CHECKER.
z3Accessing jsonschema.draft202012_format_checker is )draft202012_format_checkerNz3Accessing jsonschema.draft201909_format_checker is )draft201909_format_checkerz.Accessing jsonschema.draft7_format_checker is )draft7_format_checkerz.Accessing jsonschema.draft6_format_checker is )draft6_format_checkerz.Accessing jsonschema.draft4_format_checker is )draft4_format_checkerz.Accessing jsonschema.draft3_format_checker is )draft3_format_checker)draft1234_format_checker)r   r   r
   r_   ZassertIsr   rA   ZFORMAT_CHECKERr   r   r   r`   ZDraft201909Validatorra   r0   rb   ZDraft6Validatorrc   ZDraft4Validatorrd   ZDraft3ValidatorrB   ZImportErrorre   )
r   r   r   r_   r`   ra   rb   rc   rd   re   s
   &         r   test_draftN_format_checkerZ+TestDeprecations.test_draftN_format_checker/  s    H""#5w??1= @ 	&++::	
 	X.G""#5w??1= @ 	&++::	
 	X.B""#5w??18 @ 	!&&55	
 	X.B""#5w??18 @ 	!&&55	
 	X.B""#5w??18 @ 	!&&55	
 	X.B""#5w??18 @ 	!&&55	
 	X.{++; ,+w @?? @?? @?? @?? @?? @? ,++sS   LLL-MM>M)4M<L	L*	-L>	M	M&	)M9	<N	c                s   RpV P                  \        V4      ;_uu_ 4       p^ RIp\        P                  ! VP
                  4       RRR4       V P                  XP                  \        P                  4       R#   + '       g   i     L<; i)z8
As of v4.17.0, importing jsonschema.cli is deprecated.
z5The jsonschema CLI is deprecated and will be removed N)	r   r   Zjsonschema.clir   ZreloadZclir   r   r   )r   r   r   r
   r   r   test_import_cliZ TestDeprecations.test_import_clit  sa    
 J""#5w??1!Z^^, @ 	Y%7%78	 @?s   %A::B
	c                s    \         P                  ! \        P                  RR.RRR7      pV P	                  RVP
                  4       R# )z2
As of v4.17.0, the jsonschema CLI is deprecated.
z-mr
   T)Zcapture_outputZchecks!   The jsonschema CLI is deprecated N)
subprocessZrunsysZ
executablerL   Zstderr)r   Zprocesss   & r   test_cliZTestDeprecations.test_cli  s;    
 ..^^T<0

 	:GNNKrW   c           
     s  a a RpRRRR///oR\         P                  9   dA   S P                  \         P                  P                  R\         P                  R,          4       R\         P                  R&   \        VV 3R l4       p\
        P                  ! R	V/4      pR
p\        P                  P                  \        P                  RVR7      pT;_uu_ 4        S P                  \        V4      ;_uu_ 4        S P                  VP                  / 4      VP                  ^%4      3R4       RRR4       RRR4       R#   + '       g   i     L; i  + '       g   i     R# ; i)zG
Automatic retrieval of remote references is deprecated as of v4.18.0.
zhttp://bar#/$defs/bazz$defsZbazr.   ZintegerZrequestsNc              3   s  <"   SP                  V \        P                  P                  4       SP	                  V P
                  R 4       V P                  4       w  w  rSP	                  VP                  4       R4       SP	                  VR4       \        \        P                  ! S4      P                  R4      4      x  R# 5i)z
http://barz
user-agentz.python-jsonschema (deprecated $ref resolution)Zutf8N)r6   urllibrequestZRequestr   Zfull_urlZheader_itemsZlowerr   jsonZdumpsZencode)rl   Zheaderr'   schemar   s   &  r   fake_urlopenZFTestDeprecations.test_automatic_remote_retrieval.<locals>.fake_urlopen  s     !!'6>>+A+ABW--|<  '335OVV\\^\:G $**V,33F;<<s   B?Cr=   z+Automatically retrieving remote references Zurlopen)Znew)FT)ri   Zmodulesr]   Z__setitem__r    r   rA   r   patchZobjectrk   rl   r   r   r   r1   )r   r?   ro   r2   r   rp   rn   s   f     @r   test_automatic_remote_retrievalZ0TestDeprecations.test_automatic_remote_retrieval  s    &EFI#678$OO''S[[5L #'J		= 
	= 33VSMB	?

!!&..)!NUD))*<gFF##B'););B)?@ GUUFFUUUs$   E83D=	+E=EEE!	rP   N)rR   rS   rT   rU   r   r   r   r!   r#   r%   r(   r*   r-   r4   r5   r7   r9   r<   rH   rK   rM   r\   r^   rf   rg   rj   rq   rV   Z__classdictcell__)Z__classdict__s   @r   r   r      s     
//// ///////
///&
$
,2$./C<J
9
L$ $rW   r   )Z
contextlibr    Zior   Zunittestr   r   Zimportlib.metadatar   rm   rh   ri   Zurllib.requestrk   Zreferencing.exceptionsrC   r
   r   r   r   r   r   rP   rW   r   <module>rr      s4    %  #    
   G Gax arW   