asda?‰PNG  IHDR ? f ??C1 sRGB ??é gAMA ±? üa pHYs ? ??o¨d GIDATx^íüL”÷e÷Y?a?("Bh?_ò???¢§?q5k?*:t0A-o??¥]VkJ¢M??f?±8\k2íll£1]q?ù???T a bYh0 @sddlZddlZddlZddlZddlZddlmZmZmZm Z ddl m Z m Z ddl m Z mZddl mZmZddl mZmZmZddl mZmZmZddl mZmZmZmZdd l mZdd l mZmZmZmZm Z dd l m!Z!m"Z"dd l m#Z#dd l m$Z$m%Z%ddl m&Z&m'Z'ddl m(Z(ddl m)Z)ddl m*Z*m+Z+ddl m,Z,m-Z-m.Z.ddl m/Z/m0Z0ddl m1Z1m2Z2ddl3Z3ddl Z ddl4Z4ddl5Z5ddl6m7Z7ddl6m8Z8GdddeZ9GdddZ:Gddde:Z;Gddde:ZGd#d$d$e9Z?Gd%d&d&e9Z@Gd'd(d(e9ZAGd)d*d*e9ZBGd+d,d,e9ZCGd-d.d.e9ZDed/eEeFZGed0ZHGd1d2d2eeGeHfZIGd3d4d4eIeGeHfZJGd5d6d6e ZKe"Gd7d8d8eKe ZLGd9d:d:ZMGd;d<dd>e ZOe"Gd?d@d@eNeOe ZPe"GdAdBdBe ZQGdCdDdDeQZRGdEdFdFZSGdGdHdHe*ZTe"GdIdJdJe ZUGdKdLdLe9ZVGdMdNdNe9ZWGdOdPdPe9ZXGdQdRdRe9ZYGdSdTdTe9ZZGdUdVdVe9Z[GdWdXdXe9Z\dYZ]z e^e]Wne_ydZZ`Yn0d[Z`dd\l6maZambZbmcZcmdZdmeZedd]l mfZfGd^d_d_ZgGd`dadaegZhGdbdcdcehZiGdddedeeeZjGdfdgdgZkGdhdidiZlGdjdkdke*ZmGdldmdme*ZnGdndodoe*ZoGdpdqdqe*Zpe+drdseEfgZqGdtdudue+ZrGdvdwdwe8jsdZdxZtGdydzdzereqZuGd{d|d|e+dZdxZvGd}d~d~e7jgZwefexdddZyzeyez{dWn:e|yZ}z e}j~ddksJWYdZ}[}n dZ}[}00e#ZGdddZGddde9ZGdddeZGddde9ZGddde9ZGddde9ZGddde9ZGddde9ZGddde9ZGddde9ZGddde9ZGddde9ZGddde9ZedkredS)N)TestCasemain skipUnlessskip)copydeepcopy)AnyNoReturn)TypeVarAnyStr)TKTVT)UnionOptionalLiteral)TupleListDictMutableMapping)Callable)GenericClassVarFinalfinalProtocol)castruntime_checkable)get_type_hints) get_originget_args) no_type_checkno_type_check_decoratorType)NewType) NamedTuple TypedDictIOTextIOBinaryIO)PatternMatch) Annotated ForwardRef)mod_generics_cache)_typed_dict_helperc@s(eZdZdddZd ddZddZdS) BaseTestCaseNcCs8t||s4d||f}|dur*|d|7}||dS)Nz%r is not a subclass of %r : %s issubclassZfailureExceptionselfclsZclass_or_tuplemsgmessager;,/usr/local/lib/python3.9/test/test_typing.pyassertIsSubclass%s    zBaseTestCase.assertIsSubclasscCs8t||r4d||f}|dur*|d|7}||dS)Nz%r is a subclass of %rr3r4r6r;r;r<assertNotIsSubclass,s    z BaseTestCase.assertNotIsSubclasscCstjD] }|qdSN)typing _cleanupsr7fr;r;r< clear_caches3s zBaseTestCase.clear_caches)N)N)__name__ __module__ __qualname__r=r>rDr;r;r;r<r2#s  r2c@s eZdZdS)EmployeeNrErFrGr;r;r;r<rH8srHc@s eZdZdS)ManagerNrIr;r;r;r<rJ<srJc@s eZdZdS)FounderNrIr;r;r;r<rK@srKc@s eZdZdS)ManagingFounderNrIr;r;r;r<rLDsrLc@sDeZdZddZddZddZddZd d Zd d Zd dZ dS)AnyTestscCs8|ttdtWdn1s*0YdSN*) assertRaises TypeError isinstancerr7r;r;r<test_any_instance_type_errorJs z%AnyTests.test_any_instance_type_errorcCsl|ttttWdn1s*0Y|ttttWdn1s^0YdSr?)rPrQr5rHrrSr;r;r<test_any_subclass_type_errorNs ( z%AnyTests.test_any_subclass_type_errorcCs|ttddS)Nz typing.Any) assertEqualreprrrSr;r;r< test_reprTszAnyTests.test_reprcCsj|ttdtWdn1s*0Y|tttWdn1s\0YdSrN)rPrQr5rintrSr;r;r< test_errorsWs ( zAnyTests.test_errorscCs||t Gdddt}Wdn1s00Y|t$Gdddtt}Wdn1sn0YdS)Nc@s eZdZdSz(AnyTests.test_cannot_subclass..ANrIr;r;r;r<A_sr\c@s eZdZdSr[rIr;r;r;r<r\bsrPrQrtyper7r\r;r;r<test_cannot_subclass]s . zAnyTests.test_cannot_subclasscCsh|ttWdn1s&0Y|tttWdn1sZ0YdSr?r]rSr;r;r<test_cannot_instantiatees $ z AnyTests.test_cannot_instantiatecCs"tjttjttjtdSr?)r@r-rr,r)rSr;r;r<test_any_works_with_aliasks  z"AnyTests.test_any_works_with_aliasN) rErFrGrTrUrXrZr`rarbr;r;r;r<rMHsrMc@s<eZdZddZddZddZddZd d Zd d Zd S) NoReturnTestscCs8|ttdtWdn1s*0YdSrN)rPrQrRr rSr;r;r<!test_noreturn_instance_type_errorts z/NoReturnTests.test_noreturn_instance_type_errorcCsl|ttttWdn1s*0Y|ttttWdn1s^0YdSr?)rPrQr5rHr rSr;r;r<!test_noreturn_subclass_type_errorxs ( z/NoReturnTests.test_noreturn_subclass_type_errorcCs|ttddS)Nztyping.NoReturn)rVrWr rSr;r;r<rX~szNoReturnTests.test_reprcCs6|tttWdn1s(0YdSr?)rPrQr rYrSr;r;r<test_not_generics zNoReturnTests.test_not_genericcCs||t Gdddt}Wdn1s00Y|t$Gdddtt}Wdn1sn0YdS)Nc@s eZdZdSz-NoReturnTests.test_cannot_subclass..ANrIr;r;r;r<r\sr\c@s eZdZdSrgrIr;r;r;r<r\srPrQr r^r_r;r;r<r`s . z"NoReturnTests.test_cannot_subclasscCsh|ttWdn1s&0Y|tttWdn1sZ0YdSr?rhrSr;r;r<ras $ z%NoReturnTests.test_cannot_instantiateN) rErFrGrdrerXrfr`rar;r;r;r<rcrs rcc@s|eZdZddZddZddZddZd d Zd d Zd dZ ddZ ddZ ddZ ddZ ddZddZddZdS) TypeVarTestscCs$td}|||||tdSNr )r rVassertIsInstancer7r r;r;r<test_basic_plains zTypeVarTests.test_basic_plaincCs@td}|ttd|Wdn1s20YdS)Nr rO)r rPrQrRrlr;r;r< test_typevar_instance_type_errors z-TypeVarTests.test_typevar_instance_type_errorcCsttd}|ttt|Wdn1s20Y|tt|tWdn1sf0YdSrj)r rPrQr5rYrlr;r;r< test_typevar_subclass_type_errors  ( z-TypeVarTests.test_typevar_subclass_type_errorcCs<|ttdt}|Wdn1s.0YdS)NX)rPrQr rYr7rpr;r;r<test_constrained_errors  z#TypeVarTests.test_constrained_errorcCstd}td}||||t|||t|t||f|t||f||t|tft||t|tftt|t|tfj|tf|t|tfj|f|t|tfjtdS)NrpY) r assertNotEqualrVrrY__args____parameters__assertIs __origin__)r7rprsr;r;r<test_union_uniques zTypeVarTests.test_union_uniquecCs(tdtt}|t|tft|dSNr\)r strbytesrtrr_r;r;r<test_union_constraineds z#TypeVarTests.test_union_constrainedcCs||ttd|ttd|ttd|ttdtddd}|t|dtd dd }|t|d dS) Nz~Tz~KTz~VTz~AnyStrT_coT covariantz+T_coT_contra) contravariantz -T_contra)rVrWr r rr r )r7r~rr;r;r<rXs  zTypeVarTests.test_reprcCs4|tdtd|tdtttdttdSrj)rtr rYr{rSr;r;r<test_no_redefinitionsz!TypeVarTests.test_no_redefinitioncCsB|t$Gdddtd}Wdn1s40YdS)Nc@s eZdZdS)z1TypeVarTests.test_cannot_subclass_vars..VNrIr;r;r;r<Vsrr rPrQr r7rr;r;r<test_cannot_subclass_varss z&TypeVarTests.test_cannot_subclass_varscCs>|t Gdddt}Wdn1s00YdS)Nc@s eZdZdS)z7TypeVarTests.test_cannot_subclass_var_itself..VNrIr;r;r;r<rsrrrr;r;r<test_cannot_subclass_var_itselfs z,TypeVarTests.test_cannot_subclass_var_itselfcCs8|ttdWdn1s*0YdSrzrrSr;r;r<test_cannot_instantiate_varss z)TypeVarTests.test_cannot_instantiate_varscCst|ttdddWdn1s,0Y|t tdtttdWdn1sf0YdS)NrprObound)rPrQr r{floatrHrSr;r;r<test_bound_errorss * zTypeVarTests.test_bound_errorscCsd}t|idS)Nz&import typing T = typing.TypeVar('T') )exec)r7coder;r;r<test_missing__name__sz!TypeVarTests.test_missing__name__cCs<|ttddddWdn1s.0YdS)Nr T)rr)rP ValueErrorr rSr;r;r<test_no_bivariants zTypeVarTests.test_no_bivariantN)rErFrGrmrnrorrryr}rXrrrrrrrr;r;r;r<ris  ric@seZdZddZddZddZddZd d Zd d Zd dZ ddZ ddZ ddZ ddZ ddZddZddZddZdd Zd!d"Zd#d$Zd%d&Zd'd(Zd)S)* UnionTestscCstttf}||tdSr?)rrYrrtr7ur;r;r< test_basicss zUnionTests.test_basicscCs|ttttWdn1s*0Y|ttttWdn1s^0Y|t"tttttfWdn1s0Y|t"ttttftWdn1s0YdSr?)rPrQr5rYrr{rSr;r;r<test_subclass_errors ( ( 0 zUnionTests.test_subclass_errorcCsltt}||ttttf}tttf}tttf}|||||t||t||tdSr?)rrrVrYobjectrt)r7ru1u2u3r;r;r<test_union_anys       zUnionTests.test_union_anycCsTtt}||ttttf}tttf}|||||t||tdSr?)rrrVrYrt)r7rrrr;r;r<test_union_objects     zUnionTests.test_union_objectcCs(tttf}tttf}|||dSr?)rrYrrV)r7rrr;r;r<test_unordereds  zUnionTests.test_unorderedcCstt}||tdSr?)rrHrw)r7tr;r;r<test_single_class_disappearssz'UnionTests.test_single_class_disappearscCs8tttf}||t|t|j|t|jdSr?)rrHrJrtassertInrurr;r;r<test_base_class_kepts  zUnionTests.test_base_class_keptcCs2tttf}t|tf}||ttttfdSr?)rrYrrHrV)r7rvr;r;r<test_union_union s  zUnionTests.test_union_unioncCs6|ttdtttf}|t|dttttf}|t|dttd}t|tft}|t|ttttttf}|t|dtttt t t ff}|t|dtdt f}|t|dtt df}|t|dtdt tf}|t|dt t }|t|ddS) Nz typing.Unionztyping.Union[%s.Employee, int]ztyping.Union[int, %s.Employee]r z#typing.Union[typing.List[int], int]z)typing.Union[list[int], dict[str, float]]ztyping.Optional[str]z typing.Union[NoneType, str, int]) rVrWrrHrYrEr rlistdictr{rr)r7rr r;r;r<rX%s(    zUnionTests.test_reprcCs|t Gdddt}Wdn1s00Y|t$Gdddtt}Wdn1sn0Y|t(Gdddtttf}Wdn1s0YdS)Nc@s eZdZdSz*UnionTests.test_cannot_subclass..CNrIr;r;r;r<C>src@s eZdZdSrrIr;r;r;r<rAsc@s eZdZdSrrIr;r;r;r<rDs)rPrQrr^rYr{r7rr;r;r<r`<s  . 2 zUnionTests.test_cannot_subclasscCs|ttWdn1s&0Y|tttWdn1sZ0Ytttf}|t|Wdn1s0Y|tt|Wdn1s0YdSr?)rPrQrr^rYrrr;r;r<raGs $ (  $ z"UnionTests.test_cannot_instantiatecCs|tttjtftk|tttjtftjtk|ttttjtfj|tjttttjtfjdSr?) assertFalserr{r@IterablerYrrurSr;r;r<test_union_generalizationRs"z$UnionTests.test_union_generalizationcCsb|tt|tt|tt|tt|dgt|ttj|ttjtdSr?) rtrrrrrr@MappingrrSr;r;r<test_union_compare_otherXs    z#UnionTests.test_union_compare_othercCs$tt}ttdf}|||dSr?)rrYrrV)r7orr;r;r< test_optionalas zUnionTests.test_optionalcCs6|ttdWdn1s(0YdSNr;)rPrQrrSr;r;r< test_emptyfs zUnionTests.test_emptycCs@|t"tdtttfWdn1s20YdSrN)rPrQrRrrYr{rSr;r;r<test_union_instance_type_errorjs z)UnionTests.test_union_instance_type_errorcCs2tttf}|ddd}|t|d|dS)NxcSsdSr?r;rr;r;r<rCpz(UnionTests.test_no_eval_union..fr)rrYr{rwr)r7rrCr;r;r<test_no_eval_unionns zUnionTests.test_no_eval_unioncCs*tddd}|tt|tfddS)NreturncSsdSr?r;r;r;r;r<funtrz0UnionTests.test_function_repr_union..funztyping.Union[fun, int])rYrVrWr)r7rr;r;r<test_function_repr_unionssz#UnionTests.test_function_repr_unioncCstttf}|dSr?)rr{r,r_r;r;r<test_union_str_patternws z!UnionTests.test_union_str_patterncs4ddlmttffdd}t|tfdS)NrElementcs|Sr?r;)argsrr;r<Elemsz#UnionTests.test_etree..Elem)Zxml.etree.ElementTreerrr{)r7rr;rr< test_etree|s   zUnionTests.test_etreeN)rErFrGrrrrrrrrrXr`rarrrrrrrrrr;r;r;r<rs(      rc@s<eZdZddZddZddZddZd d Zd d Zd S) TupleTestscCs|t"tttttfWdn1s20Y|t"tttttfWdn1sn0YGdddt}|ttt|t|tdS)Nc@s eZdZdS)z"TupleTests.test_basics..TPNrIr;r;r;r<TPrr)rPrQr5rrYr{tuple assertTrue)r7rr;r;r<rs 0 0zTupleTests.test_basicscCsd|tttt|ttdfttdf|tttttf|ttttdfdSN.)rVrrYrtrSr;r;r< test_equalityszTupleTests.test_equalitycCs$Gdddt}|t|tdS)Nc@s eZdZdS)z/TupleTests.test_tuple_subclass..MyTupleNrIr;r;r;r<MyTuplesr)rrr5r)r7rr;r;r<test_tuple_subclassszTupleTests.test_tuple_subclasscCsL|t"tdtttfWdn1s20Y|dtdS)N)rr)rPrQrRrrYrkrSr;r;r<test_tuple_instance_type_errors 0z)TupleTests.test_tuple_instance_type_errorcCsp|ttd|ttdd|ttttfd|tttdfd|ttttddS)Nz typing.Tupler;ztyping.Tuple[()]ztyping.Tuple[int, float].ztyping.Tuple[int, ...]ztyping.Tuple[list[int]])rVrWrrYrrrSr;r;r<rXs zTupleTests.test_reprcCsp|ttdtWdn1s*0Y|ttdttWdn1sb0YdSrN)rPrQr5rrYrSr;r;r<rZs ( zTupleTests.test_errorsN) rErFrGrrrrrXrZr;r;r;r<rs  rc@sTeZdZddZddZddZddZd d Zd d Zd dZ ddZ ddZ dS) CallableTestscCsh|t2|ttddttgtfWdn1sB0Y|ttddtdS)NcSs|Sr?r;rr;r;r<rz2CallableTests.test_self_subclass..cSs|Sr?r;rr;r;r<rr)rPrQrr5r^rrYrSr;r;r<test_self_subclasss @z CallableTests.test_self_subclasscCs|ttgtfttgtf|tttgtfttgtfhd|ttgtfttgtf|ttgtfttgtf|ttgtftttgtf|ttgtftgtf|ttgtftdSN)rVrrYlenrtr{rSr;r;r< test_eq_hashs (  "zCallableTests.test_eq_hashcCs|ttWdn1s&0Y|tttWdn1sZ0Yttgtf}|t|Wdn1s0Y|tt|Wdn1s0YdSr?)rPrQrr^rYr{)r7cr;r;r<ras $ ( $ z%CallableTests.test_cannot_instantiatecCs6|tttWdn1s(0YdSr?)rPrQrrYrSr;r;r<test_callable_wrong_formss z'CallableTests.test_callable_wrong_formscCs$dd}||t|dtdS)NcSsdSr?r;r;r;r;r<rCsz5CallableTests.test_callable_instance_works..f)rkrassertNotIsInstancerBr;r;r<test_callable_instance_workss z*CallableTests.test_callable_instance_workscCsdd}|t$||tgdfWdn1s<0Y|t$||tgtfWdn1sz0Y|t$|dtgdfWdn1s0Y|t$|dtgtfWdn1s0YdS)NcSsdSr?r;r;r;r;r<rCsz:CallableTests.test_callable_instance_type_error..f)rPrQrkrrrrBr;r;r<!test_callable_instance_type_errors 2 2 2 z/CallableTests.test_callable_instance_type_errorcCstgtf}|t|dtttgtf}|t|dtdtf}|t|dtttgttf}|t|ddS)Nztyping.Callable[[], bool]z"typing.Callable[[str, float], int].ztyping.Callable[..., str]z(typing.Callable[[str, float], list[int]])rboolrVrWr{rrYr)r7Zct0Zct2ZctvZct3r;r;r<rXs  zCallableTests.test_reprcCs>tdtfddd}|t|ttdtdtfidS)N.acSsdSr?r;rr;r;r<foosz6CallableTests.test_callable_with_ellipsis..foor)rr rVrglobalslocalsr7rr;r;r<test_callable_with_ellipsissz)CallableTests.test_callable_with_ellipsiscCstjtdtfdSr)r@rrr{rSr;r;r<test_ellipsis_in_genericsz&CallableTests.test_ellipsis_in_genericN) rErFrGrrrarrrrXrrr;r;r;r<rs    rc@sleZdZddZddZddZddZd d Zd d Zd dZ ddZ ddZ ddZ ddZ ddZdS) LiteralTestscCsPtdtdtdtdtdtdttdtdftddS) Nrr)ryzT)r2Frr)sfoobar)rrSr;r;r<rszLiteralTests.test_basicscCs*tttdtdddttdS)N)y@@.r;rrrr)rrYr rSr;r;r<3test_illegal_parameters_do_not_raise_runtime_errorssz@LiteralTests.test_illegal_parameters_do_not_raise_runtime_errorscCsttdttddS)Nr)rrbaz)rrrSr;r;r< test_literals_inside_other_typess z-LiteralTests.test_literals_inside_other_typescCsx|ttdd|ttdd|tttd|ttd|ttdd|ttdd dS) Nrztyping.Literal[1])rTrztyping.Literal[1, True, 'foo']ztyping.Literal[int]ztyping.Literalztyping.Literal[None]rrrrztyping.Literal[1, 2, 3])rVrWrrYrSr;r;r<rXs zLiteralTests.test_reprcCs|ttWdn1s&0Y|ttdWdn1sZ0Y|tttWdn1s0Y|tttdWdn1s0YdSr)rPrQrr^rSr;r;r<test_cannot_inits $ ( ( zLiteralTests.test_cannot_initcCs|ttdtdWdn1s.0Y|ttttdWdn1sf0Y|ttdtdWdn1s0Y|ttttdWdn1s0YdSr)rPrQrRrrYr5rSr;r;r< test_no_isinstance_or_issubclass%s , , , z-LiteralTests.test_no_isinstance_or_issubclasscCs||t$Gdddtd}Wdn1s40Y|t Gdddt}Wdn1sn0YdS)Nc@s eZdZdS)z-LiteralTests.test_no_subclassing..FooNrIr;r;r;r<Foo1rrrc@s eZdZdS)z-LiteralTests.test_no_subclassing..BarNrIr;r;r;r<Bar3rrrPrQr)r7rrr;r;r<test_no_subclassing/s 2 z LiteralTests.test_no_subclassingcCs:|ttddWdn1s,0YdSrrrSr;r;r<test_no_multiple_subscripts5s z(LiteralTests.test_no_multiple_subscriptscCs|tdtd|tdtd|tdtd|tdtd|tdtd|tdtd |tdtd|tdtd |td td dS) NrFTrr)rT)rrr)Trrrrr)rtrrVrSr;r;r< test_equal9szLiteralTests.test_equalcCsX|ttdttd|ttdttd|ttdttddS)Nrrrrr)rVhashrrSr;r;r< test_hashDszLiteralTests.test_hashcCsb|tdjd|tdjd|tdtdtdfjd|tggfjggfdS)Nrrrr)rr)rrrr)rVrrurSr;r;r< test_argsIs zLiteralTests.test_argscCshttdtdtdf}ttddf}ttd}|||fD]"}||td||jdq@dS)Nrrrrr)rrVru)r7l1l2l3lr;r;r< test_flattenPs  zLiteralTests.test_flattenN)rErFrGrrrrXrrrrrrrrr;r;r;r<rs    rXKXVc@s@eZdZeedddZeedddZd eeedd d ZdS) SimpleMapping)keyrcCsdSr?r;r7rr;r;r< __getitem___szSimpleMapping.__getitem__)rvaluecCsdSr?r;r7rrr;r;r< __setitem__bszSimpleMapping.__setitem__N)rdefaultrcCsdSr?r;r7rr r;r;r<geteszSimpleMapping.get)N)rErFrGrrrr r r;r;r;r<r]src@s@eZdZddZedddZedddZd edd d ZdS) MySimpleMappingcCs i|_dSr?storerSr;r;r<__init__kszMySimpleMapping.__init__)rcCs |j|Sr?rrr;r;r<rnszMySimpleMapping.__getitem__cCs||j|<dSr?rr r;r;r<r qszMySimpleMapping.__setitem__NcCs(z |j|WSty"|YS0dSr?)rKeyErrorr r;r;r<r ts  zMySimpleMapping.get)N)rErFrGrr{rr r r;r;r;r<risrc@seZdZUeed<eed<dS) CoordinaterrNrErFrGrY__annotations__r;r;r;r<r{s rc@seZdZUeed<dS)PointlabelNrErFrGr{rr;r;r;r<rs rc@s&eZdZUeed<eed<eed<dS)MyPointrrrNrErFrGrYrr{r;r;r;r<rs rc@seZdZUeed<dS)XAxisrNrr;r;r;r<rs rc@seZdZUeed<dS)YAxisrNrr;r;r;r<rs rc@s eZdZdS)PositionNrIr;r;r;r<rsrc@s&eZdZUeed<eedddZdS)ProtoattrargrcCsdSr?r;r7r!r;r;r<methsz Proto.methN)rErFrGrYrr{r#r;r;r;r<rs rc@s eZdZdS)ConcreteNrIr;r;r;r<r$sr$c@s*eZdZUdZeed<eedddZdS)Otherrrr cCs|dkr dSdS)Nthisrrr;r"r;r;r<r#sz Other.methN)rErFrGrrYrr{r#r;r;r;r<r%s  r%c@seZdZUeed<eed<dS)NTrrNrr;r;r;r<r's r'c@seZdZUejed<dS)HasCallProtocol__call__N)rErFrGr@rrr;r;r;r<r(s r(c@steZdZddZddZddZddZd d Zd d Zd dZ ddZ ddZ ddZ ddZ ddZddZddZddZdd Zd!d"Zd#d$Zd%d&Zd'd(Zd)d*Zd+d,Zd-d.Zd/d0Zd1d2Zd3d4Zd5d6Zd7d8Zd9d:Zd;d<Z d=d>Z!d?d@Z"dAdBZ#dCdDZ$dEdFZ%dGdHZ&dIdJZ'dKdLZ(dMdNZ)dOdPZ*dQdRZ+dSdTZ,dUdVZ-dWdXZ.dYdZZ/d[S)\ ProtocolTestscCstGdddt}Gddd}Gddd}dd}|||||||||||||tj||||dS) Nc@seZdZddZdS)z,ProtocolTests.test_basic_protocol..PcSsdSr?r;rSr;r;r<r#sz1ProtocolTests.test_basic_protocol..P.methNrErFrGr#r;r;r;r<Psr,c@s eZdZdS)z,ProtocolTests.test_basic_protocol..CNrIr;r;r;r<rrrc@seZdZddZdS)z,ProtocolTests.test_basic_protocol..DcSsdSr?r;rSr;r;r<r#sz1ProtocolTests.test_basic_protocol..D.methNr+r;r;r;r<Dsr-cSsdSr?r;r;r;r;r<rCsz,ProtocolTests.test_basic_protocol..f)rrr=rkr>rtypes FunctionType)r7r,rr-rCr;r;r<test_basic_protocols  z!ProtocolTests.test_basic_protocolcCsrtGdddt}Gddd}dd}ttt|tjfD]}|||q:tddt|fD]}| ||q\dS) Nc@s eZdZdS)zFProtocolTests.test_everything_implements_empty_protocol..EmptyNrIr;r;r;r<Emptysr1c@s eZdZdS)zBProtocolTests.test_everything_implements_empty_protocol..CNrIr;r;r;r<rsrcSsdSr?r;r;r;r;r<rCszBProtocolTests.test_everything_implements_empty_protocol..frr;) rrrr^rr.r/r=r@rk)r7r1rrCthingr;r;r<)test_everything_implements_empty_protocolsz7ProtocolTests.test_everything_implements_empty_protocolcCsdd}||tdS)NcSsdSr?r;r;r;r;r<rCsz:ProtocolTests.test_function_implements_protocol..f)rkr(rBr;r;r<!test_function_implements_protocolsz/ProtocolTests.test_function_implements_protocolcCsGddd}Gdddt}|t"Gddd|t}Wdn1sP0Y|t"Gdddt|}Wdn1s0Y|t$Gddd||t}Wdn1s0YGd d d ||}Gd d d ||}||||||dS) Nc@s eZdZdS)z9ProtocolTests.test_no_inheritance_from_nominal..CNrIr;r;r;r<rrrc@s eZdZdS)z:ProtocolTests.test_no_inheritance_from_nominal..BPNrIr;r;r;r<BPrr5c@s eZdZdSz9ProtocolTests.test_no_inheritance_from_nominal..PNrIr;r;r;r<r,sr,c@s eZdZdSr6rIr;r;r;r<r,sc@s eZdZdSr6rIr;r;r;r<r,sc@s eZdZdS)z9ProtocolTests.test_no_inheritance_from_nominal..DNrIr;r;r;r<r-rr-c@s eZdZdS)z9ProtocolTests.test_no_inheritance_from_nominal..ENrIr;r;r;r<Err7)rrPrQr)r7rr5r,r-r7r;r;r< test_no_inheritance_from_nominals 0 0 2z.ProtocolTests.test_no_inheritance_from_nominalcCsGdddt}|t|Wdn1s60YGddd|}||||t|dWdn1s0Ytd}Gdddt|}|t|Wdn1s0Y|t|tWdn1s0Y|t||Wdn1s>0YGd d d ||}||t||t|tdWdn1s0YdS) Nc@s eZdZdS)z.ProtocolTests.test_no_instantiation..PNrIr;r;r;r<r,rr,c@s eZdZdS)z.ProtocolTests.test_no_instantiation..CNrIr;r;r;r<rrrrOr c@s eZdZdS)z/ProtocolTests.test_no_instantiation..PGNrIr;r;r;r<PGrr9c@s eZdZdS)z/ProtocolTests.test_no_instantiation..CGNrIr;r;r;r<CGrr:)rrPrQrkr rY)r7r,rr r9r:r;r;r<test_no_instantiations& $ & $ * * z#ProtocolTests.test_no_instantiationcCsvtGdddt}Gddd|}Gddd|}|t|Wdn1sZ0Y|||dS)Nc@s eZdZejedddZdS)z9ProtocolTests.test_cannot_instantiate_abstract..PrcSstdSr?)NotImplementedErrorrSr;r;r<amethsz?ProtocolTests.test_cannot_instantiate_abstract..P.amethN)rErFrGabcabstractmethodrYr=r;r;r;r<r, sr,c@s eZdZdS)z9ProtocolTests.test_cannot_instantiate_abstract..BNrIr;r;r;r<Bsr@c@seZdZedddZdS)z9ProtocolTests.test_cannot_instantiate_abstract..CrcSsdS)Nr;rSr;r;r<r=sz?ProtocolTests.test_cannot_instantiate_abstract..C.amethN)rErFrGrYr=r;r;r;r<rsr)rrrPrQrk)r7r,r@rr;r;r< test_cannot_instantiate_abstract s $z.ProtocolTests.test_cannot_instantiate_abstractcCsGdddt}tGddd|t}Gddd}Gddd}Gd d d }||||||||||||||||||dS) Nc@seZdZddZdS)z5ProtocolTests.test_subprotocols_extending..P1cSsdSr?r;rSr;r;r<meth1sz;ProtocolTests.test_subprotocols_extending..P1.meth1NrErFrGrCr;r;r;r<P1srEc@seZdZddZdS)z5ProtocolTests.test_subprotocols_extending..P2cSsdSr?r;rSr;r;r<meth2$sz;ProtocolTests.test_subprotocols_extending..P2.meth2NrErFrGrFr;r;r;r<P2"srHc@seZdZddZddZdS)z4ProtocolTests.test_subprotocols_extending..CcSsdSr?r;rSr;r;r<rC(sz:ProtocolTests.test_subprotocols_extending..C.meth1cSsdSr?r;rSr;r;r<rF+sz:ProtocolTests.test_subprotocols_extending..C.meth2NrErFrGrCrFr;r;r;r<r'src@seZdZddZdS)z5ProtocolTests.test_subprotocols_extending..C1cSsdSr?r;rSr;r;r<rC/sz;ProtocolTests.test_subprotocols_extending..C1.meth1NrDr;r;r;r<C1.srJc@seZdZddZdS)z5ProtocolTests.test_subprotocols_extending..C2cSsdSr?r;rSr;r;r<rF3sz;ProtocolTests.test_subprotocols_extending..C2.meth2NrGr;r;r;r<C22srKrrrr>rkr=)r7rErHrrJrKr;r;r<test_subprotocols_extendings  z)ProtocolTests.test_subprotocols_extendingcCsGdddt}Gdddt}tGddd||t}Gddd}Gd d d }Gd d d }||||||||||||||||||dS) Nc@seZdZddZdS)z3ProtocolTests.test_subprotocols_merging..P1cSsdSr?r;rSr;r;r<rC?sz9ProtocolTests.test_subprotocols_merging..P1.meth1NrDr;r;r;r<rE>srEc@seZdZddZdS)z3ProtocolTests.test_subprotocols_merging..P2cSsdSr?r;rSr;r;r<rFCsz9ProtocolTests.test_subprotocols_merging..P2.meth2NrGr;r;r;r<rHBsrHc@s eZdZdS)z2ProtocolTests.test_subprotocols_merging..PNrIr;r;r;r<r,Fsr,c@seZdZddZddZdS)z2ProtocolTests.test_subprotocols_merging..CcSsdSr?r;rSr;r;r<rCKsz8ProtocolTests.test_subprotocols_merging..C.meth1cSsdSr?r;rSr;r;r<rFNsz8ProtocolTests.test_subprotocols_merging..C.meth2NrIr;r;r;r<rJsrc@seZdZddZdS)z3ProtocolTests.test_subprotocols_merging..C1cSsdSr?r;rSr;r;r<rCRsz9ProtocolTests.test_subprotocols_merging..C1.meth1NrDr;r;r;r<rJQsrJc@seZdZddZdS)z3ProtocolTests.test_subprotocols_merging..C2cSsdSr?r;rSr;r;r<rFVsz9ProtocolTests.test_subprotocols_merging..C2.meth2NrGr;r;r;r<rKUsrKrL)r7rErHr,rrJrKr;r;r<test_subprotocols_merging=s  z'ProtocolTests.test_subprotocols_mergingcCstd}tGdddt}tGdddt|}Gdddt}Gdd d t|}Gd d d }||||||||||tt|||Wdn1s0Y|tt|||Wdn1s0Y|tt||Wdn1s&0Y|tt||Wdn1s\0Y|tt|||Wdn1s0Y|tt||tWdn1s0YdS) Nr c@seZdZddZdS)z2ProtocolTests.test_protocols_issubclass..PcSsdSr?r;rSr;r;r<rerz4ProtocolTests.test_protocols_issubclass..P.xNrErFrGrr;r;r;r<r,csr,c@seZdZddZdS)z3ProtocolTests.test_protocols_issubclass..PGcSsdSr?r;rSr;r;r<rirz5ProtocolTests.test_protocols_issubclass..PG.xNrOr;r;r;r<r9gsr9c@seZdZddZdS)z5ProtocolTests.test_protocols_issubclass..BadPcSsdSr?r;rSr;r;r<rlrz7ProtocolTests.test_protocols_issubclass..BadP.xNrOr;r;r;r<BadPksrPc@seZdZddZdS)z6ProtocolTests.test_protocols_issubclass..BadPGcSsdSr?r;rSr;r;r<rorz8ProtocolTests.test_protocols_issubclass..BadPG.xNrOr;r;r;r<BadPGnsrQc@seZdZddZdS)z2ProtocolTests.test_protocols_issubclass..CcSsdSr?r;rSr;r;r<rrrz4ProtocolTests.test_protocols_issubclass..C.xNrOr;r;r;r<rqsr)r rrr=rPrQr5rYr7r r,r9rPrQrr;r;r<test_protocols_issubclass`s.    , , * * . z'ProtocolTests.test_protocols_issubclasscCs8Gddd}tGdddt}|tt||Wdn1sL0Y||||||tt||Wdn1s0Y|||Gddd|}||||||||| ||||||tt||Wdn1s*0YdS)Nc@seZdZdZdS)z?ProtocolTests.test_protocols_issubclass_non_callable..CrNrOr;r;r;r<rsrc@seZdZdZdS)zFProtocolTests.test_protocols_issubclass_non_callable..PNonCallrNrOr;r;r;r<PNonCallsrTc@s eZdZdS)z?ProtocolTests.test_protocols_issubclass_non_callable..DNrIr;r;r;r<r-rr-) rrrPrQr5rkregisterr>rr=)r7rrTr-r;r;r<&test_protocols_issubclass_non_callables$ (  (    z4ProtocolTests.test_protocols_issubclass_non_callablecCsjtd}tGdddt}tGdddt|}Gdddt}Gdd d t|}Gd d d }|||||||t t|||Wdn1s0Y|t t|||Wdn1s0Y|tt||Wdn1s$0Y|tt||Wdn1s\0YdS) Nr c@seZdZddZdS)z2ProtocolTests.test_protocols_isinstance..PcSsdSr?r;rr;r;r<r#rz7ProtocolTests.test_protocols_isinstance..P.methNr+r;r;r;r<r,sr,c@seZdZddZdS)z3ProtocolTests.test_protocols_isinstance..PGcSsdSr?r;rr;r;r<r#rz8ProtocolTests.test_protocols_isinstance..PG.methNr+r;r;r;r<r9sr9c@seZdZddZdS)z5ProtocolTests.test_protocols_isinstance..BadPcSsdSr?r;rr;r;r<r#rz:ProtocolTests.test_protocols_isinstance..BadP.methNr+r;r;r;r<rPsrPc@seZdZddZdS)z6ProtocolTests.test_protocols_isinstance..BadPGcSsdSr?r;rr;r;r<r#rz;ProtocolTests.test_protocols_isinstance..BadPG.methNr+r;r;r;r<rQsrQc@seZdZddZdS)z2ProtocolTests.test_protocols_isinstance..CcSsdSr?r;rr;r;r<r#rz7ProtocolTests.test_protocols_isinstance..C.methNr+r;r;r;r<rsr)r rrrkrPrQrRrRr;r;r<test_protocols_isinstances$ . . , z'ProtocolTests.test_protocols_isinstancecCsGddd}Gddd}Gddd}Gddd}||d d d t||d d t|tt||d d t|tt|tt||d t||t||t||t||t|tt|td d tdS) Nc@seZdZddZdS)z.APointcSs||_||_||_dSr?rrr)r7rrrr;r;r<rszEProtocolTests.test_protocols_isinstance_py36..APoint.__init__NrErFrGrr;r;r;r<APointsrZc@seZdZdZddZdS)z.BPointr@cSs||_||_dSr?rr)r7rrr;r;r<rszEProtocolTests.test_protocols_isinstance_py36..BPoint.__init__N)rErFrGrrr;r;r;r<BPointsr\c@seZdZddZddZdS)z7ProtocolTests.test_protocols_isinstance_py36..CcSs ||_dSr?rr7rr;r;r<rsz@ProtocolTests.test_protocols_isinstance_py36..C.__init__cSsdSNrr;r"r;r;r<r#sz.C.methN)rErFrGrr#r;r;r;r<rsrc@s eZdZdS)z9ProtocolTests.test_protocols_isinstance_py36..BadNrIr;r;r;r<Badrr`rrr\rO) rkrrrrr%rr$r')r7rZr\rr`r;r;r<test_protocols_isinstance_py36s"z,ProtocolTests.test_protocols_isinstance_py36cCsftd}tGdddt}tGdddt|}Gddd}||d|||d|dS) Nr c@seZdZdZdS)z7ProtocolTests.test_protocols_isinstance_init..PrNrOr;r;r;r<r,sr,c@seZdZdZdS)z8ProtocolTests.test_protocols_isinstance_init..PGrNrOr;r;r;r<r9sr9c@seZdZddZdS)z7ProtocolTests.test_protocols_isinstance_init..CcSs ||_dSr?rr7rr;r;r<rsz@ProtocolTests.test_protocols_isinstance_init..C.__init__NrYr;r;r;r<rsrr)r rrrk)r7r r,r9rr;r;r<test_protocols_isinstance_initsz,ProtocolTests.test_protocols_isinstance_initc CsGdddtt}Gddd|t}Gddd}Gddd}|t}||||||Gd d d |t}Gd d d |t}|t}||||||dS) Nc@s eZdZdS)z=ProtocolTests.test_protocol_checks_after_subscript..PNrIr;r;r;r<r,rr,c@s eZdZdS)z=ProtocolTests.test_protocol_checks_after_subscript..CNrIr;r;r;r<rrrc@s eZdZdS)zBProtocolTests.test_protocol_checks_after_subscript..Other1NrIr;r;r;r<Other1rrdc@s eZdZdS)zBProtocolTests.test_protocol_checks_after_subscript..Other2NrIr;r;r;r<Other2rrec@s eZdZdS)z>ProtocolTests.test_protocol_checks_after_subscript..D1NrIr;r;r;r<D1rrfc@s eZdZdS)z>ProtocolTests.test_protocol_checks_after_subscript..D2NrIr;r;r;r<D2rrg)rr rrr>rYrkr=) r7r,rrdreZCArfrgCIr;r;r<$test_protocol_checks_after_subscripts z2ProtocolTests.test_protocol_checks_after_subscriptcCsvtGdddt}Gdddt}Gddd|}Gddd}||||||||||dS) Nc@seZdZdZdS)z8ProtocolTests.test_protocols_support_register..PrNrOr;r;r;r<r,sr,c@seZdZddZdS)z9ProtocolTests.test_protocols_support_register..PMcSsdSr?r;rSr;r;r<r# rz>ProtocolTests.test_protocols_support_register..PM.methNr+r;r;r;r<PM srjc@s eZdZdS)z8ProtocolTests.test_protocols_support_register..DNrIr;r;r;r<r-rr-c@s eZdZdS)z8ProtocolTests.test_protocols_support_register..CNrIr;r;r;r<rrr)rrrUrk)r7r,rjr-rr;r;r<test_protocols_support_registers  z-ProtocolTests.test_protocols_support_registercCs`tGdddt}Gddd}Gddd|}Gddd}||||||dS) Nc@seZdZdZdS)zNProtocolTests.test_none_on_non_callable_doesnt_block_implementation..PrNrOr;r;r;r<r,sr,c@seZdZdZdS)zNProtocolTests.test_none_on_non_callable_doesnt_block_implementation..ArNrOr;r;r;r<r\sr\c@seZdZdZdS)zNProtocolTests.test_none_on_non_callable_doesnt_block_implementation..BNrOr;r;r;r<r@ sr@c@seZdZddZdS)zNProtocolTests.test_none_on_non_callable_doesnt_block_implementation..CcSs d|_dSr?rrSr;r;r<r$szWProtocolTests.test_none_on_non_callable_doesnt_block_implementation..C.__init__NrYr;r;r;r<r#sr)rrrkr7r,r\r@rr;r;r<5test_none_on_non_callable_doesnt_block_implementationszCProtocolTests.test_none_on_non_callable_doesnt_block_implementationcCs`tGdddt}Gddd}Gddd|}Gddd}||||||dS) Nc@seZdZddZdS)zDProtocolTests.test_none_on_callable_blocks_implementation..PcSsdSr?r;rSr;r;r<r-rzFProtocolTests.test_none_on_callable_blocks_implementation..P.xNrOr;r;r;r<r,+sr,c@seZdZddZdS)zDProtocolTests.test_none_on_callable_blocks_implementation..AcSsdSr?r;rSr;r;r<r0rzFProtocolTests.test_none_on_callable_blocks_implementation..A.xNrOr;r;r;r<r\/sr\c@seZdZdZdS)zDProtocolTests.test_none_on_callable_blocks_implementation..BNrOr;r;r;r<r@2sr@c@seZdZddZdS)zDProtocolTests.test_none_on_callable_blocks_implementation..CcSs d|_dSr?rrSr;r;r<r6szMProtocolTests.test_none_on_callable_blocks_implementation..C.__init__NrYr;r;r;r<r5sr)rrrrlr;r;r<+test_none_on_callable_blocks_implementation*sz9ProtocolTests.test_none_on_callable_blocks_implementationcCsGdddt}tGdddt}Gddd|}Gddd|}Gd d d }Gd d d }||||||||||||||||||dS) Nc@seZdZdZdS)z5ProtocolTests.test_non_protocol_subclasses..PrNrOr;r;r;r<r,=sr,c@seZdZddZdS)z6ProtocolTests.test_non_protocol_subclasses..PRcSsdSr?r;rSr;r;r<r#Brz;ProtocolTests.test_non_protocol_subclasses..PR.methNr+r;r;r;r<PR@sroc@seZdZdZdS)z8ProtocolTests.test_non_protocol_subclasses..NonPrNrOr;r;r;r<NonPDsrpc@s eZdZdS)z9ProtocolTests.test_non_protocol_subclasses..NonPRNrIr;r;r;r<NonPRGrrqc@seZdZdZdS)z5ProtocolTests.test_non_protocol_subclasses..CrNrOr;r;r;r<rIsrc@seZdZddZdS)z5ProtocolTests.test_non_protocol_subclasses..DcSsdSr?r;rSr;r;r<r#Mrz:ProtocolTests.test_non_protocol_subclasses..D.methNr+r;r;r;r<r-Lsr-rL)r7r,rorprqrr-r;r;r<test_non_protocol_subclasses<s  z*ProtocolTests.test_non_protocol_subclassescCstGdddt}Gddd}Gddd}Gddd|}||||||||||||dS) Nc@seZdZdZdS)z1ProtocolTests.test_custom_subclasshook..PrNrOr;r;r;r<r,Wsr,c@s eZdZdS)z7ProtocolTests.test_custom_subclasshook..OKClassNrIr;r;r;r<OKClassZrrsc@seZdZdZdS)z8ProtocolTests.test_custom_subclasshook..BadClassrNrOr;r;r;r<BadClass\srtc@seZdZeddZdS)z1ProtocolTests.test_custom_subclasshook..CcSs |jdSNOK)rE startswithr8otherr;r;r<__subclasshook__`szBProtocolTests.test_custom_subclasshook..C.__subclasshook__NrErFrG classmethodrzr;r;r;r<r_sr)rrkrr=r>)r7r,rsrtrr;r;r<test_custom_subclasshookVs z&ProtocolTests.test_custom_subclasshookcCs\tGdddt}Gddd}|tt||Wdn1sN0YdS)Nc@seZdZdZdS)z8ProtocolTests.test_issubclass_fails_correctly..PrNrOr;r;r;r<r,jsr,c@s eZdZdS)z8ProtocolTests.test_issubclass_fails_correctly..CNrIr;r;r;r<rnrr)rrrPrQr5)r7r,rr;r;r<test_issubclass_fails_correctlyis  z-ProtocolTests.test_issubclass_fails_correctlycCsNtd}td}tGdddt||f}Gddd|t|ft|}|t|tWdn1sr0Y|t|ttfWdn1s0Y|t|tdfWdn1s0Y|t|ttfWdn1s0YGdd d |t|f}||t|dS) Nr Sc@seZdZddZdS)z9ProtocolTests.test_defining_generic_protocols..PRcSsdSr?r;rSr;r;r<r#yrz>ProtocolTests.test_defining_generic_protocols..PR.methNr+r;r;r;r<rowsroc@seZdZdZdS)z8ProtocolTests.test_defining_generic_protocols..PrNrErFrGrr;r;r;r<r,{sr,rc@s eZdZdS)z8ProtocolTests.test_defining_generic_protocols..CNrIr;r;r;r<rrr) r rrrYrPrQr{rrk)r7r rror,rr;r;r<test_defining_generic_protocolsss & * * ,z-ProtocolTests.test_defining_generic_protocolscstdtd}tGdddtt|f}Gddd|ttft}|t"t|ttf|Wdn1sz0Y| |||t|tWdn1s0Y|t|tdfWdn1s0YGfdd d tt}Gfd d d tt}tGd d d |tt}Gddd}| |||t|tt fWdn1s0YdS)Nr rc@seZdZddZdS)zCProtocolTests.test_defining_generic_protocols_old_style..PRcSsdSr?r;rSr;r;r<r#rzHProtocolTests.test_defining_generic_protocols_old_style..PR.methNr+r;r;r;r<rosroc@seZdZdZdS)zBProtocolTests.test_defining_generic_protocols_old_style..PrNrr;r;r;r<r,sr,rcseZdZedddZdS)zCProtocolTests.test_defining_generic_protocols_old_style..P1rrcSsdSr?r;rbr;r;r<rrzGProtocolTests.test_defining_generic_protocols_old_style..P1.barNrErFrGr{rr;r r;r<rEsrEcseZdZedddZdS)zCProtocolTests.test_defining_generic_protocols_old_style..P2rcSsdSr?r;rbr;r;r<rrzGProtocolTests.test_defining_generic_protocols_old_style..P2.barNrr;rr;r<rHsrHc@seZdZdZdS)zEProtocolTests.test_defining_generic_protocols_old_style..PSubrNrOr;r;r;r<PSubsrc@s eZdZdZeedddZdS)zEProtocolTests.test_defining_generic_protocols_old_style..TestrrcSs|Sr?r;rbr;r;r<rszIProtocolTests.test_defining_generic_protocols_old_style..Test.barN)rErFrGrr{rr;r;r;r<Testsr) r rrrrYr{rPrQr5r=rkr)r7rror,rErHrrr;rr<)test_defining_generic_protocols_old_styles( 0  & * z7ProtocolTests.test_defining_generic_protocols_old_stylecCstd}Gdddt|}Gddd||}||tjdGddd}Gd d d |||}||tjdGd d d |||}||tjddS) Nr c@s eZdZdS)z)ProtocolTests.test_init_called..PNrIr;r;r;r<r,rr,c@seZdZddZdS)z)ProtocolTests.test_init_called..CcSs d|_dSrutestrSr;r;r<rsz2ProtocolTests.test_init_called..C.__init__NrYr;r;r;r<rsrrvc@seZdZddZdS)z)ProtocolTests.test_init_called..BcSs d|_dSrurrSr;r;r<rsz2ProtocolTests.test_init_called..B.__init__NrYr;r;r;r<r@sr@c@s eZdZdS)z*ProtocolTests.test_init_called..D1NrIr;r;r;r<rfsrfc@s eZdZdS)z*ProtocolTests.test_init_called..D2NrIr;r;r;r<rgsrg)r rrVrYr)r7r r,rr@rfrgr;r;r<test_init_calledszProtocolTests.test_init_calledcCstd}Gdddt|}Gddd||}||tjd|t|tdWdn1sp0Y|t|tddWdn1s0YdS) Nr c@s eZdZdS)z(ProtocolTests.test_new_called..PNrIr;r;r;r<r,rr,cseZdZfddZZS)z(ProtocolTests.test_new_called..Ccstj|g|R}d|_|Sru)super__new__r)r8rr7 __class__r;r<rsz0ProtocolTests.test_new_called..C.__new__rErFrGr __classcell__r;r;rr<rsrrvrOr)r rrVrYrrPrQ)r7r r,rr;r;r<test_new_calleds * zProtocolTests.test_new_calledcCs$td}td}|t(Gdddt||f}Wdn1sH0Y|t$Gdddtt}Wdn1s0Y|t*Gdddt|t|}Wdn1s0Y|t0Gdddtj||ft|}Wdn1s0YdS)Nr rc@s eZdZdSz6ProtocolTests.test_protocols_bad_subscripts..PNrIr;r;r;r<r,rr,c@s eZdZdSrrIr;r;r;r<r,rc@s eZdZdSrrIr;r;r;r<r,rc@s eZdZdSrrIr;r;r;r<r,r)r rPrQrrYr@rr7r rr,r;r;r<test_protocols_bad_subscriptss 6 2 8 z+ProtocolTests.test_protocols_bad_subscriptscCsdtd}td}Gdddt||f}|t|||fd|t|ttfddS)Nr rc@s eZdZdS)z4ProtocolTests.test_generic_protocols_repr..PNrIr;r;r;r<r,rr,z P[~T, ~S]z P[int, str])r rrrWendswithrYr{rr;r;r<test_generic_protocols_reprs z)ProtocolTests.test_generic_protocols_reprcCstd}td}Gdddt||f}|||||t|f|t|f||||ft||fttf|tttftttffdS)Nr rc@s eZdZdS)z2ProtocolTests.test_generic_protocols_eq..PNrIr;r;r;r<r,rr,)r rrVrYrr{rr;r;r<test_generic_protocols_eqs "z'ProtocolTests.test_generic_protocols_eqcCshtd}Gdddt|}||j|f||tjd||tjtf||tj|dS)Nr c@s eZdZdS)zDProtocolTests.test_generic_protocols_special_from_generic..PNrIr;r;r;r<r,rr,r;)r rrVrvrYrurwrx)r7r r,r;r;r<+test_generic_protocols_special_from_generics z9ProtocolTests.test_generic_protocols_special_from_genericcCstGdddt}Gdddt}td}Gdddt|}||j||j||j||j||j||tj|t |dh|t |d h|t t |t d dhdS) Nc@seZdZdZdS)zFProtocolTests.test_generic_protocols_special_from_protocol..PRrNrOr;r;r;r<rosroc@seZdZddZdS)zEProtocolTests.test_generic_protocols_special_from_protocol..PcSsdSr?r;rSr;r;r<r# szJProtocolTests.test_generic_protocols_special_from_protocol..P.methNr+r;r;r;r<r, sr,r c@seZdZdZddZdS)zFProtocolTests.test_generic_protocols_special_from_protocol..PGrcSsdSr?r;rSr;r;r<r#szKProtocolTests.test_generic_protocols_special_from_protocol..PG.methN)rErFrGrr#r;r;r;r<r9sr9r#r) rrr r _is_protocolr_is_runtime_protocolrYrVr@_get_protocol_attrs frozenset)r7ror,r r9r;r;r<,test_generic_protocols_special_from_protocols       z:ProtocolTests.test_generic_protocols_special_from_protocolcCs|t"tGddd}Wdn1s20YGdddt}|t$tGddd|}Wdn1s0YdS)Nc@s eZdZdS)z8ProtocolTests.test_no_runtime_deco_on_nominal..CNrIr;r;r;r<r$src@seZdZdZdS)z.ProtorNrOr;r;r;r<r'src@s eZdZdS)z?ProtocolTests.test_no_runtime_deco_on_nominal..ConcreteNrIr;r;r;r<r$+sr$)rPrQrr)r7rrr$r;r;r<test_no_runtime_deco_on_nominal"s . z-ProtocolTests.test_no_runtime_deco_on_nominalcCstGdddt}Gdddt}|||Gddd}Gddd}||||||Gd d d }Gd d d }||||||dS) Nc@seZdZdZdS)z4ProtocolTests.test_none_treated_correctly..PNrOr;r;r;r<r,0sr,c@s eZdZdS)z4ProtocolTests.test_none_treated_correctly..BNrIr;r;r;r<r@4rr@c@seZdZdZdS)z4ProtocolTests.test_none_treated_correctly..CrNrOr;r;r;r<r8src@seZdZdZdS)z4ProtocolTests.test_none_treated_correctly..DNrOr;r;r;r<r-;sr-c@seZdZddZdS)z5ProtocolTests.test_none_treated_correctly..CIcSs d|_dSrrrSr;r;r<rBsz>ProtocolTests.test_none_treated_correctly..CI.__init__NrYr;r;r;r<rhAsrhc@seZdZddZdS)z5ProtocolTests.test_none_treated_correctly..DIcSs d|_dSr?rrSr;r;r<rFsz>ProtocolTests.test_none_treated_correctly..DI.__init__NrYr;r;r;r<DIEsr)rrrrrk)r7r,r@rr-rhrr;r;r<test_none_treated_correctly/sz)ProtocolTests.test_none_treated_correctlycCs@Gdddt}tjtj|f}tj|tjf}|||dS)Nc@seZdZdZdS)z1ProtocolTests.test_protocols_in_unions..PNrOr;r;r;r<r,Msr,)rr@rrrV)r7r,ZAliasZAlias2r;r;r<test_protocols_in_unionsLsz&ProtocolTests.test_protocols_in_unionsc Cstd}tGdddt|aGdddttat}d|_d|_tt j dD]}t ||}t |}| |jd| |jd| |jd| |jddd t t}t |}Gd d d }|||qTdS) Nr c@seZdZdZdS)r,rNrOr;r;r;r<r,Xsr,c@s eZdZdS)CPNrIr;r;r;r<r\srrOr>rrc@seZdZdZdS)z2ProtocolTests.test_protocols_pickleable..ErNrOr;r;r;r<r7lsr7)r rrr,rYrrrrangepickleHIGHEST_PROTOCOLdumpsloadsrVr__dict__rk) r7r rprotorrsr-r7r;r;r<test_protocols_pickleableTs$    z'ProtocolTests.test_protocols_pickleablecCs |ttj|ttjdSr?)r=rYr@ SupportsIntr>r{rSr;r;r<test_supports_intqszProtocolTests.test_supports_intcCs |ttj|ttjdSr?)r=rr@ SupportsFloatr>r{rSr;r;r<test_supports_floatusz!ProtocolTests.test_supports_floatcCs.Gddd}||tj|ttjdS)Nc@seZdZddZdS)z.ProtocolTests.test_supports_complex..CcSsdS)Nyr;rSr;r;r< __complex__}sz:ProtocolTests.test_supports_complex..C.__complex__N)rErFrGrr;r;r;r<r|sr)r=r@SupportsComplexr>r{rr;r;r<test_supports_complexysz#ProtocolTests.test_supports_complexcCs.Gddd}||tj|ttjdS)Nc@seZdZddZdS)z,ProtocolTests.test_supports_bytes..BcSsdSNrr;rSr;r;r< __bytes__sz6ProtocolTests.test_supports_bytes..B.__bytes__N)rErFrGrr;r;r;r<r@sr@)r=r@ SupportsBytesr>r{)r7r@r;r;r<test_supports_bytessz!ProtocolTests.test_supports_bytescCs.|ttj|ttj|ttjdSr?)r=rr@ SupportsAbsrYr>r{rSr;r;r<test_supports_absszProtocolTests.test_supports_abscCs:tttj|ttj|ttj|ttjdSr?)r5rr@ SupportsRoundr=rYr>r{rSr;r;r<test_supports_rounds z!ProtocolTests.test_supports_roundcCs |ttj|ttjdSr?)r=rr@ Reversibler>rYrSr;r;r<test_reversibleszProtocolTests.test_reversiblecCs |ttj|ttjdSr?)r=rYr@ SupportsIndexr>r{rSr;r;r<test_supports_indexsz!ProtocolTests.test_supports_indexcCsF|dtjGdddtj}Gddd|}|}|||dS)Nrc@seZdZedddZdS)z>ProtocolTests.test_bundled_protocol_instance_works..C1rcSsdSrNr;rSr;r;r<__int__szFProtocolTests.test_bundled_protocol_instance_works..C1.__int__N)rErFrGrYrr;r;r;r<rJsrJc@s eZdZdS)z>ProtocolTests.test_bundled_protocol_instance_works..C2NrIr;r;r;r<rKsrK)rkr@rr)r7rJrKrr;r;r<$test_bundled_protocol_instance_workss z2ProtocolTests.test_bundled_protocol_instance_workscCsRtGdddtjjt}Gddd}Gddd}||||||dS)Nc@seZdZddZdS)z@ProtocolTests.test_collections_protocols_allowed..CustomcSsdSr?r;rSr;r;r<closerzFProtocolTests.test_collections_protocols_allowed..Custom.closeN)rErFrGrr;r;r;r<Customsrc@s eZdZdS)z;ProtocolTests.test_collections_protocols_allowed..ANrIr;r;r;r<r\rr\c@seZdZddZddZdS)z;ProtocolTests.test_collections_protocols_allowed..BcSsgSr?r;rSr;r;r<__iter__szDProtocolTests.test_collections_protocols_allowed..B.__iter__cSsdSr_r;rSr;r;r<rszAProtocolTests.test_collections_protocols_allowed..B.closeN)rErFrGrrr;r;r;r<r@sr@)r collectionsr>rrr=r>)r7rr\r@r;r;r<"test_collections_protocols_alloweds  z0ProtocolTests.test_collections_protocols_allowedcCsT|t"Gdddtt}Wdn1s20YGdddtjt}dS)Nc@s eZdZdS)zEProtocolTests.test_builtin_protocol_whitelist..CustomProtocolNrIr;r;r;r<CustomProtocolsrc@s eZdZdS)zKProtocolTests.test_builtin_protocol_whitelist..CustomContextManagerNrIr;r;r;r<CustomContextManagersr)rPrQrrr@ContextManager)r7rrr;r;r<test_builtin_protocol_whitelists 0z-ProtocolTests.test_builtin_protocol_whitelistcCs*Gdddt}Gddd|}|dS)Nc@seZdZUeed<dS)z-ProtocolTests.test_super_call_init..PrNrr;r;r;r<r,s r,cseZdZfddZZS)z/ProtocolTests.test_super_call_init..FoocstdSr?)rrrSrr;r<rsz8ProtocolTests.test_super_call_init..Foo.__init__rErFrGrrr;r;rr<rsr)r)r7r,rr;r;r<test_super_call_initsz"ProtocolTests.test_super_call_initN)0rErFrGr0r3r4r8r;rBrMrNrSrVrWrarcrirkrmrnrrr}r~rrrrrrrrrrrrrrrrrrrrrrrrrr;r;r;r<r*sZ #%% '        r*c@seZdZddZddZddZddZd d Zd d Zd dZ ddZ ddZ ddZ ddZ ddZddZddZddZdd Zd!d"Zd#d$Zd%d&Zd'd(Zd)d*Zd+d,Zd-d.Zd/d0Zd1d2Zd3d4Zd5d6Zd7d8Zd9d:Zd;d<Z d=d>Z!d?d@Z"dAdBZ#dCdDZ$dEdFZ%dGdHZ&dIdJZ'dKdLZ(dMdNZ)dOdPZ*dQdRZ+dSdTZ,dUdVZ-dWdXZ.dYdZZ/d[d\Z0d]d^Z1d_d`Z2daS)b GenericTestscCs0tttf}||jd|t|tWdn1sB0Y|t|ttfWdn1sx0Ytttf}||jtf|t|t|ttfWdn1s0Ytttf}|tt |tWdn1s0Y| |tdSr) rr{rrVrvrPrQrrYr5rk)r7rprsZSM1r;r;r<rs  & *  *  *zGenericTests.test_basicscCstd}td}|tt||Wdn1s<0Y|tt||Wdn1sr0Y|t*Gdddt|t|}Wdn1s0Y|ttgttWdn1s0Y|tttttWdn1s(0Y|t Gdddt}Wdn1sd0Y|t*Gdddt|t|}Wdn1s0Y|t*Gd ddt|t|}Wdn1s0YdS) Nr rc@s eZdZdS)z+GenericTests.test_generic_errors..CNrIr;r;r;r<rrrc@s eZdZdS)z4GenericTests.test_generic_errors..NewGenericNrIr;r;r;r< NewGenericrrc@s eZdZdSz3GenericTests.test_generic_errors..MyGenericNrIr;r;r;r< MyGenericrrc@s eZdZdSrrIr;r;r;r<rr) r rPrQrrRrrYr5r)r7r rrrrr;r;r<test_generic_errorss$ * * 8 , . 0 : z GenericTests.test_generic_errorscCstd}td}|tt||fWdn1s<0Y|tt|||fWdn1st0YdS)Nr r)r rPrQr)r7r rr;r;r< test_inits  * zGenericTests.test_initcCsGdddtjt}Gddd|}||jd|t|jWdn1sZ0Yd|_d|_Gdd d |}Gd d d |t}||jd||jd||jddS) NcseZdZfddZZS)z*GenericTests.test_init_subclass..Xcstjfi|d|_dSrN)r__init_subclass__r)r8kwargsrr;r<rsz.X.__init_subclass__rErFrGrrr;r;rr<rpsrpc@s eZdZdS)z*GenericTests.test_init_subclass..YNrIr;r;r;r<rssrsrOrrc@s eZdZdS)z*GenericTests.test_init_subclass..ZNrIr;r;r;r<Zsrc@s eZdZdS)z*GenericTests.test_init_subclass..WNrIr;r;r;r<W sr)r@rr rVrrPAttributeErrorrY)r7rprsrrr;r;r<test_init_subclasss $zGenericTests.test_init_subclasscCs4|ttdtd|ttdtddS)Nzz.MySimpleMapping'>)rVrWrrErrSr;r;r<rXs     zGenericTests.test_reprcCstd}td}Gdddt|}|t||f}|||t||f|||t||f||tf}||||tf||||tf||||tf|t}|||t|||t|||||t|ddS)Nr rc@s eZdZdS)z'GenericTests.test_chain_repr..CNrIr;r;r;r<rsrz.C[typing.Tuple[str, int]]) r rrrVrtrYr{rr)r7r rrrprsrr;r;r<test_chain_reprs"  zGenericTests.test_chain_reprcCstd}tddd}td}|ttd|tt|d|tt|d|tt||td |tttd dS) Nr UTrrz typing.Listztyping.List[~T]ztyping.List[+U]ztyping.List[int])r rVrWrrY)r7r rrr;r;r< test_new_repr-s zGenericTests.test_new_reprcCs~td}td}|ttj||f||fd|ttt||ft|fd|ttt||fttddS)Nr TSztyping.Mapping[~TS, ~T]z"typing.List[typing.Tuple[int, ~T]]z=typing.List[typing.Tuple[typing.List[int], typing.List[int]]])r rVrWr@rrrrY)r7r rr;r;r<test_new_repr_complex8s"z"GenericTests.test_new_repr_complexcCsZtd}|tt|d|ttj|dGdddtjttf}t|jdS)Nr ztyping.Generic[~T]ztyping.Protocol[~T]c@s eZdZdS)z*GenericTests.test_new_repr_bare..CNrIr;r;r;r<rHrr) r rVrWrr@rrr__mro__r7r rr;r;r<test_new_repr_bareDs zGenericTests.test_new_repr_barecCsptd}Gdddt|}|}d|_||jddiGddd|t}|}d|_||jd didS) Nr c@s eZdZdS)z!GenericTests.test_dict..BNrIr;r;r;r<r@Osr@rOrc@s eZdZdS)z!GenericTests.test_dict..CNrIr;r;r;r<rVsrr>r)r rrrVrrYr)r7r r@brrr;r;r< test_dictLszGenericTests.test_dictcCsTtd}Gdddt|}||tjd|||tjdd||t_||jd||tjdd|tt_||jd||ttjd||jd||ttjdGddd||}||tjd||jdd |_d |t_||jd||tjd||jd ||tjd dS) Nr c@seZdZdZdS)z.CdefNrOr;r;r;r<r_srrchangednewc@s eZdZdS)z.DNrIr;r;r;r<r-msr-zfrom derived zzfrom derived x) r rrVrYrr{rrrr7r rr-r;r;r<$test_subscripted_generics_as_proxies]s* z1GenericTests.test_subscripted_generics_as_proxiescCs`td}Gdddtjjt|}|t|d||t|d||| dS)Nr c@s eZdZdS)z.GenericTests.test_abc_registry_kept..CNrIr;r;r;r<rzrrr) r rr>rrrUrYrk_abc_registry_clear_abc_caches_clearrr;r;r<test_abc_registry_keptxs   z#GenericTests.test_abc_registry_keptcCs4Gdddtttf}|i||t|dS)Nc@s eZdZdS)z5GenericTests.test_false_subclasses..MyMappingNrIr;r;r;r< MyMappingrr)rr{rr>r)r7rr;r;r<test_false_subclassess z"GenericTests.test_false_subclassescCs`Gdddtttf}|||tjj||t||t|i|dS)Nc@s4eZdZddZddZddZddZd d Zd S) z'GenericTests.test_abc_bases..MMcSsdSr?r;r7kr;r;r<rsz3GenericTests.test_abc_bases..MM.__getitem__cSsdSr?r;r7rrr;r;r<r sz3GenericTests.test_abc_bases..MM.__setitem__cSsdSr?r;rr;r;r< __delitem__sz3GenericTests.test_abc_bases..MM.__delitem__cSstdSriterrSr;r;r<rsz0GenericTests.test_abc_bases..MM.__iter__cSsdSr_r;rSr;r;r<__len__sz/GenericTests.test_abc_bases..MM.__len__NrErFrGrr rrrr;r;r;r<MMs r)rr{updaterkrr>rr)r7rr;r;r<test_abc_basess  zGenericTests.test_abc_basescCsVGdddtttftjj}Gdddtjjtttf}||jtjjtfdS)Nc@s eZdZdS)z-GenericTests.test_multiple_bases..MM1NrIr;r;r;r<MM1src@s eZdZdS)z-GenericTests.test_multiple_bases..MM2NrIr;r;r;r<MM2sr)rr{rr>rV __bases__r)r7rrr;r;r<test_multiple_basessz GenericTests.test_multiple_basescCs@td}Gdddtjt|f}||jtjt|ffdS)Nr c@s eZdZdS)z'GenericTests.test_orig_bases..CNrIr;r;r;r<rrr)r r@rr{rV__orig_bases__rr;r;r<test_orig_basesszGenericTests.test_orig_basescCsrdd}||dditjttf||dditjttf|t(|dditjttfWdn1s|0Ydd}Gdddt t}|||t|t|||t|t|||tt |t"|gd |tWdn1s 0Yd d }Gd d d t t}||gd |||ddg|dS)NcsBt|jdkrt|jr>|j\tfdd|DSdS)Nrc3s&|]\}}t|ot|VqdSr?)rR.0rrr rr;r< szSGenericTests.test_naive_runtime_checks..naive_dict_check..)rrvr<ruallitemsobjtpr;rr<naive_dict_checks z@GenericTests.test_naive_runtime_checks..naive_dict_checkrrcSst|dst|j|kS)N__orig_class__)hasattrr<rrr;r;r<naive_generic_checks zCGenericTests.test_naive_runtime_checks..naive_generic_checkc@s eZdZdS)z4GenericTests.test_naive_runtime_checks..NodeNrIr;r;r;r<Noderr rcstfdd|DS)Nc3s$|]}t|jdjdVqdS)rN)rRrru)rrrr;r<rszXGenericTests.test_naive_runtime_checks..naive_list_base_check..)rrr;r r<naive_list_base_checks zEGenericTests.test_naive_runtime_checks..naive_list_base_checkc@s eZdZdS)z1GenericTests.test_naive_runtime_checks..CNrIr;r;r;r<rrrrr) rr@rr{rYrrPr<r rr)r7rr r r rr;r;r<test_naive_runtime_checkss   6 2z&GenericTests.test_naive_runtime_checkscCs"td}td}td}Gdddt|||}Gddd|t|||}||j|f||j|f||tjd||tjd||tjtf||tjtf||jttf||j|ttf||j t|||f||j |t|||fdS) Nr rrc@s eZdZdS)z.GenericTests.test_multi_subscr_base..CNrIr;r;r;r<rrrc@s eZdZdS)z.GenericTests.test_multi_subscr_base..DNrIr;r;r;r<r-rr-r;) r rrVrvrYrurrrr)r7r rrrr-r;r;r<test_multi_subscr_basesz#GenericTests.test_multi_subscr_basecCsjtd}Gdddt}|t|t||t|tf|t|tf|td|fjt|fdS)Nr c@s eZdZdS)z.GenericTests.test_subscript_meta..MetaNrIr;r;r;r<Metarr.) r r^rVr$rrYrruEllipsis)r7r rr;r;r<test_subscript_metas  z GenericTests.test_subscript_metacCsGdddtt}Gdddtt}||||tjttjt||j|j|tjj|jttjj|jt|||j||tj||tjj||jtj||jtjj||t|jt||tt |jtt ||ttjt||ttjjt||jt tjt ||jtt tjjtt |t |tt |jt|t |tt t |jtt |t t|tft ttjtf|t |t|tft |ttjtf|t j|tt jtjjttjdddkr|tt |td|tt |jtd|tt tjtd |tt tjjtd dS) Nc@s eZdZdS)z+GenericTests.test_generic_hashes..ANrIr;r;r;r<r\sr\c@s eZdZGdddeeZdS)z+GenericTests.test_generic_hashes..Bc@s eZdZdS)z-GenericTests.test_generic_hashes..B.ANrIr;r;r;r<r\sr\N)rErFrGrr r\r;r;r;r<r@sr@r)rrz.A[str]]z.B.A[str]]zmod_generics_cache.A[str]]zmod_generics_cache.B.A[str]])rr rVr0r\r{r@rtrrrYrrr@ FrozenSetsys version_inforrWrr7r\r@r;r;r<test_generic_hashessJ "&&z GenericTests.test_generic_hashescCsntd}td}|t||fttttf|tjt||f|tjt||f|t t|tfdWdn1s0Y|t$t||f|dfWdn1s0Y|t|tftt|t||ftttt ffttt fGddd}Gddd|}|t||ft||ft||f|t t|tfd Wdn1s0Y|t |g|ft t t gt f|t dt |ftt dt tf|t&t |g|fdtfWdn1s0Y|t&t |g|fgtfWdn1s`0YdS) Nr rr;.c@s eZdZdS)z9GenericTests.test_extended_generic_rules_eq..BaseNrIr;r;r;r<Baserrc@s eZdZdS)z.DerivedNrIr;r;r;r<Derivedrrr) r rVrrYr@rrPrQrr{rr r)r7r rrrr;r;r<test_extended_generic_rules_eq s* , . 2,( 0$( 6 z+GenericTests.test_extended_generic_rules_eqcCstd}|ttttfddd|tttttfddd|ttdt|ftddd|ttgt |ftddddS) Nr ztyping.zUnion[Tuple, Callable]zUnion[Tuple, Tuple[int]].zCallable[..., Optional[int]]zCallable[[], List[int]]) r rVrWrrrreplacerYrrrlr;r;r< test_extended_generic_rules_repr&s""z-GenericTests.test_extended_generic_rules_reprc Csttdddd}tttdddd}Gddd}|t|ttdtt|i|t|ttdtt|itd }t|d f}|dd d }| t|ttd|t d t|f}|dd d}| t|ttd|dS)NCCrcSsdSr?r;rr;r;r<foobar2rz5GenericTests.test_generic_forward_ref..foobarcSsdSr?r;rr;r;r<foobar23rz6GenericTests.test_generic_forward_ref..foobar2c@s eZdZdS)z1GenericTests.test_generic_forward_ref..CCNrIr;r;r;r<r4rrr .cSsdSr?r;rr;r;r<barfoo@rz5GenericTests.test_generic_forward_ref..barfoocSsdSr?r;rr;r;r<barfoo2Crz6GenericTests.test_generic_forward_ref..barfoo2) rrr/rVrrrr rrwr) r7rr rr ATr!ZCTr"r;r;r<test_generic_forward_ref1s$ z%GenericTests.test_generic_forward_refcCsGdddtttf}Gdddttdf}Gdddttgtf}Gdd d tdtf}||jttf||ttfjttf||ttfj |||jtf|t |t d d d ||jd | |t jj||t jj||t jj| |t||t|t$tttdftjWdn1sb0Y|t$tttdftjWdn1s0YdS)Nc@s eZdZdS)z@GenericTests.test_extended_generic_rules_subclassing..T1NrIr;r;r;r<T1Grr%c@s eZdZdS)z@GenericTests.test_extended_generic_rules_subclassing..T2NrIr;r;r;r<T2Hrr&.c@s eZdZdS)z@GenericTests.test_extended_generic_rules_subclassing..C1NrIr;r;r;r<rJIrrJc@seZdZddZdS)z@GenericTests.test_extended_generic_rules_subclassing..C2cSsdSr?r;rSr;r;r<r)KszIGenericTests.test_extended_generic_rules_subclassing..C2.__call__NrErFrGr)r;r;r;r<rKJsrK.zC1[int]r;)rr r rrYrVrvr{rurxrWsplitrkrr>r=rrPrQr5r@Sequencer)r7r%r&rJrKr;r;r<'test_extended_generic_rules_subclassingFs&  4 z4GenericTests.test_extended_generic_rules_subclassingcCs|tttWdn1s(0Y|tttWdn1sZ0Y|tttWdn1s0Y|ttttWdn1s0YdSr?)rPrQrrrrrrYrSr;r;r<test_fail_with_bare_uniones & & & z&GenericTests.test_fail_with_bare_unioncCstd}|tttWdn1s00Y|ttt|Wdn1sf0Y|tttjWdn1s0YdSrj)r rPrQrrrr@rrlr;r;r<test_fail_with_bare_genericos & * z(GenericTests.test_fail_with_bare_genericcCsztd}|Gdddt||f}||tj|||tj|tGdddtd|f}|||j||||j||Gdddt j ||f}||tj|||tj|tGd d d t j t |f}||tj|||tj|tt jd krvGd d d t jt |f}||tj|||tj|tdS)Nr c@s eZdZdS)z5GenericTests.test_type_erasure_special..MyTupNrIr;r;r;r<MyTup|rr/c@seZdZddZdS)z6GenericTests.test_type_erasure_special..MyCallcSsdSr?r;rSr;r;r<r)rz?GenericTests.test_type_erasure_special..MyCall.__call__Nr'r;r;r;r<MyCallsr0.c@s eZdZdS)z6GenericTests.test_type_erasure_special..MyDictNrIr;r;r;r<MyDictrr1c@s eZdZdS)z5GenericTests.test_type_erasure_special..MyDefNrIr;r;r;r<MyDefrr2rrc@s eZdZdS)z7GenericTests.test_type_erasure_special..MyChainNrIr;r;r;r<MyChainrr4)r rDrrwrYrrVrrr@r DefaultDictr{rrChainMap)r7r r/r0r1r2r4r;r;r<test_type_erasure_specialxs$ z&GenericTests.test_type_erasure_specialcCsddtjD}|D]}|t|d|||t|ddrbt|jdkrb||tj tft |t r|j D] }|t|d|||qrqdS)Ncss|]}tt|VqdSr?)getattrr@)relr;r;r<rrz4GenericTests.test_all_repr_eq_any..rrvr) r@__all__rtrWrVr8rrvrrurRr^r)r7Zobjsrbaser;r;r<test_all_repr_eq_anys   z!GenericTests.test_all_repr_eq_anyc Cstd}Gdddt|}Gddd|tat}d|_d|_ttjdD]J}t ||}t |}| |jd| |jd| |j ddd qPt tttttttfttttd fttgtftjtjtg }|D]:}ttjdD]&}t ||}t |}| ||qqttjtjtttjtjtjtttfg} | D]>}ttjdD](}t ||}t |}| ||q`qNdS) Nr c@s eZdZdS)z#GenericTests.test_pickle..BNrIr;r;r;r<r@sr@c@s eZdZdS)rNrIr;r;r;r<rsrrOr>rr.)r rrYrrrrrrrrrVrrrrrrr{rr|r@r5rrr$r AbstractSet) r7r r@rrrrsamplesrZ more_samplesr;r;r< test_pickles:   &     zGenericTests.test_picklecCstd}Gdddt|}t|tft|tftd|fttgtftttf|||t|ttj|tjttjttj tt ftj |tft tt t |tdtdtft dtj dtfg}|tgD]$}||t|||t|qdS)Nr c@s eZdZdS)z1GenericTests.test_copy_and_deepcopy..NodeNrIr;r;r;r<r rr .)r r )r rrrYrrrr@rrr{rrrrVrr)r7r r thingsrr;r;r<test_copy_and_deepcopys*$"z#GenericTests.test_copy_and_deepcopyc Cstdatdtdatdttatttttj t tj t t ttf D]<}|t|||t|||tt||q>td}tdtd}tdtt}|||fD]$}|t|||t||qdS)NrTPBrTPVTLTLBTLV)r rrYrBr|r{rCrr@rrrrrrrrwrrrrr)r7rprDrErFr;r;r<$test_immutability_by_copy_and_pickles    z1GenericTests.test_immutability_by_copy_and_picklecs&tdGfdddt}|d}|t|jd|t|jd|t|||t||d|_|t|jd|t|jd|td}|t|jd|t|jd|t|||t||d|_|t|jd|t|jd||j|tdS)Nr cseZdZddddZdS)z3GenericTests.test_copy_generic_instances..CN)rrcSs ||_dSr?r]r^r;r;r<rsz.C.__init__rYr;rr;r<rsrrOr) r rrVrrr assertIsNotrYr)r7rrZcir;rr<test_copy_generic_instancess& z(GenericTests.test_copy_generic_instancesc Csvtd}tt|tftd|ftttfttttj tt ftj j t tjdg}|D]}|t||qXdS)Nr .whatever)r rrrYrrrrr@rr{rer-r|rrVweakrefref)r7r r@rr;r;r<test_weakref_alls zGenericTests.test_weakref_allcCstd}Gdddt|}|}|t}d|_d|_|td|_Wdn1s^0Y|td|_Wdn1s0Y|dddd}|t|t t d|||t |tt |tdS) Nr c@seZdZdZdS)z0GenericTests.test_parameterized_slots..C)potatoNrErFrG __slots__r;r;r;r<rsrrrcSsdSr?r;rr;r;r<r rz2GenericTests.test_parameterized_slots..foor) r rrYrOrPrZtomatorVrrrrr)r7r rrZc_intrr;r;r<test_parameterized_slotss  $ $ z%GenericTests.test_parameterized_slotscCstd}Gdddt|}|}|t}d|_d|_|td|_Wdn1s^0Y|td|_Wdn1s0YdS)Nr c@seZdZddiZdS)z5GenericTests.test_parameterized_slots_dict..DbananarONrPr;r;r;r<r-sr-Zyesno)r rrYrSrPrr)r7r r-dZd_intr;r;r<test_parameterized_slots_dicts  $ z*GenericTests.test_parameterized_slots_dictcCsN|t0tttf}Gdddt|}Wdn1s@0YdS)Nc@s eZdZdS)z#GenericTests.test_errors..CNrIr;r;r;r<r$sr)rPrQrrrr)r7r@rr;r;r<rZ s  zGenericTests.test_errorscCsGdddtt}||jt||jd|t}||jt|t|dddGddd|t}||jt||jd dS) Nc@s eZdZdS)#GenericTests.test_repr_2..CNrIr;r;r;r<r(srrWr(r)zC[int]c@s eZdZdS)#GenericTests.test_repr_2..YNrIr;r;r;r<rs2srsrX) rr rVrFrErGrYrWr*)r7rrprsr;r;r< test_repr_2'szGenericTests.test_repr_2cCs8|tt|tttt|ttttdSr?)rVrr rtr rrSr;r;r< test_eq_19s zGenericTests.test_eq_1cCslGdddtt}Gdddtt}||||||||t|t||t|tdS)Nc@s eZdZdS)z!GenericTests.test_eq_2..ANrIr;r;r;r<r\@sr\c@s eZdZdS)z!GenericTests.test_eq_2..BNrIr;r;r;r<r@Csr@)rr rVrtrr;r;r< test_eq_2>s   zGenericTests.test_eq_2cCsvGdddtttf}Gdddtttf}Gddd|ttfttttf|ttf}||jtttfdS)Nc@s eZdZdS)z1GenericTests.test_multiple_inheritance..ANrIr;r;r;r<r\Msr\c@s eZdZdS)z1GenericTests.test_multiple_inheritance..BNrIr;r;r;r<r@Psr@c@s eZdZdS)z1GenericTests.test_multiple_inheritance..CNrIr;r;r;r<rSsr)rr rr rVrv)r7r\r@rr;r;r<test_multiple_inheritanceKs.z&GenericTests.test_multiple_inheritancecCsNtd}Gdddt|}Gdddtt|}||j|t|ttfdS)Nrc@s eZdZdS)z9GenericTests.test_multiple_inheritance_special..BNrIr;r;r;r<r@Zrr@c@s eZdZdS)z9GenericTests.test_multiple_inheritance_special..CNrIr;r;r;r<r[rr)r rrrYrVrrr)r7rr@rr;r;r<!test_multiple_inheritance_specialXsz.GenericTests.test_multiple_inheritance_specialcsGdddtGfdddGdddtt}| Gddd|}Wdn1sj0Y|$Gd dd|t}Wdn1s0YdS) Nc@s eZdZdS)zDGenericTests.test_init_subclass_super_called..FinalExceptionNrIr;r;r;r<FinalException_sr^cs&eZdZddfdd ZZS)z;GenericTests.test_init_subclass_super_called..FinalNrcs<|jD]}|urt|r|qtjfi|dSr?)rr5rr)r8rr;)rr^rr;r<rcs  zMGenericTests.test_init_subclass_super_called..Final.__init_subclass__rr;rr^rr<rbsrc@s eZdZdS)z:GenericTests.test_init_subclass_super_called..TestNrIr;r;r;r<rhsrc@s eZdZdSz>GenericTests.test_init_subclass_super_called..SubclassNrIr;r;r;r<Subclassksrac@s eZdZdSr`rIr;r;r;r<rans) Exceptionrr rPrY)r7rrar;r_r<test_init_subclass_super_called^s . z,GenericTests.test_init_subclass_super_calledcCsrt}Gddd|t}|tjt}Gddd|}|}|g|d|d||ddgdS)Nc@s4eZdZdZedddZddZeddd ZdS) z)GenericTests.test_nested..VisitorNrcSs ||_dSr?rr7rr;r;r<setysz-GenericTests.test_nested..Visitor.setcSs|jSr?rrSr;r;r<r |sz-GenericTests.test_nested..Visitor.getrcSs|jSr?rrSr;r;r<visitsz/GenericTests.test_nested..Visitor.visit)rErFrGrr rer rfr;r;r;r<Visitorusrgc@seZdZedddZdS)z0GenericTests.test_nested..IntListVisitorrcSs|j|dSr?)rappendrbr;r;r<rhsz7GenericTests.test_nested..IntListVisitor.appendN)rErFrGrYrhr;r;r;r<IntListVisitorsrirrO) rr r@rrYrerhrVr )r7Grgrrirr;r;r< test_nestedqs    zGenericTests.test_nestedcsBtdGfdddtdfdd }|ddS)Nr cs eZdZddddddZdS)z,GenericTests.test_type_erasure..NodeNNode[T]rleftrightcSs||_||_||_dSr?rm)r7rrnror;r;r<rsz5GenericTests.test_type_erasure..Node.__init__)NNrYr;rr;r<r s r rcs~|}|}t|}t|t|t||j||j||j|dSr?)rrwr^rVr)rrrrr r r7r;r<rs  z+GenericTests.test_type_erasure..foorO)r rrr;rpr<test_type_erasures zGenericTests.test_type_erasurecCstd}Gdddt|}Gddd|}||jd|t|tWdn1sb0Y|t|tWdn1s0Y|t||Wdn1s0YdS)Nr c@s eZdZdS)z)GenericTests.test_implicit_any..CNrIr;r;r;r<rsrc@s eZdZdS)z)GenericTests.test_implicit_any..DNrIr;r;r;r<r-sr-r;)r rrVrvrPrbrYrrr;r;r<test_implicit_anys & & zGenericTests.test_implicit_anycCsNGdddtt}Gddd}Gddd||}|d}||jddS)Nc@s eZdZdS)z*GenericTests.test_new_with_args..ANrIr;r;r;r<r\sr\cseZdZfddZZS)z*GenericTests.test_new_with_args..Bcst|}||_|Sr?)rrr!r8r!rrr;r<rs z2GenericTests.test_new_with_args..B.__new__rr;r;rr<r@sr@c@s eZdZdS)z*GenericTests.test_new_with_args..CNrIr;r;r;r<rsrr)rr rVr!r7r\r@rrr;r;r<test_new_with_argss zGenericTests.test_new_with_argscCsLGddd}Gdddtt|}|d}||jd||jddS)NcseZdZfddZZS)z+GenericTests.test_new_with_args2..Acs||_tdSr?)from_arrr"rr;r<rsz4GenericTests.test_new_with_args2..A.__init__rr;r;rr<r\sr\cseZdZfddZZS)z+GenericTests.test_new_with_args2..Ccs||_t|dSr?)from_crrr"rr;r<rsz4GenericTests.test_new_with_args2..C.__init__rr;r;rr<rsrr)rr rVrvrw)r7r\rrr;r;r<test_new_with_args2s z GenericTests.test_new_with_args2cCsGdddtt}|t|dWdn1s<0YGddd}Gddd||}|d}||jd||jd||jd dS) Nc@s eZdZdS)z(GenericTests.test_new_no_args..ANrIr;r;r;r<r\sr\rcseZdZfddZZS)z(GenericTests.test_new_no_args..Bcst|}d|_|S)Nr)rrfrom_b)r8rrr;r<rs z0GenericTests.test_new_no_args..B.__new__rr;r;rr<r@sr@cs$eZdZddZfddZZS)z(GenericTests.test_new_no_args..CcSs ||_dSr?)r!r"r;r;r<rsz1GenericTests.test_new_no_args..C.__init__cst|}d|_|S)Nr)rrrwrsrr;r<rs z0GenericTests.test_new_no_args..C.__new__)rErFrGrrrr;r;rr<rsrrr)rr rPrQrVr!ryrwrtr;r;r<test_new_no_argss & zGenericTests.test_new_no_argsN)3rErFrGrrrrrXrrrrrrrrrrrrrrrrrr$r,r-r.r7r<r?rArGrIrNrRrVrZrYrZr[r\r]rcrkrqrrrurxrzr;r;r;r<rs`   $+    #   rc@s4eZdZddZddZddZddZd d Zd S) ClassVarTestscCs|ttdWdn1s(0Y|ttttfWdn1s^0Y|ttttWdn1s0YdSr)rPrQrrYr{rSr;r;r<r s  & * zClassVarTests.test_basicscCsH|ttdtt}|t|dtt}|t|dtdS)Nztyping.ClassVartyping.ClassVar[int]ztyping.ClassVar[%s.Employee])rVrWrrYrHrEr7Zcvr;r;r<rX s zClassVarTests.test_reprcCs|t$Gdddtt}Wdn1s40Y|t(Gdddttt}Wdn1sv0YdS)Nc@s eZdZdSz-ClassVarTests.test_cannot_subclass..CNrIr;r;r;r<r src@s eZdZdSr~rIr;r;r;r<r s)rPrQr^rrYrr;r;r<r` s 2 z"ClassVarTests.test_cannot_subclasscCs|ttWdn1s&0Y|tttWdn1sZ0Y|t"ttttWdn1s0YdSr?)rPrQrr^rrYrSr;r;r<r s  $ ( zClassVarTests.test_cannot_initcCsp|ttdttWdn1s.0Y|ttttWdn1sb0YdSr)rPrQrRrrYr5rSr;r;r<test_no_isinstance s , z ClassVarTests.test_no_isinstanceN)rErFrGrrXr`rrr;r;r;r<r{s r{c@s<eZdZddZddZddZddZd d Zd d Zd S) FinalTestscCstt|ttdWdn1s00Y|ttttfWdn1sf0Y|ttttWdn1s0Y|ttttWdn1s0YdSr)rrYrPrQr{rrSr;r;r<r) s & * * zFinalTests.test_basicscCsd|ttdtt}|t|dtt}|t|dtttt}|t|ddS)Nz typing.Finalztyping.Final[int]ztyping.Final[%s.Employee]ztyping.Final[tuple[int]])rVrWrrYrHrErr}r;r;r<rX4 s zFinalTests.test_reprcCs|t$Gdddtt}Wdn1s40Y|t(Gdddttt}Wdn1sv0YdS)Nc@s eZdZdSz*FinalTests.test_cannot_subclass..CNrIr;r;r;r<r? src@s eZdZdSrrIr;r;r;r<rB s)rPrQr^rrYrr;r;r<r`= s 2 zFinalTests.test_cannot_subclasscCs|ttWdn1s&0Y|tttWdn1sZ0Y|t"ttttWdn1s0YdSr?)rPrQrr^rrYrSr;r;r<rE s  $ ( zFinalTests.test_cannot_initcCsp|ttdttWdn1s.0Y|ttttWdn1sb0YdSr)rPrQrRrrYr5rSr;r;r<rM s , zFinalTests.test_no_isinstancecCsdd}||t|dS)NcSsdSr?r;rr;r;r<funcT rz.FinalTests.test_final_unmodified..func)rwr)r7rr;r;r<test_final_unmodifiedS sz FinalTests.test_final_unmodifiedN) rErFrGrrXr`rrrr;r;r;r<r' s   rc@seZdZddZddZdS) CastTestscCs|ttdd|ttdd|tttdt|ttdd|ttdd|ttt tfdd|tt dd|tddddSrN) rVrrYrrwr^rrrr{r rSr;r;r<rZ szCastTests.test_basicscCstddtdddS)NrOZhello)rrSr;r;r<rZd s zCastTests.test_errorsN)rErFrGrrZr;r;r;r<rX s rc@seZdZddZddZddZddZd d Zd d Zd dZ ddZ ddZ ddZ ddZ ddZddZddZddZdd Zd!d"Zd#d$Zd%d&Zd'd(Zd)d*Zd+d,Zd-d.Zd/d0Zd1d2Zd3d4Zd5d6Zd7d8Zd9d:Zd;S)<ForwardRefTestscCsGdddtt}|t}t|jtt}||dt|t||dt|t||d|d||dtt| d|t|j tt}||dt|tt|j tt}||dt|tdS)Nc@sPeZdZedddZdddeddd Zedd d d Zddd d dZ dS)z)ForwardRefTests.test_basics..Node)rcSs||_d|_|_dSr?rm)r7rr;r;r<rp sz2ForwardRefTests.test_basics..Node.__init__NzOptional[Node[T]]rl)rnrostuffcSs||_||_dSr?)rnro)r7rnrorblahr;r;r<add_botht sz2ForwardRefTests.test_basics..Node.add_both)nodecSs||ddSr?rr7rr;r;r<add_left| sz2ForwardRefTests.test_basics..Node.add_leftcSs|d|dSr?rrr;r;r< add_right sz3ForwardRefTests.test_basics..Node.add_right)NNN)N) rErFrGr rrYrrrrr;r;r;r<r n s r rnrorrr) rr rYrrrrrVr assertNotInrr)r7r rZ both_hintsZ left_hintsZ right_hintsr;r;r<rl s zForwardRefTests.test_basicscCsBtd}|ttd|Wdn1s40YdS)NrYrO)r@r/rPrQrRr7frr;r;r<#test_forwardref_instance_type_error s  z3ForwardRefTests.test_forwardref_instance_type_errorcCsBtd}|ttt|Wdn1s40YdS)NrY)r@r/rPrQr5rYrr;r;r<#test_forwardref_subclass_type_error s  z3ForwardRefTests.test_forwardref_subclass_type_errorcCs8|ttdWdn1s*0YdSr)rPrQr@r/rSr;r;r<test_forwardref_only_str_arg s z,ForwardRefTests.test_forwardref_only_str_argcCstd}||td|tdtt||tjdtdtjdtd}||tjdtd||tjddddS)NrYmodule__other_name__)r@r/rVrtrrYrE)r7rZfrmr;r;r<test_forward_equality s z%ForwardRefTests.test_forward_equalitycCstd}td}td}td}Gddd}||ddd}|t|tt||d||||||||||t|t||t|t||t|t||t||ft||t||t ft|t fdS)Nrc@s eZdZdS)z4ForwardRefTests.test_forward_equality_gth..CNrIr;r;r;r<r srrcSsdSr?r;rr;r;r<r sz6ForwardRefTests.test_forward_equality_gth..foo) r@r/rVrrrrrtrrY)r7c1c1_gthc2c2_gthrrr;r;r<test_forward_equality_gth s       z)ForwardRefTests.test_forward_equality_gthcCstd}td}td}td}||ddd}t|tt|t|t||t|t||t|t|tjdtd}tjddd}|t|t||t|t||t|t||t|ttjdtddS)NrYrcSsdSr?r;rr;r;r<r sz7ForwardRefTests.test_forward_equality_hash..foorr) r@r/rrrrVrrErt)r7rrrrrZc3Zc4r;r;r<test_forward_equality_hash s    z*ForwardRefTests.test_forward_equality_hashcCsBGddd}dd}dd}||||||dS)Nc@s eZdZdS)z:ForwardRefTests.test_forward_equality_namespace..ANrIr;r;r;r<r\ sr\cSs,td}|ddd}t|tt|S)Nr\rcSsdSr?r;rr;r;r<r szPForwardRefTests.test_forward_equality_namespace..namespace1..funr@r/rrr)rrr;r;r< namespace1 s zCForwardRefTests.test_forward_equality_namespace..namespace1cSs:td}Gddd}|ddd}t|tt|S)Nr\c@s eZdZdS)zNForwardRefTests.test_forward_equality_namespace..namespace2..ANrIr;r;r;r<r\ srcSsdSr?r;rr;r;r<r szPForwardRefTests.test_forward_equality_namespace..namespace2..funr)rr\rr;r;r< namespace2 s  zCForwardRefTests.test_forward_equality_namespace..namespace2)rVrt)r7r\rrr;r;r<test_forward_equality_namespace s  z/ForwardRefTests.test_forward_equality_namespacecCs|ttdddS)NrYztyping.List[ForwardRef('int')])rVrWrrSr;r;r<test_forward_repr sz!ForwardRefTests.test_forward_reprcCs6tdddd}|t|ttdttidS)Nr rcSsdSr?r;rr;r;r<r sz/ForwardRefTests.test_union_forward..foor)rrVrrrr rr;r;r<test_union_forward s z"ForwardRefTests.test_union_forwardcCsltdddd}|t|ttdttittdddd}|t|ttdttidS)Nr rcSsdSr?r;rr;r;r<r sz/ForwardRefTests.test_tuple_forward..foorcSsdSr?r;rr;r;r<r s)rrVrrrr rr/rr;r;r<test_tuple_forward s  z"ForwardRefTests.test_tuple_forwardcCs2dddd}|t|ttdttidS)Nz List['int']rcSsdSr?r;rr;r;r<r sz0ForwardRefTests.test_double_forward..foor)rVrrrrrYrr;r;r<test_double_forward s z#ForwardRefTests.test_double_forwardcCsDdd}dd}dd}|}|}||||t|||dS)NcSs0td}|}|ddd}t|tt}|S)Nr\rcSsdSr?r;rr;r;r<r rzPForwardRefTests.test_forward_recursion_actually..namespace1..funrrr\rretr;r;r<r s  zCForwardRefTests.test_forward_recursion_actually..namespace1cSs0td}|}|ddd}t|tt}|S)Nr\rcSsdSr?r;rr;r;r<r rzPForwardRefTests.test_forward_recursion_actually..namespace2..funrrr;r;r<r s  zCForwardRefTests.test_forward_recursion_actually..namespace2cSs||kSr?r;)Zo1Zo2r;r;r<cmp sz.cmp)rHrPRecursionError)r7rrrZr1Zr2r;r;r<test_forward_recursion_actually s z/ForwardRefTests.test_forward_recursion_actuallycstdttfGfddd}Gfddd}Gfddd}Gfdd d }|t|ttt|tt|t|ttd tttttttdffi|t|ttd ttttttdffi|t|ttd ttttttttdffttttdffi|t|ttd ttttttdftttttttdfffidS) NValuecseZdZUeed<dS)z7ForwardRefTests.test_union_forward_recursion..CrN)rErFrGrrr;)rr;r<r& s rcseZdZUefed<dS)z7ForwardRefTests.test_union_forward_recursion..DrN)rErFrGrrr;rZ ValueListr;r<r-( s r-cs"eZdZUeefed<dS)z7ForwardRefTests.test_union_forward_recursion..ErNrErFrGrrrr;rr;r<r7* s r7cs$eZdZUeefed<dS)z7ForwardRefTests.test_union_forward_recursion..FrNrr;rr;r<F, s rr)rrr{rVrrr)r7rr-r7rr;rr<test_union_forward_recursion" s8 $"z,ForwardRefTests.test_union_forward_recursioncCsBtdgdfddd}|t|ttdttgtfidS)Nr rcSsdSr?r;rr;r;r<rD sz2ForwardRefTests.test_callable_forward..foor)rrVrrrr rr;r;r<test_callable_forwardB sz%ForwardRefTests.test_callable_forwardcCs6dddd}|t|ttdtdtfidS)NzCallable[..., T]rcSsdSr?r;rr;r;r<rL sz@ForwardRefTests.test_callable_with_ellipsis_forward..foor.)rVrrrrr rr;r;r<#test_callable_with_ellipsis_forwardJ sz3ForwardRefTests.test_callable_with_ellipsis_forwardcCsGddd}Gddd}|t|tdtt|t|tdtt|tt|tfWdn1s0YdS)Nc@s.eZdZUdZeded<dZeded<dS)z5ForwardRefTests.test_special_forms_forward..Cr) ClassVar[int])rrr) Final[int]constrN)rErFrGrr.rrr;r;r;r<rT s rc@seZdZUdZeded<dS)z6ForwardRefTests.test_special_forms_forward..CFrrrN)rErFrGrrrr;r;r;r<CFX s rrr)rVrrrrYrrPrQ)r7rrr;r;r<test_special_forms_forwardR s  z*ForwardRefTests.test_special_forms_forwardcCs6|ttdWdn1s(0YdS)Nz/T)rP SyntaxErrorrrSr;r;r<test_syntax_error` s z!ForwardRefTests.test_syntax_errorcCsDdddd}|tt|Wdn1s60YdS)NzNode[TrcSsdSr?r;rr;r;r<rg sz6ForwardRefTests.test_delayed_syntax_error..foo)rPrrrr;r;r<test_delayed_syntax_errore s z)ForwardRefTests.test_delayed_syntax_errorcCsHtdddd}|tt|Wdn1s:0YdS)NZ42rcSsdSr?r;rr;r;r<ro sz,ForwardRefTests.test_type_error..foo)rrPrQrrr;r;r<test_type_errorm s zForwardRefTests.test_type_errorcCsHdddd}|tt|tWdn1s:0YdS)NzNoode[T]rcSsdSr?r;rr;r;r<rw sz,ForwardRefTests.test_name_error..foo)rP NameErrorrrrr;r;r<test_name_erroru s zForwardRefTests.test_name_errorcCs,tdiddd}t|}||idS)N whateversrrcSsdSr?r;rr;r;r<r sz/ForwardRefTests.test_no_type_check..foo)r!rrV)r7rthr;r;r<test_no_type_check} sz"ForwardRefTests.test_no_type_checkcCsDtGddd}t|j}||it|j}||idS)Nc@seZdZdidddZdS)z3ForwardRefTests.test_no_type_check_class..CrrcSsdSr?r;rr;r;r<r sz7ForwardRefTests.test_no_type_check_class..C.fooNrErFrGrr;r;r;r<r sr)r!rrrV)r7rcthithr;r;r<test_no_type_check_class s    z(ForwardRefTests.test_no_type_check_classcs@GdddtGfddd}|tjdtidS)Nc@seZdZedddZdS)z6ForwardRefTests.test_no_type_check_no_bases..CrcSsdSr?r;rbr;r;r<r# rz;ForwardRefTests.test_no_type_check_no_bases..C.methNrErFrGrYr#r;r;r;r<r srcseZdZZdS)z6ForwardRefTests.test_no_type_check_no_bases..DN)rErFrGrr;rr;r<r- sr-r)r!rVrr#rYr7r-r;rr<test_no_type_check_no_bases sz+ForwardRefTests.test_no_type_check_no_basescCslGddd}Gddd}Gddd}Gddd}d tjti}||||fD]}|t||qRdS) Nc@s eZdZUdZejeed<dS)zCForwardRefTests.test_no_type_check_forward_ref_as_string..CrN)rErFrGrr@rrYrr;r;r;r<r s rc@seZdZUdZeeed<dS)zCForwardRefTests.test_no_type_check_forward_ref_as_string..DrrN)rErFrGrrrYrr;r;r;r<r- s r-c@seZdZUdZded<dS)zCForwardRefTests.test_no_type_check_forward_ref_as_string..Err|rNrErFrGrrr;r;r;r<r7 s r7c@seZdZUdZded<dS)zCForwardRefTests.test_no_type_check_forward_ref_as_string..FrrrNrr;r;r;r<r s rr)r@rrYrVr)r7rr-r7rZexpected_resultclazzr;r;r<(test_no_type_check_forward_ref_as_string sz8ForwardRefTests.test_no_type_check_forward_ref_as_stringc Cs`Gddd}Gddd}||fD]6}|tt|Wdq$1sP0Yq$dS)Nc@seZdZUdZded<dS)zGForwardRefTests.test_nested_classvar_fails_forward_ref_check..Erz%typing.ClassVar[typing.ClassVar[int]]rNrr;r;r;r<r7 s r7c@seZdZUdZeded<dS)zGForwardRefTests.test_nested_classvar_fails_forward_ref_check..FrrrN)rErFrGrrrr;r;r;r<r s r)rPrQr)r7r7rrr;r;r<,test_nested_classvar_fails_forward_ref_check s   z.magic_decoratorrrrcSsdSr?r;rr;r;r<r sz4ForwardRefTests.test_meta_no_type_check..fooc@seZdZdidddZdS)z2ForwardRefTests.test_meta_no_type_check..CrrcSsdSr?r;rr;r;r<r sz6ForwardRefTests.test_meta_no_type_check..C.fooNrr;r;r;r<r srr)r"rVrErr)r7rrrrrrr;r;r<test_meta_no_type_check s     z'ForwardRefTests.test_meta_no_type_checkcCs>d}i}t||t|dj}|||d|dddS)Nz^class C: def foo(self, a: 'C') -> 'D': pass class D: def bar(self, b: 'D') -> C: pass rr-r)rrrrV)r7rnshintsr;r;r<test_default_globals s  z$ForwardRefTests.test_default_globalscCsT|tttdtt|tttdtt|tttdtdS)Nr)rVgthLooprrrtrYrSr;r;r<test_final_forward_ref sz&ForwardRefTests.test_final_forward_refN) rErFrGrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr;r;r;r<rj s:$       rc@seZdZddZddZdS) OverloadTestscCsLddlm}|t"|dd}|Wdn1s>0YdS)NroverloadcSsdSr?r;r;r;r;r<r sz/OverloadTests.test_overload_fails..blah)r@rrP RuntimeErrorr7rrr;r;r<test_overload_fails s    z!OverloadTests.test_overload_failscCs*ddlm}|dd}dd}|dS)NrrcSsdSr?r;r;r;r;r<r sz2OverloadTests.test_overload_succeeds..blahcSsdSr?r;r;r;r;r<r s)r@rrr;r;r<test_overload_succeeds s   z$OverloadTests.test_overload_succeedsN)rErFrGrrr;r;r;r<r s ra import asyncio T_a = TypeVar('T_a') class AwaitableWrapper(typing.Awaitable[T_a]): def __init__(self, value): self.value = value def __await__(self) -> typing.Iterator[T_a]: yield return self.value class AsyncIteratorWrapper(typing.AsyncIterator[T_a]): def __init__(self, value: typing.Iterable[T_a]): self.value = value def __aiter__(self) -> typing.AsyncIterator[T_a]: return self async def __anext__(self) -> T_a: data = await self.value if data: return data else: raise StopAsyncIteration class ACM: async def __aenter__(self) -> int: return 42 async def __aexit__(self, etype, eval, tb): return None FT) ann_module ann_module2 ann_module3 ann_module5 ann_module6)AsyncContextManagerc@seZdZUeed<dS)r\rN)rErFrGrrr;r;r;r<r\' s r\c@s2eZdZUdZeeded<eed<eed<dS)r@Nrrr)rErFrGrrrrrYr;r;r;r<r@) s r@c@s eZdZUeZeded<dS)CSubrN)rErFrGr@rrrr;r;r;r<r- s rc@s"eZdZUgZeeeed<dS)rjlstN)rErFrGrrrr rr;r;r;r<rj/ s rjc@seZdZUeded<dS)rrN)rErFrGrrr;r;r;r<r2 s rc@seZdZUded<ded<dS)NoneAndForwardparentNmeaningrErFrGrr;r;r;r<r5 s rc@seZdZUeed<eed<dS) CoolEmployeenamecoolNrErFrGr{rrYr;r;r;r<r9 s rc@s"eZdZUeed<dZeed<dS)CoolEmployeeWithDefaultrrrN)rErFrGr{rrrYr;r;r;r<r= s rc@seZdZUeed<ddZdS)XMethrcCs d|jS)NrrrSr;r;r<doubleC sz XMeth.doubleN)rErFrGrYrrr;r;r;r<rA s rc@s2eZdZUeed<dZeed<ddZddZdS) XReprrrrcCs|jd|jS)Nz -> r[rSr;r;r<__str__I sz XRepr.__str__cCsdSr_r;r7ryr;r;r<__add__K sz XRepr.__add__N)rErFrGrYrrrrr;r;r;r<rF s  rLabelrc@seZdZUeed<eed<dS)Point2DrrNrr;r;r;r<rP s rc@seZdZUeed<dS)rrNrr;r;r;r<rT s rtotalc@s eZdZdS) LabelPoint2DNrIr;r;r;r<rW rrc@seZdZUeed<eed<dS)Options log_levellog_pathNrr;r;r;r<rY s rc@seZdZUded<ded<dS)HasForeignBaseClassr some_xreprzmod_generics_cache.Aother_aNrr;r;r;r<r] s r)amc s@|4IdH}|WdIdHS1IdHs20YdSr?r;)rrr;r;r<g_witha srrOc@s:eZdZejddddZejejddddZdS) ForRefExamplerScCsdSr?r;rSr;r;r<rn szForRefExample.funccCsdSr?r;rSr;r;r<nestedr szForRefExample.nestedN)rErFrGrdecrrr;r;r;r<rm s rc@s|eZdZddZddZedddZdd Zd d Zd d Z ddZ ddZ ddZ ddZ ddZddZddZdS)GetTypeHintTestscCs|ttdWdn1s(0Y|ttdWdn1sZ0Y|ttdWdn1s0YdS)N{r>)rPrQrrSr;r;r<(test_get_type_hints_from_various_objectsy s  & & z9GetTypeHintTests.test_get_type_hints_from_various_objectscCsJdtttfttd}|tt||tti|ttidS)Nr)rrCrr)rrYr{rVrrrr)r7Zann_module_type_hintsr;r;r<test_get_type_hints_modules sz,GetTypeHintTests.test_get_type_hints_modulesz known bugcCs*ttjttjd}|tt|dS)N)Z default_aZ default_b)rr0r\r@rVr)r7Z mgc_hintsr;r;r<&test_get_type_hints_modules_forwardref sz7GetTypeHintTests.test_get_type_hints_modules_forwardrefcCs<|ttjdttji|ttjt|ttjdt d|ttj t t ttjd|ttj dt i|ttjdttji|ttjt t d|ttjdt i|tttt dd|ttttjtjd |ttjt t d|ttjtjjtjjtjd dS) Nrr)Z123r)jrrrr[r)rr)rrZsome_b)Z my_inner_a1Z my_inner_a2Z my_outer_a)rVrrrrrkZj_classrMr^r-r{rsrYZh_classrrrrrr0r\r@rrSr;r;r<test_get_type_hints_classes s>          z,GetTypeHintTests.test_get_type_hints_classescCs&Gddd}|t|dtidS)Nc@seZdZUdZeed<dS)zZGetTypeHintTests.test_get_type_hints_classes_no_implicit_optional..WithNoneDefaultNfield)rErFrGr rYrr;r;r;r<WithNoneDefault s rr )rVrrY)r7rr;r;r<0test_get_type_hints_classes_no_implicit_optional szAGetTypeHintTests.test_get_type_hints_classes_no_implicit_optionalcCstGddd}||j||jjj|ttjj iGdddt t }tGddd|}|t|j dt idS)Nc@seZdZGdddZdS)z>GetTypeHintTests.test_respect_no_type_check..NoTpCheckc@seZdZddddZdS)zBGetTypeHintTests.test_respect_no_type_check..NoTpCheck.Innz not a typercSsdSr?r;rbr;r;r<r rzKGetTypeHintTests.test_respect_no_type_check..NoTpCheck.Inn.__init__NrYr;r;r;r<Inn srN)rErFrGrr;r;r;r< NoTpCheck src@seZdZedddZdS)z:GetTypeHintTests.test_respect_no_type_check..ABasercSsdSr?r;rr;r;r<r# rz?GetTypeHintTests.test_respect_no_type_check..ABase.methNrr;r;r;r<ABase src@s eZdZdS)z8GetTypeHintTests.test_respect_no_type_check..DerNrIr;r;r;r<Der srr) r!r__no_type_check__rrrVrrZNTCr#rr rY)r7rrrr;r;r<test_respect_no_type_check s z+GetTypeHintTests.test_respect_no_type_checkcCs||tti|tti|tti|tti|ttji|ttji|ttj idSr?) rVrrYr^dirrrrr{joinrSr;r;r< test_get_type_hints_for_builtins sz1GetTypeHintTests.test_get_type_hints_for_builtinscCsPdd}d|jd<|t|dtidddd}|t|dtdidS)NcSsdSr?r;r[r;r;r<testf rz6GetTypeHintTests.test_previous_behavior..testfrYrrcSsdSr?r;rr;r;r<testg rz6GetTypeHintTests.test_previous_behavior..testg)rrVrrYr^)r7rrr;r;r<test_previous_behavior s  z'GetTypeHintTests.test_previous_behaviorcCsHGddd}Gddd}|}ddi|_|t|td|idS)Nc@s eZdZdS)zKGetTypeHintTests.test_get_type_hints_for_object_with_annotations..ANrIr;r;r;r<r\ rr\c@s eZdZdS)zKGetTypeHintTests.test_get_type_hints_for_object_with_annotations..BNrIr;r;r;r<r@ rr@r)rrVrr)r7r\r@rr;r;r</test_get_type_hints_for_object_with_annotations s  z@GetTypeHintTests.test_get_type_hints_for_object_with_annotationsc Cs|ttjtjdtjtji|tttt tt tt d|tt ttt t t tt td|tt dtt tidS)Nvar)rrr)rrrrr)rVrrZCVrr@rr@rrYrrrjrr rSr;r;r<test_get_type_hints_ClassVar s  z-GetTypeHintTests.test_get_type_hints_ClassVarcCs0dti}|ttj||ttj|dS)Nr7)rrVrrr)r7Zexpectsr;r;r<,test_get_type_hints_wrapped_decoratored_func sz=GetTypeHintTests.test_get_type_hints_wrapped_decoratored_funccCsVtdddd}ttdf}|t|ttdtti|t|ttdddtttdfittddd d}ttdf}|t|ttdtti|t|ttdddtttdfit tt d fd f}|dd d }|t|ttdt t d f| t|ttddd|t tt d fd f}|ddd }|t|ttdt t d f| t|ttddd|t jd ttt dfft jttt dffddd}|t|ttt jd tt ft jtt fdt jd tt f}|ddd}| t|ttddd|dS)NrprcSsdSr?r;rr;r;r<r rz>GetTypeHintTests.test_get_type_hints_annotated..foobar)r rTinclude_extrascSsdSr?r;rr;r;r<r r)rr.cSsdSr?r;rr;r;r<r! rz>GetTypeHintTests.test_get_type_hints_annotated..barfoocSsdSr?r;rr;r;r<r! rrZmutabler[cSsdSr?r;r[r;r;r<r" sz?GetTypeHintTests.test_get_type_hints_annotated..barfoo2cSsdSr?r;rr;r;r<barfoo3 rz?GetTypeHintTests.test_get_type_hints_annotated..barfoo3)rr.rYrVrrrrr/rr rwrr@rr)r7rrpZBAr!r"ZBA2r#r;r;r<test_get_type_hints_annotated s^    $$  z.GetTypeHintTests.test_get_type_hints_annotatedcsttdfGfdddtt}|t|jtt|t|td|t|jttdd|t|td|t|jtt|t|tddS)NConstcs0eZdZdddddZdddddZdS) zBGetTypeHintTests.test_get_type_hints_annotated_refs..MySetzConst[MySet[T]]zMySet[T]ryrcSsdSr?r;rr;r;r<__ior__ szJGetTypeHintTests.test_get_type_hints_annotated_refs..MySet.__ior__cSsdSr?r;rr;r;r<__iand__" szKGetTypeHintTests.test_get_type_hints_annotated_refs..MySet.__iand__N)rErFrGr'r(r;r%r;r<MySet sr*r&Tr!) r.r rrVrr(rrr')r7r*r;r)r<"test_get_type_hints_annotated_refs s z3GetTypeHintTests.test_get_type_hints_annotated_refsN)rErFrGrrrr r rrrrrrrr$r+r;r;r;r<rx s    5rc@s,eZdZddZddZddZddZd S) GetUtilitiesTestCasecCsdtd}Gdddt|}|t|t||t||||ttd|tttt|ttttft|ttdt|tt t tt |ttt|tt|t|tt t ||ftt |tt |dft |tt t |tt t|tttjj|tt tt |tt ddS)Nr c@s eZdZdS)z/GetUtilitiesTestCase.test_get_origin..CNrIr;r;r;r<r8 rrrO+r2)r rrwrrYrrr{rrrrrr.rrrr>rr;r;r<test_get_origin6 s$ z$GetUtilitiesTestCase.test_get_originc Cstd}Gdddt|}|t|ttf|t|||f|ttd|ttttf|ttttfttf|ttdd|tt t tt tf|tttt |tffttt ttff|tt j tt ||fftttt ttttff|ttg|ftgtf|ttdtfdtf|ttttt |dfgtffttt |dfgtff|tt tdftdf|tt dd|tt|dd d gf|dd d gf|tt d|tt d|ttd|ttttf|ttd|ttjjtgtftgtf|ttjjdtfdtf|ttjjgtfgtf|ttjjtgtftttgtfdS) Nr c@s eZdZdS)z-GetUtilitiesTestCase.test_get_args..CNrIr;r;r;r<rL rrr;r-.)r;onerZthree)r rrVr rYrrr{rrrrr@rrrr.rrr>rr;r;r< test_get_argsJ sD$ $($  z"GetUtilitiesTestCase.test_get_argscCs:tt}||dttittj}||dtidS)Nrr)rrrVrr{ZMyClass)r7rr;r;r<test_forward_ref_and_finalj s z/GetUtilitiesTestCase.test_forward_ref_and_finalcCs8|tdttWdn1s*0YdS)Nz4typing.ClassVar\[int\] is not valid as type argument)assertRaisesRegexrQrrrSr;r;r<test_top_level_class_varr s z-GetUtilitiesTestCase.test_top_level_class_varN)rErFrGr/r1r2r4r;r;r;r<r,5 s r,c@seZdZddZddZddZeeddd Zeedd d Z eedd d Z eedddZ ddZ ddZ ddZddZddZddZddZddZd d!Zd"d#Zd$d%Zd&d'Zd(d)Zd*d+Zd,d-Zd.d/Zd0d1Zd2d3Zd4d5Zd6d7Zd8d9Z d:d;Z!dd?Z#d@dAZ$ee%j&dBkdCdDdEZ'ee%j&dBkdCdFdGZ(dHdIZ)dJdKZ*dLdMZ+dNdOZ,dPdQZ-dRdSZ.dTdUZ/dVdWZ0dXdYZ1dZd[Z2d\d]Z3d^d_Z4d`daZ5dbdcZ6dddeZ7dfdgZ8dhdiZ9djS)kCollectionsAbcTestscCs |dtj|gtjdSrN)rkr@HashablerrSr;r;r< test_hashable} sz!CollectionsAbcTests.test_hashablecCsX|gtj|gtj|gtj|dtj|ttj|ttjdSrN)rkr@rrr=rrSr;r;r< test_iterable s z!CollectionsAbcTests.test_iterablecCs(tg}||tj|dtjdSrN)rrkr@Iteratorr)r7itr;r;r< test_iterator sz!CollectionsAbcTests.test_iteratorz&Python 3.5 and multithreading requiredcCsJi}tdt||d}|}||tj||tj|ddS)NzPasync def foo() -> typing.Awaitable[int]: return await AwaitableWrapper(42) r)rrrkr@ Awaitablersendr7rrgr;r;r<test_awaitable sz"CollectionsAbcTests.test_awaitablecCsi}tdt||d}|}||tj|t t|tjtWdn1s^0Y| |tjz| dWnt yYn0dS)Nzasync def foo(): return r) rrrkr@ CoroutinerPrQrRrYrr= StopIterationr>r;r;r<test_coroutine s . z"CollectionsAbcTests.test_coroutinecCs>td}t|}||tj||tj|dtjdSNr rO)rAsyncIteratorWrapperrkr@ AsyncIterablerr7Zbase_itr:r;r;r<test_async_iterable s z'CollectionsAbcTests.test_async_iterablecCs0td}t|}||tj|dtjdSrD)rrErkr@ AsyncIteratorrrGr;r;r<test_async_iterator sz'CollectionsAbcTests.test_async_iteratorcCs |gtj|dtjdSrN)rkr@SizedrrSr;r;r< test_sized szCollectionsAbcTests.test_sizedcCs |gtj|dtjdSrN)rkr@ ContainerrrSr;r;r<test_container sz"CollectionsAbcTests.test_containercCs@|ttj|ttj|ttj|dtjdSrN)rkrr@ Collectionrr=rrrSr;r;r<test_collection sz#CollectionsAbcTests.test_collectioncCs"|ttj|dtjdSrN)rkrer@r=rrSr;r;r<test_abstractset sz$CollectionsAbcTests.test_abstractsetcCs$|ttj|ttjdSr?)rkrer@ MutableSetrrrSr;r;r<test_mutableset sz#CollectionsAbcTests.test_mutablesetcCs |itj|dtjdSrN)rkr@rrrSr;r;r< test_mapping sz CollectionsAbcTests.test_mappingcCs |itj|dtjdSrN)rkr@rrrSr;r;r<test_mutablemapping sz'CollectionsAbcTests.test_mutablemappingcCs |gtj|dtjdSrN)rkr@r+rrSr;r;r< test_sequence sz!CollectionsAbcTests.test_sequencecCs |gtj|dtjdSr)rkr@MutableSequencerrSr;r;r<test_mutablesequence sz(CollectionsAbcTests.test_mutablesequencecCs$|dtj|tdtjdSr)rkr@ ByteString bytearrayrSr;r;r<test_bytestring sz#CollectionsAbcTests.test_bytestringcCs|ttjdSr?)r=rr@rrSr;r;r< test_list szCollectionsAbcTests.test_listcCs:|tjtjGdddtjt}||tjdS)Nc@s eZdZdS)z/CollectionsAbcTests.test_deque..MyDequeNrIr;r;r;r<MyDeque rr])r=rdequer@DequerYrk)r7r]r;r;r< test_deque szCollectionsAbcTests.test_dequecCs|tjtjdSr?)r=rCounterr@rSr;r;r< test_counter sz CollectionsAbcTests.test_countercCs |ttj|ttjdSr?)r=rer@Setr>rrSr;r;r<test_set szCollectionsAbcTests.test_setcCs |ttj|ttjdSr?)r=rr@rr>rerSr;r;r<test_frozenset sz"CollectionsAbcTests.test_frozensetcCs|ttjdSr?)r=rr@rrSr;r;r<r szCollectionsAbcTests.test_dictcCs td}td}|t||fttftttf|t|tfttttf|tt|fttttf|t|t|fttfttttf|t|ttftttttf|t|t|fttfttttf|t|ttftttttfdS)NKr)r rVrr{rYrr)r7rfrr;r;r<test_dict_subscribe s$  ,(,z'CollectionsAbcTests.test_dict_subscribecCs|ttWdn1s(0Y|ttjtWdn1s^0Y|ttjtWdn1s0YdSr?)rPrQr@rr rYrSr;r;r<test_no_list_instantiation s  & * z.CollectionsAbcTests.test_no_list_instantiationcCsRGdddtjt}|}|||||tj||t|t|dS)Nc@s eZdZdS)z6CollectionsAbcTests.test_list_subclass..MyListNrIr;r;r;r<MyList sri)r@rrYrkr+r=rr>)r7rirr;r;r<test_list_subclass s   z&CollectionsAbcTests.test_list_subclasscCs|ttWdn1s(0Y|t tjttfWdn1sb0Y|t tjttfWdn1s0YdSr?)rPrQr@rr rr{rYrSr;r;r<test_no_dict_instantiation s  & . z.CollectionsAbcTests.test_no_dict_instantiationcCsVGdddtjttf}|}|||||tj||t|t|dS)Nc@s eZdZdS)z6CollectionsAbcTests.test_dict_subclass..MyDictNrIr;r;r;r<r1( sr1) r@rr{rYrkrr=rr>)r7r1rUr;r;r<test_dict_subclass& s   z&CollectionsAbcTests.test_dict_subclasscCsV|tttj|ttjttftj|ttjtt ftjdSr?) rwr^r@r5r defaultdictr rr{rYrSr;r;r<test_defaultdict_instantiation2 sz2CollectionsAbcTests.test_defaultdict_instantiationcCsLGdddtjttf}|}|||||tj|tj|dS)Nc@s eZdZdS)z@CollectionsAbcTests.test_defaultdict_subclass..MyDefDictNrIr;r;r;r< MyDefDict9 sro) r@r5r{rYrkr=rrmr>)r7roddr;r;r<test_defaultdict_subclass7 s  z-CollectionsAbcTests.test_defaultdict_subclasscCsV|tttj|ttjttftj|ttjttftjdSr?) rwr^r@ OrderedDictrr rr{rYrSr;r;r<test_ordereddict_instantiationB sz2CollectionsAbcTests.test_ordereddict_instantiationcCsLGdddtjttf}|}|||||tj|tj|dS)Nc@s eZdZdS)z@CollectionsAbcTests.test_ordereddict_subclass..MyOrdDictNrIr;r;r;r< MyOrdDictI srt)r@rrr{rYrkr=rr>)r7rtZodr;r;r<test_ordereddict_subclassG s  z-CollectionsAbcTests.test_ordereddict_subclassr3zChainMap was added in 3.3cCs|tttj|ttjttftj|ttjttftjGdddtjttf}|t|ttf|dS)Nc@s eZdZdS)z;CollectionsAbcTests.test_chainmap_instantiation..CMNrIr;r;r;r<CMW rrv) rwr^r@r6rr rr{rY)r7rvr;r;r<test_chainmap_instantiationR s z/CollectionsAbcTests.test_chainmap_instantiationcCsLGdddtjttf}|}|||||tj|tj|dS)Nc@s eZdZdS)z>CollectionsAbcTests.test_chainmap_subclass..MyChainMapNrIr;r;r;r< MyChainMap] srx)r@r6r{rYrkr=rr>)r7rxcmr;r;r<test_chainmap_subclassZ s  z*CollectionsAbcTests.test_chainmap_subclasscCsz|tttj|ttjttj|ttjttjGdddtjt}|t|t|dS)Nc@s eZdZdS)z7CollectionsAbcTests.test_deque_instantiation..DNrIr;r;r;r<r-j rr-)rwr^r@r_rr^r rYrr;r;r<test_deque_instantiationf s z,CollectionsAbcTests.test_deque_instantiationcCsz|tttj|ttjttj|ttjttjGdddtjt}|t|t|dS)Nc@s eZdZdS)z9CollectionsAbcTests.test_counter_instantiation..CNrIr;r;r;r<rq rr)rwr^r@rarr rYrr;r;r<test_counter_instantiationm s z.CollectionsAbcTests.test_counter_instantiationcCsHGdddtjt}|}|||||tj||tjdS)Nc@s eZdZdS)zJCollectionsAbcTests.test_counter_subclass_instantiation..MyCounterNrIr;r;r;r< MyCounterv sr})r@rarYrkr)r7r}rUr;r;r<#test_counter_subclass_instantiationt s  z7CollectionsAbcTests.test_counter_subclass_instantiationcCs|ttWdn1s(0Y|ttjtWdn1s^0Y|ttjtWdn1s0YdSr?)rPrQr@rcr rYrSr;r;r<test_no_set_instantiation~ s  & * z-CollectionsAbcTests.test_no_set_instantiationcCs,Gdddtjt}|}|||dS)Nc@s eZdZdS)zBCollectionsAbcTests.test_set_subclass_instantiation..MySetNrIr;r;r;r<r* sr*)r@rcrYrk)r7r*rUr;r;r<test_set_subclass_instantiation sz3CollectionsAbcTests.test_set_subclass_instantiationcCs|ttWdn1s(0Y|ttjtWdn1s^0Y|ttjtWdn1s0YdSr?)rPrQr@rr rYrSr;r;r<test_no_frozenset_instantiation s  & * z3CollectionsAbcTests.test_no_frozenset_instantiationcCs,Gdddtjt}|}|||dS)Nc@s eZdZdS)zNCollectionsAbcTests.test_frozenset_subclass_instantiation..MyFrozenSetNrIr;r;r;r< MyFrozenSet sr)r@rrYrk)r7rrUr;r;r<%test_frozenset_subclass_instantiation sz9CollectionsAbcTests.test_frozenset_subclass_instantiationcCs|ttWdn1s&0Y|tttWdn1sZ0Y|tttWdn1s0YdSr?)rPrQrr rYrSr;r;r<test_no_tuple_instantiation s  $ ( z/CollectionsAbcTests.test_no_tuple_instantiationcCs$dd}|}|t|tjdS)Ncss dVdSrNr;r;r;r;r<r sz/CollectionsAbcTests.test_generator..foo)r=r^r@ Generator)r7rr?r;r;r<test_generator sz"CollectionsAbcTests.test_generatorcCs|ttWdn1s(0Y|t"tjtttfWdn1sd0Y|t"tjtttfWdn1s0YdSr?)rPrQr@rr rYrSr;r;r<test_no_generator_instantiation s  & 0 z3CollectionsAbcTests.test_no_generator_instantiationcCs2i}tdt||d}|t|tjdS)Nzasync def f(): yield 42 rC)rrr=r^r@AsyncGenerator)r7rr?r;r;r<test_async_generator s  z(CollectionsAbcTests.test_async_generatorcCs|ttWdn1s(0Y|t tjttfWdn1sb0Y|t tjttfWdn1s0YdSr?)rPrQr@rr rYrSr;r;r<%test_no_async_generator_instantiation s  & . z9CollectionsAbcTests.test_no_async_generator_instantiationcCsdGdddtj}|t|Wdn1s80YGddd|}|t|dt|jsrJ||tj Gdddtjt t f}|t|d|t|t t fd|t|t t fd| t|| t|||tj ||tj ||tj ||t t ftj ||t t ftjj ||tjj ||tjj ||tjj |t$t|t t ftj Wdn1s0Y|||Gdd d tj}| t|Gd d d tjtttf}d d }||tj||tj||tjj||tjj| t||dS)Nc@s eZdZdS)z1CollectionsAbcTests.test_subclassing..MMANrIr;r;r;r<MMA src@s4eZdZddZddZddZddZd d Zd S) z1CollectionsAbcTests.test_subclassing..MMCcSsdSr?r;rr;r;r<r sz=CollectionsAbcTests.test_subclassing..MMC.__getitem__cSsdSr?r;rr;r;r<r  sz=CollectionsAbcTests.test_subclassing..MMC.__setitem__cSsdSr?r;rr;r;r<r sz=CollectionsAbcTests.test_subclassing..MMC.__delitem__cSstdSrrrSr;r;r<r sz:CollectionsAbcTests.test_subclassing..MMC.__iter__cSsdSr_r;rSr;r;r<r sz9CollectionsAbcTests.test_subclassing..MMC.__len__Nrr;r;r;r<MMC s rrc@s4eZdZddZddZddZddZd d Zd S) z1CollectionsAbcTests.test_subclassing..MMBcSsdSr?r;rr;r;r<r sz=CollectionsAbcTests.test_subclassing..MMB.__getitem__cSsdSr?r;rr;r;r<r  sz=CollectionsAbcTests.test_subclassing..MMB.__setitem__cSsdSr?r;rr;r;r<r sz=CollectionsAbcTests.test_subclassing..MMB.__delitem__cSstdSrrrSr;r;r<r sz:CollectionsAbcTests.test_subclassing..MMB.__iter__cSsdSr_r;rSr;r;r<r sz9CollectionsAbcTests.test_subclassing..MMB.__len__Nrr;r;r;r<MMB s rc@s eZdZdS)z/CollectionsAbcTests.test_subclassing..INrIr;r;r;r<I rrc@s eZdZdS)z/CollectionsAbcTests.test_subclassing..GNrIr;r;r;r<rjrrjcss dVdSr_r;r;r;r;r<r?rz/CollectionsAbcTests.test_subclassing..g)r@rrPrQrVrcallablerrkrr rr{r>rr=rr>r5rrrrYr^)r7rrrrrjr?r;r;r<test_subclassing sB $     4  z$CollectionsAbcTests.test_subclassingcCsGdddtjttf}i}tdt||d}||tj||tj||tjj||tjj| t |||}| |tj| |tj| |tjj| |tjj| t ||| ||dS)Nc@seZdZddZdddZdS)z?CollectionsAbcTests.test_subclassing_async_generator..GcSsdSr?r;)r7rr;r;r<asend szECollectionsAbcTests.test_subclassing_async_generator..G.asendNcSsdSr?r;)r7typvaltbr;r;r<athrow szFCollectionsAbcTests.test_subclassing_async_generator..G.athrow)NN)rErFrGrrr;r;r;r<rj srjzasync def g(): yield 0r?) r@rrYrrr=rFrr>r>r^rkr)r7rjrr?instancer;r;r< test_subclassing_async_generators z4CollectionsAbcTests.test_subclassing_async_generatorcCsfGdddtj}Gddd|}Gddd}Gddd}|||||||||dS) Nc@seZdZeddZdS)z?CollectionsAbcTests.test_subclassing_subclasshook..BasecSs|jdkrdSdSdS)NrTF)rErxr;r;r<rz#s zPCollectionsAbcTests.test_subclassing_subclasshook..Base.__subclasshook__Nr{r;r;r;r<r"src@s eZdZdS)z.CNrIr;r;r;r<r*rrc@s eZdZdS)z>CollectionsAbcTests.test_subclassing_subclasshook..FooNrIr;r;r;r<r+rrc@s eZdZdS)z>CollectionsAbcTests.test_subclassing_subclasshook..BarNrIr;r;r;r<r,rr)r@rr=r>)r7rrrrr;r;r<test_subclassing_subclasshook s  z1CollectionsAbcTests.test_subclassing_subclasshookcCsGdddtj}Gddd|}Gddd}||||||||Gddd}||||||||Gd d d }tjj|||tjdS) Nc@s eZdZdS)z8CollectionsAbcTests.test_subclassing_register..ANrIr;r;r;r<r\3rr\c@s eZdZdS)z8CollectionsAbcTests.test_subclassing_register..BNrIr;r;r;r<r@4rr@c@s eZdZdS)z8CollectionsAbcTests.test_subclassing_register..CNrIr;r;r;r<r6rrc@s eZdZdS)z8CollectionsAbcTests.test_subclassing_register..DNrIr;r;r;r<r-;rr-c@s eZdZdS)z8CollectionsAbcTests.test_subclassing_register..MNrIr;r;r;r<r @rr ) r@rMrUr=r>rr>rr)r7r\r@rr-r r;r;r<test_subclassing_register1s      z-CollectionsAbcTests.test_subclassing_registercCsGdddtjj}||tj||tjGdddtjj}||tj||tjGdddtjj}||tjGdddtjjtjd }Gd d d }||||tjdS) Nc@s eZdZdS)z7CollectionsAbcTests.test_collections_as_base..MNrIr;r;r;r<r Frr c@s eZdZdS)z7CollectionsAbcTests.test_collections_as_base..SNrIr;r;r;r<rJrrc@s eZdZdS)z7CollectionsAbcTests.test_collections_as_base..INrIr;r;r;r<rNrrc@s eZdZdS)z7CollectionsAbcTests.test_collections_as_base..ANrIr;r;r;r<r\Qrr\) metaclassc@s eZdZdS)z7CollectionsAbcTests.test_collections_as_base..BNrIr;r;r;r<r@Rrr@) rr>rr=r@rrWABCMetarU)r7r rrr\r@r;r;r<test_collections_as_baseDs z,CollectionsAbcTests.test_collections_as_baseN):rErFrGr7r8r;rASYNCIOr@rCrHrJrLrNrPrQrSrTrUrVrXr[r\r`rbrdrerrgrhrjrkrlrnrqrsrurrrwrzr{r|r~rrrrrrrrrrrrrrr;r;r;r<r5{ sr             Er5c@s&eZdZddZeedddZdS) OtherABCTestscCs4tjdd}|}||tj|dtjdS)Ncss dVdSrNr;r;r;r;r<managerZsz2OtherABCTests.test_contextmanager..managerrO) contextlibcontextmanagerrkr@rr)r7rryr;r;r<test_contextmanagerYs  z!OtherABCTests.test_contextmanagerzPython 3.5 requiredcCsGddd}|ttj||tjtjdd}|}||tj|tjtj tf| t  t dtjtWdn1s0Y| t tjtt fWdn1s0YdS)Nc@s eZdZdS)z7OtherABCTests.test_async_contextmanager..NotACMNrIr;r;r;r<NotACMdsrcss dVdSrNr;r;r;r;r<rhsz8OtherABCTests.test_async_contextmanager..managerrO)rkACMr@rrrrrVrYrurPrQrRr{)r7rrryr;r;r<test_async_contextmanagerbs  . z'OtherABCTests.test_async_contextmanagerN)rErFrGrrrrr;r;r;r<rWs rc@s$eZdZddZddZddZdS) TypeTestscCsNGddd}Gddd|}Gddd|}t||ddd }||dS) Nc@s eZdZdS)z'TypeTests.test_type_basic..UserNrIr;r;r;r<Useryrrc@s eZdZdS)z,TypeTests.test_type_basic..BasicUserNrIr;r;r;r< BasicUserzrrc@s eZdZdS)z*TypeTests.test_type_basic..ProUserNrIr;r;r;r<ProUser{rr user_classrcSs|Sr?r;rr;r;r<new_user}sz+TypeTests.test_type_basic..new_userr#)r7rrrrr;r;r<test_type_basicws zTypeTests.test_type_basiccCsZGddd}Gddd|}Gddd|}td|d}t||d d d }||dS) Nc@s eZdZdS)z)TypeTests.test_type_typevar..UserNrIr;r;r;r<rrrc@s eZdZdS)z.TypeTests.test_type_typevar..BasicUserNrIr;r;r;r<rrrc@s eZdZdS)z,TypeTests.test_type_typevar..ProUserNrIr;r;r;r<rrrrrrcSs|Sr?r;rr;r;r<rsz-TypeTests.test_type_typevar..new_user)r r$)r7rrrrrr;r;r<test_type_typevars  zTypeTests.test_type_typevarcCsFttt}|ttddd}t|tts2J|ddusBJdS)NrcSs|dur dS|SdSr?r;rr;r;r<rsz)TypeTests.test_type_optional..foo)rr$ BaseExceptionrRKeyboardInterrupt)r7r\rr;r;r<test_type_optionals zTypeTests.test_type_optionalN)rErFrGrrrr;r;r;r<rus  rc@seZdZddZddZdS) NewTypeTestscCsLtdt}tdt}||dt||dt||ddddS)NUserIdUserNamerJoer)r%rYr{rkrV)r7rrr;r;r< test_basics   zNewTypeTests.test_basiccCstdt}tdt}|tt|tWdn1s>0Y|t Gddd|}Wdn1sx0YdS)Nrrc@s eZdZdS)z#NewTypeTests.test_errors..DNrIr;r;r;r<r-sr-)r%rYr{rPrQr5)r7rrr-r;r;r<rZs    ( zNewTypeTests.test_errorsN)rErFrGrrZr;r;r;r<rsrc@steZdZGdddeZddZddZddZd d Zd d Z d dZ ddZ ddZ ddZ ddZddZdS)NamedTupleTestsc@seZdZUeed<eed<dS)zNamedTupleTests.NestedEmployeerrNrr;r;r;r<NestedEmployees rcCstddtfdtfg}||t|dd}|ddd}|||||t||jd||jd||jd||jd||j d||j d||j t dtfdtfgdS) NEmpridrrOJimrrr)r&r{rYr=rrkrVrrrE_fieldsrrrr)r7rZjoejimr;r;r<rs     zNamedTupleTests.test_basicscCstjdddkr|ttdttdWdn1s@0Y|t Gdddt}Wdn1sz0YdS)Nr)rrName)r0ryc@seZdZdZdS)z9NamedTupleTests.test_namedtuple_pyversion..NotYetrN)rErFrGrJr;r;r;r<NotYetsr)rrrPrQr&rYr{)r7rr;r;r<test_namedtuple_pyversions  , z)NamedTupleTests.test_namedtuple_pyversioncCsvtdd}||t||t||jd||jd|tjd|tjd|tjt j t t ddS)NZTimi(#rrr) rrkrrVrrrErrrrrr{rY)r7Ztimr;r;r<test_annotation_usages    z%NamedTupleTests.test_annotation_usagecCstd}||t||t||jd||jdtdd}||jd|tjd|tjd|tjt t t d|tj t dd| t Gdd d t}Wdn1s0YdS) NZJellerZSjoerdrrr)rc@s"eZdZUdZeed<eed<dS)zRNamedTupleTests.test_annotation_usage_with_default..NonDefaultAfterDefaultrrrN)rErFrGrrYrr;r;r;r<NonDefaultAfterDefaults  r)rrkrrVrrrErrrr{rY_field_defaultsrPrQr&)r7ZjelleZcooler_employeerr;r;r<"test_annotation_usage_with_defaults     z2NamedTupleTests.test_annotation_usage_with_defaultcCs|tdd|tdjtdd|ttdd|tddtdd|t Gdddt}Wdn1s0Y|t Gd d d t}Wdn1s0YdS) NrrrOrz42 -> 1rc@seZdZUeed<ddZdS)zDNamedTupleTests.test_annotation_usage_with_methods..XMethBadrcSsdS)Nzno chance for thisr;rSr;r;r<rszLNamedTupleTests.test_annotation_usage_with_methods..XMethBad._fieldsN)rErFrGrYrrr;r;r;r<XMethBads rc@seZdZUeed<ddZdS)zENamedTupleTests.test_annotation_usage_with_methods..XMethBad2rcSsdS)Nzno chance for this as wellr;rSr;r;r<_sourceszMNamedTupleTests.test_annotation_usage_with_methods..XMethBad2._sourceN)rErFrGrYrrr;r;r;r< XMethBad2s r) rVrrrr{rrPrr&)r7rrr;r;r<"test_annotation_usage_with_methodss . z2NamedTupleTests.test_annotation_usage_with_methodscCsNGddd}|t"Gdddt|}Wdn1s@0YdS)Nc@s eZdZdS)z4NamedTupleTests.test_multiple_inheritance..ANrIr;r;r;r<r\sr\c@seZdZUeed<dS)z4NamedTupleTests.test_multiple_inheritance..XrNrr;r;r;r<rps rp)rPrQr&)r7r\rpr;r;r<r\s z)NamedTupleTests.test_multiple_inheritancecCstdttd}|dd}||t||jd||jd||jd||j t ttd| t $tddtfgtdWdn1s0Y| t tddd d Wdn1s0YdS) N LocalEmployee)rZageZNickrrrrrr[) r&r{rYrkrrVrrErrrrPrQ)r7rZnickr;r;r<test_namedtuple_keyword_usages   2 z-NamedTupleTests.test_namedtuple_keyword_usagecCstdttttd}||jd||jd|tdddtfgd}||j t||j d||j d||j dtfgdS)Nr')r8r7typenamefieldsrOrr) r&r^rr{rrVrErrr8r7rr)r7r'rr;r;r<%test_namedtuple_special_keyword_namessz5NamedTupleTests.test_namedtuple_special_keyword_namesc Cstd}Gdddt}||fD]h}|j|dH||jd||ji||ji|||Wdq 1s~0Yq dS)Nr'c@s eZdZdS)z2NamedTupleTests.test_empty_namedtuple..CNTNrIr;r;r;r<CNTsr)structr;)r&subTestrVrrrrk)r7r'rrr;r;r<test_empty_namedtuples z%NamedTupleTests.test_empty_namedtuplecCsZ|ttWdn1s(0Y|ttWdn1sX0Y|t"tddtfgdWdn1s0Y|t tddtfgWdn1s0Y|ttdttdWdn1s0Y|t(tddtfdtfgdWdn1sL0YdS)Nrr_name)rrrr)r)rPrQr&rr{rrYrSr;r;r<test_namedtuple_errors(s & $ 0 . . z&NamedTupleTests.test_namedtuple_errorsc Cstddtfdtfgatt|jfD]}|j|d|dd}ttj dD]2}t ||}t |}| ||| ||qLt|}| ||| ||t|}| ||| ||Wdq"1s0Yq"dS)Nrrr)r8jane%r)r&r{rYrrrrrrrrrrVrkrr)r7r8rrrjane2r;r;r<test_copy_and_pickle6s       z$NamedTupleTests.test_copy_and_pickleN)rErFrGr&rrrrrrr\rrrrrr;r;r;r<rs    rc@steZdZddZddZddZddZd d Zd d Zd dZ ddZ ddZ ddZ ddZ ddZddZdS)TypedDictTestscCstdttd}||t||tj||tj j |ddd}| t |t| |dd| |dd| |jd| |jt| |jtf| |jttd| |jddSNrrrrrrTr'r{rYr=rr@rr>rr>r+rwr^rVrErFrr __total__r7rrr;r;r<test_basics_functional_syntaxLs  z,TypedDictTests.test_basics_functional_syntaxcCstdttd}||t||tj||tj j |ddd}| t |t| |dd| |dd| |jd| |jt| |jtf| |jttd| |jddSrrrr;r;r<test_basics_keywords_syntax[s  z*TypedDictTests.test_basics_keywords_syntaxc Cstdttttttd}||jd||j ttttttd|tddddt fgdt hd}||dt||d d||d d||d d||d dt fg||d dt hdS)NTD)r8r7r _typenamerrrOr5rrr8r7rrrr) r'r^rr{rYrrrVrErrre)r7rrr;r;r<$test_typeddict_special_keyword_namesjsz3TypedDictTests.test_typeddict_special_keyword_namescCs|ttWdn1s(0Y|ttWdn1sX0Y|t"tddtfgdWdn1s0Y|ttdttdWdn1s0Y|t"tdttddWdn1s 0YdS)Nrr)rrrr)r)rPrQr'rr{rYrSr;r;r<test_typeddict_create_errorsvs & $ 0 , z+TypedDictTests.test_typeddict_create_errorscCs~tdttd}|tjd|ddd}|tti|Wdn1sT0Y|tt||Wdn1s0Y|ttt |Wdn1s0Y|ttdddWdn1s0Y|t"tddtfd gWdn1s00Y|t$tddtfgtd Wdn1sp0YdS) Nrrr@rrZHirr)rrr) r'r{rYrVrFrPrQrRr5rrr;r;r<test_typeddict_errorss  ( ( ( * 2 z$TypedDictTests.test_typeddict_errorscCs|tjd|tjt|tjtttd|tjtf|tj d| tt j t ddd}||dd||ddtddd d}||d d dS) NrrXTrrr[rrhir)rVrrErFrrYr{rrrr>r@r+r)r7Z not_originryr;r;r<test_py36_class_syntax_usages z+TypedDictTests.test_py36_class_syntax_usagecCstdttdatddd}ttjdD]d}t||}t|}| ||| |dddtt|}t|}| |ddd|q*dS)NEmpDrrrr) r'r{rYrrrrrrrV)r7rrrrZZZZEmpDnewr;r;r<r?s     zTypedDictTests.test_picklecCsFtdttd}|tj|tjd|f|tj|tj |dS)Nrr) r'r{rYrVr@rrrtrr)r7rr;r;r<rszTypedDictTests.test_optionalcCstddtidd}||i||ddddi||jd||jt||jdh|ti|tddd di|tjd|tjt|tjd d hdS) Nr-rFrrrr)rrr)r'rYrVr__required_keys__r__optional_keys__rrr;r;r< test_totalszTypedDictTests.test_totalcCsBGdddtdd}|jtddgks*J|jtdgks>JdS)Nc@seZdZUeed<dS)z6TypedDictTests.test_optional_keys..Point2Dor3DrNrr;r;r;r< Point2Dor3Ds rFrrrr)rrrr)r7rr;r;r<test_optional_keyssz!TypedDictTests.test_optional_keyscCsGdddt}Gddd|dd}Gddd|}|jtd gksHJ|jtgksZJ|jd tikslJ|jtd gksJ|jtd d gksJ|jtttd ksJ|jtd d gksJ|jtd d gksJ|jttttdksJdS)Nc@seZdZUeed<dS)z8TypedDictTests.test_keys_inheritance..BaseAnimalrNrr;r;r;r< BaseAnimals rc@seZdZUeed<eed<dS)z4TypedDictTests.test_keys_inheritance..AnimalvoicetailN)rErFrGr{rrr;r;r;r<Animals rFrc@seZdZUeed<dS)z1TypedDictTests.test_keys_inheritance..Cat fur_colorNrr;r;r;r<Cats rrrr)rrrr)rrrr)r'rrrrr{r)r7rrrr;r;r<test_keys_inheritances* z$TypedDictTests.test_keys_inheritancecCs |tttjttddS)Nr)rVrrr@rrYrSr;r;r<test_get_type_hintssz"TypedDictTests.test_get_type_hintscCsrGdddt}|t}||j|||jd||jtf|dd}|t|t||ddidS)Nc@seZdZUeed<dS)z5TypedDictTests.test_non_generic_subscript..TDrN)rErFrGr rr;r;r;r<rs rr;rrr) r'rYrVrxrvrurwr^r)r7rr\rr;r;r<test_non_generic_subscripts z)TypedDictTests.test_non_generic_subscriptN)rErFrGrrrrrrr?rrrrrrr;r;r;r<rKs     rc@s,eZdZddZddZddZddZd S) IOTestscCs.ttddd}|jd}||jtfdS)NrcSs|Sr?readlinerr;r;r<rszIOTests.test_io..stuffr)r)r rrVrvr7rrr;r;r<test_ios zIOTests.test_iocCs,ttddd}|jd}||jddS)NrcSs|Sr?rrr;r;r<r sz"IOTests.test_textio..stuffrr;)r*r{rrVrvrr;r;r< test_textios zIOTests.test_textiocCs,ttddd}|jd}||jddS)NrcSs|Sr?rrr;r;r<rsz$IOTests.test_binaryio..stuffrr;)r+r|rrVrvrr;r;r< test_binaryios zIOTests.test_binaryiocCsnddlm}m}m}m}m}||tj||tj||tj|t |t gd||ddS)Nr)r)r*r+r:rEr(z typing.io) Z typing.ior)r*r+r:rErwr@rVre)r7r)r*r+r:rEr;r;r<test_io_submodules zIOTests.test_io_submoduleN)rErFrGrrrrr;r;r;r<rsrc@s<eZdZddZddZddZddZd d Zd d Zd S)RETestscCstdtj}||jt|t|t||t|d}||jt |t|t ||t tt t t ft t t t fdS)Nz[a-z]+z12345abcde.....) rKcompilerr=rr,r^rksearchr-rr{r|)r7patZmatr;r;r<r#s   zRETests.test_basicscCsP|tttt|tttt|tttt|tttdSr?)rVr,r{rtr|r-rSr;r;r<test_alias_equality2szRETests.test_alias_equalitycCsttttf}|t|tWdn1s80Y|ttdttWdn1sp0Y|t"tttttWdn1s0YdSrN) r-rr{r|rPrQrRr,r5)r7mr;r;r<rZ8s & , zRETests.test_errorscCst|ttd|tttd|tttd|ttd|tttd|tttddS)Nztyping.Patternztyping.Pattern[str]ztyping.Pattern[bytes]z typing.Matchztyping.Match[str]ztyping.Match[bytes])rVrWr,r{r|r-rSr;r;r<rXCs zRETests.test_reprcCs\ddlm}m}m}m}||tj||tj|t|tddg||ddS)Nr)r-r,r:rEr-r,z typing.re) Z typing.rer-r,r:rErwr@rVre)r7r-r,r:rEr;r;r<test_re_submoduleKs zRETests.test_re_submodulecCsR|t"}Gdddtj}Wdn1s20Y|t|jddS)Nc@s eZdZdS)z'RETests.test_cannot_subclass..ANrIr;r;r;r<r\Usr\z.type 're.Match' is not an acceptable base type)rPrQr@r-rVr{ exception)r7exr\r;r;r<r`Rs  0 zRETests.test_cannot_subclassN) rErFrGrrrZrXr r`r;r;r;r<r s  rc@seZdZddZddZddZddZd d Zd d Zd dZ ddZ ddZ ddZ ddZ ddZdd ZddZddZddZd d!Zd"d#Zd$d%Zd&d'Zd(S))AnnotatedTestscCs6|tdtWdn1s(0YdS)Nz%Type Annotated cannot be instantiatedr3rQr.rSr;r;r<test_new^s zAnnotatedTests.test_newcCs<|tttddfd|ttttddfddS)Nrrztyping.Annotated[int, 4, 5]z(typing.Annotated[typing.List[int], 4, 5])rVrWr.rYrrSr;r;r<rXeszAnnotatedTests.test_reprcCsJtttdfdf}||ttddf||jd||jtdS)Nrrr)r.rYrV __metadata__rxr_r;r;r<roszAnnotatedTests.test_flattencCstttdf}tttdf}||ttttdf||tjd||tjtt|t|tWdn1s0Y|t|tt fWdn1s0YdS)N my decoration)r) r.rr rYrVrrxrPrQr)r7LLIr;r;r<test_specializeus & zAnnotatedTests.test_specializecCs|tttddfttddfhd|ttddfttddf|ttddfttddf|ttdfttddf|ttddfttddfttddfhttddfttddfhdSNrrrrVrr.rYrtr{r rSr;r;r< test_hash_eqs(  &zAnnotatedTests.test_hash_eqcs^Gfdddtdf}|d}d}|||||j|j||j|jdS)Ncs$eZdZdZddZfddZdS)z*AnnotatedTests.test_instantiate..CrcSs ||_dSr?rrbr;r;r<rsz3AnnotatedTests.test_instantiate..C.__init__cst|stS|j|jkSr?)rRNotImplementedrrrr;r<__eq__s z1AnnotatedTests.test_instantiate..C.__eq__N)rErFrGclassvarrrr;rr;r<rsr a decorationr)r.rVrr)r7r\rrr;rr<test_instantiates  zAnnotatedTests.test_instantiatecCsNttjtdf}||gdddd||tgdddddS)Nr)rrrrrr)r.r@rar rVrY)r7ZMyCountr;r;r<test_instantiate_genericsz'AnnotatedTests.test_instantiate_genericcCs>td}|t|dWdn1s00YdS)N)rYrrr)r.rPrQr_r;r;r<test_cannot_instantiate_forwards z.AnnotatedTests.test_cannot_instantiate_forwardcCsBttdf}|t|dWdn1s40YdS)Nrr)r.r rPrQr_r;r;r< test_cannot_instantiate_type_vars  z/AnnotatedTests.test_cannot_instantiate_type_varcCs<|tttdfjWdn1s.0YdS)N)rr)rPrr.r rrSr;r;r<test_cannot_getattr_typevars z*AnnotatedTests.test_cannot_getattr_typevarcCs@Gddd}t|df}||jdd|_||jddS)Nc@seZdZdZdS)z/AnnotatedTests.test_attr_passthrough..CrN)rErFrGrr;r;r;r<rsrrrr)r.rVrr)r7rr\r;r;r<test_attr_passthroughs  z$AnnotatedTests.test_attr_passthroughcCsJGddd}|t|tdtt|t|tdttdS)Nc@s>eZdZUdZeeedfed<dZee edfed<dS)z7AnnotatedTests.test_special_form_containment..Crrrr%rN) rErFrGrr.rrYrrrr;r;r;r<rs rrr)rVrrrrYrrr;r;r<test_special_form_containmentsz,AnnotatedTests.test_special_form_containmentcCs|tttddfttddfhd|ttddfttddf|ttddfttddf|ttdfttddf|ttddfttddfttddfhttddfttddfhdSrrrSr;r;r<rs(  &cCs@|td Gdddt}Wdn1s20YdS)NzCannot subclass .*Annotatedc@s eZdZdS)z.AnnotatedTests.test_cannot_subclass..CNrIr;r;r;r<rsrrrr;r;r<r`sz#AnnotatedTests.test_cannot_subclasscCs@|t"tdttdfWdn1s20YdS)Nrpositive)rPrQrRr.rYrSr;r;r<test_cannot_check_instances z)AnnotatedTests.test_cannot_check_instancecCs@|t"ttttdfWdn1s20YdS)Nr$)rPrQr5rYr.rSr;r;r<test_cannot_check_subclasss z)AnnotatedTests.test_cannot_check_subclasscCs8|tdttWdn1s*0YdS)Nzat least two arguments)r3rQr.rYrSr;r;r<test_too_few_type_argssz%AnnotatedTests.test_too_few_type_argsc Cs6tjtjttftjtttdftjtgtfg}|D]t}t |df}t t j dD]T}|j ||d2t ||}t |}|||WdqV1s0YqVq8Gdddttat ttdf}d|_d |_t t j dD]D}t ||} t | }||jd||jd ||jdqdS) N.rr)protocolr^c@seZdZdZdS)_Annotated_test_GrNrOr;r;r;r<r)sr)z A decorationrOr>)r@rrrYr{rrrr|r.rrrrrrrVrr r)rrr) r7r>rrZprotZpickledZrestoredrjrrr;r;r<r?s*   .  zAnnotatedTests.test_picklecCsd}d}tt|f}||ttt|f||tt|ftt||fttt|f}||tttt|f|t|ttfWdn1s0Y|||tttt||fttjt t f|f}||t tfttjt tf|f|t|tWdn1s80Ytt|f}|t|dWdn1sx0Y|t}|t|dWdn1s0YdS)Nrzanother decoration) r.r rVrYrrPrQr@rr rr{)r7rZdec2rrr-ZItrr;r;r< test_substs( " *"& (  ( zAnnotatedTests.test_substcCs0tttdf}||ttttdfdS)Nr)rr.r rVrYrqr;r;r<test_annotated_in_other_typessz,AnnotatedTests.test_annotated_in_other_typesN)rErFrGrrXrrrrrrr r!r"r#r`r%r&r'r?r*r+r;r;r;r<r \s(     r c@s eZdZdZddZddZdS)AllTestszTests for __all__.cCsddlm}|d||d||d||d||d||d||d ||d ||d ||d ||d ||d||d|dS)Nr)r:r= ValuesViewrrrriorKosrTextrr)r@r:rrrdr;r;r<test_alls             zAllTests.test_allcs4ttjfddttD}||dS)Ncsnh|]f\}}|vsf|ds|tjjvr|tjjvr|dvr|ds||kst|ddtjkr|qS)_>r.rK)rZ_contraZ_corFN) rwr@r.r:rKrupperr8rErZ actual_allr;r< 7s     z3AllTests.test_all_exported_names..)rer@r:varsrZassertSetEqual)r7Z computed_allr;r4r<test_all_exported_names5s    z AllTests.test_all_exported_namesN)rErFrG__doc__r1r7r;r;r;r<r,sr,__main__)rrrrKrZunittestrrrrrrr@rr r r r r rrrrrrrrrrrrrrrrrrr r!r"r$r%r&r'r)r*r+r,r-r.r/r>rLr.rr0r1r2rHrJrKrLrMrcrirrrrr{r|rrrrrrrrrrrr$r%r'r(r*rr{rrrrZ ASYNCIO_TESTSr ImportErrorrrrrrrrr\r@rrjrrrrrrrrrrrrrrYrrr=rBerrrrr,r5rrrrrrrr r,rEr;r;r;r<s       *"Y*H^  '9(1u$   * >F_'3#<A0