§ x<ˆj ãó^—ddlZddlmZddlmZGd„de¦«ZGd„de¦«ZdS)éN)Úchecker)ÚTestCasecó@—eZdZdZed„¦«Zd„Zd„Zd„Zd„Z dS)ÚTypeableVisitorTestsz& Tests of L{_TypeableVisitor} có~—tj|¦«}tj¦«}| |¦«|S)zV Run L{_TypeableVisitor} on the parsed source and return the visitor. )ÚastÚparserÚ_TypeableVisitorÚvisit)ÚsÚtreeÚvisitors úl/builddir/build/BUILD/cloudlinux-venv-1.0.12/venv/lib/python3.11/site-packages/pyflakes/test/test_checker.pyÚ _run_visitorz!TypeableVisitorTests._run_visitor s6€õ Œy˜‰|Œ|ˆÝÔ*Ñ,Ô,ˆØ� Š �dÑÔÐØˆócó—| d¦«}| |jgd¢¦«| |jdt j¦«| |jdt j¦«| |jdt j¦«| |jdt j ¦«dS)zA Test that the typeable node types are collected z�x = 1 # assignment for x in range(1): pass # for loop def f(): pass # function definition with a as b: pass # with statement )éééérrrrN) rÚ assertEqualÚtypeable_linesÚassertIsInstanceÚtypeable_nodesrÚAssignÚForÚ FunctionDefÚWith©Úselfrs rÚtest_node_typesz$TypeableVisitorTests.test_node_typessÀð×#Ò#ð ñ ô ˆð ×Ò˜Ô/°°°Ñ>Ô>Ð>Ø ×Ò˜gÔ4°QÔ7½¼ÑDÔDÐDØ ×Ò˜gÔ4°QÔ7½¼ÑAÔAÐAØ ×Ò˜gÔ4°QÔ7½¼ÑIÔIÐIØ ×Ò˜gÔ4°QÔ7½¼ÑBÔBÐBÐBÐBrcó—| d¦«}| |jddg¦«| |jdt j¦«| |jdt j¦«dS)zƒ Test the common pitfall of missing `generic_visit` in visitors by ensuring that nested nodes are reported zdef f(): x = 1 rrN)rrrrrrrrrs rÚtest_visitor_recursesz*TypeableVisitorTests.test_visitor_recurses(sƒ€ð ×#Ò#ð ñ ô ˆð ×Ò˜Ô/°!°Q°Ñ8Ô8Ð8Ø ×Ò˜gÔ4°QÔ7½¼ÑIÔIÐIØ ×Ò˜gÔ4°QÔ7½¼ÑDÔDÐDÐDÐDrcól—| d¦«}| |jgd¢¦«| |jdt j¦«| |jdt j¦«| |jdt j¦«dS)z@ Test that the PEP 492 node types are collected zoasync def f(): # async def async for x in y: pass # async for async with a as b: pass # async with )rrrrrrN) rrrrrrÚAsyncFunctionDefÚAsyncForÚ AsyncWithrs rÚtest_py35_node_typesz)TypeableVisitorTests.test_py35_node_types7s¤€ð×#Ò#ð ñ ô ˆð ×Ò˜Ô/°°°Ñ;Ô;Ð;Ø ×Ò˜gÔ4°QÔ7½Ô9MÑNÔNÐNØ ×Ò˜gÔ4°QÔ7½¼ÑFÔFÐFØ ×Ò˜gÔ4°QÔ7½¼ÑGÔGÐGÐGÐGrcóÌ—| d¦«}| |jddg¦«| |jdjdjd¦«dS)ún Test that when two typeable nodes are present on a line, the last typeable one wins. z x = 1; y = 1rrÚyN)rrrrÚtargetsÚidrs rÚtest_last_node_winsz(TypeableVisitorTests.test_last_node_winsGsc€ð ×#Ò# NÑ3Ô3ˆà ×Ò˜Ô/°!°Q°Ñ8Ô8Ð8à ×Ò˜Ô/°Ô2Ô:¸1Ô=Ô@À#ÑFÔFÐFÐFÐFrN) Ú__name__Ú __module__Ú __qualname__Ú__doc__Ú staticmethodrr!r#r(r.©rrrrsƒ€€€€€ðððððñ„\ððCðCðCð$ Eð Eð EðHðHðHð Gð Gð Gð Gð Grrcój—eZdZdZed„¦«Zd„Zd„Zd„Zd„Z d„Z d„Z d „Z d „Z d „Zd „Zd „ZdS)ÚCollectTypeCommentsTestsz, Tests of L{_collect_type_comments} có¸—tj|¦«}tj|¦«}tj||¦«}d„| ¦«D¦«S)zÒ Run L{_collect_type_comments} on the parsed source and return the mapping from nodes to comments. The return value is converted to a set: {(node_type, tuple of comments), ...} cód—h|]-\}}t|¦«td„|D¦«¦«f’Œ.S)c3ó K—|] \}}|V—Œ dS)Nr4)Ú.0Ú_r s rú z>CollectTypeCommentsTests._collect...bs&èè€Ð0Ð0¡d a¨ Ð0Ð0Ð0Ð0Ð0Ð0r)ÚtypeÚtuple)r:ÚkÚvs rú z4CollectTypeCommentsTests._collect..bs>€ÐJÐJÐJ±d°a¸•�a‘”�%Ð0Ð0¨aÐ0Ñ0Ô0Ñ0Ô0Ð1ÐJÐJÐJr)rr rÚ make_tokensÚ_collect_type_commentsÚitems)r r ÚtokensÚrets rÚ_collectz!CollectTypeCommentsTests._collectXsO€õŒy˜‰|Œ|ˆÝÔ$ QÑ'Ô'ˆÝÔ,¨T°6Ñ:Ô:ˆØJÐJ¸c¿iºi¹k¼kÐJÑJÔJÐJrcóv—| d¦«}| |tjdfh¦«dS)z@ Test that the function works for binary source sx = 1 # type: int©ú # type: intN©rGÚassertSetEqualrr©r rFs rÚ test_bytesz#CollectTypeCommentsTests.test_bytesds=€ð�mŠmÐ1Ñ2Ô2ˆØ ×Ò˜C¥3¤:Ð/?Ð"@Ð!AÑBÔBÐBÐBÐBrcóv—| d¦«}| |tjdfh¦«dS)z> Test that the function works for text source zx = 1 # type: intrIN)rGrrrrMs rÚ test_textz"CollectTypeCommentsTests.test_textks=€ð�mŠmÐ0Ñ1Ô1ˆØ ×Ò˜¥¤ Ð,<Ð=Ð>Ñ?Ô?Ð?Ð?Ð?rcót—| d¦«}| |t¦«¦«dS)z9 Test that a non-type comment is ignored z x = 1 # noqaN©rGrLÚsetrMs rÚtest_non_type_comment_ignoredz6CollectTypeCommentsTests.test_non_type_comment_ignoredrs5€ð�mŠm˜OÑ,Ô,ˆØ ×Ò˜C¥¡¤Ñ'Ô'Ð'Ð'Ð'rcót—| d¦«}| |t¦«¦«dS)zP Test that a type comment before something typeable is ignored. z# type: int x = 1NrRrMs rÚ!test_type_comment_before_typeablez:CollectTypeCommentsTests.test_type_comment_before_typeableys6€ð�mŠmÐ0Ñ1Ô1ˆØ ×Ò˜C¥¡¤Ñ'Ô'Ð'Ð'Ð'rcót—| d¦«}| |t¦«¦«dS)zH Test that `# type: ignore` comments are not collected. zx = 1 # type: ignoreNrRrMs rÚ test_type_ignore_comment_ignoredz9CollectTypeCommentsTests.test_type_ignore_comment_ignored€s6€ð�mŠmÐ3Ñ4Ô4ˆØ ×Ò˜C¥¡¤Ñ'Ô'Ð'Ð'Ð'rcóâ—| d¦«}| |t¦«¦«| d¦«}| |t¦«¦«dS)zg Test that `# type: ignore` comments with more content are also not collected. zx = 1 # type: ignore # noqazx = 1 #type:ignore#noqaNrRrMs rÚ*test_type_ignore_with_other_things_ignoredzCCollectTypeCommentsTests.test_type_ignore_with_other_things_ignored‡sb€ð �mŠmÐ:Ñ;Ô;ˆØ ×Ò˜C¥¡¤Ñ'Ô'Ð'Ø�mŠmÐ6Ñ7Ô7ˆØ ×Ò˜C¥¡¤Ñ'Ô'Ð'Ð'Ð'rcóv—| d¦«}| |tjdfh¦«dS)Nzx = 1 # type: int # noqa)z# type: int # noqarKrMs rÚ,test_type_comment_with_extra_still_collectedzECollectTypeCommentsTests.test_type_comment_with_extra_still_collected‘s;€Ø�mŠmÐ8Ñ9Ô9ˆØ ×Ò˜C¥3¤:Ð/GÐ"HÐ!IÑJÔJÐJÐJÐJrcóv—| d¦«}| |tjdfh¦«dS)Nzx = 1 #type:int)z #type:intrKrMs rÚ$test_type_comment_without_whitespacez=CollectTypeCommentsTests.test_type_comment_without_whitespace•s:€Ø�mŠmÐ-Ñ.Ô.ˆØ ×Ò˜C¥3¤:¨~Ð">Ð!?Ñ@Ô@Ð@Ð@Ð@rcót—| d¦«}| |t¦«¦«dS)Nzx = 1 # type: ignore[T]rRrMs rÚ)test_type_comment_starts_with_word_ignorezBCollectTypeCommentsTests.test_type_comment_starts_with_word_ignore™s4€Ø�mŠmÐ5Ñ6Ô6ˆØ ×Ò˜C¥¡¤Ñ'Ô'Ð'Ð'Ð'rcóv—| d¦«}| |tjdfh¦«dS)r*zdef f(): x = 1 # type: intrINrKrMs rr.z,CollectTypeCommentsTests.test_last_node_wins�s=€ð �mŠmÐ9Ñ:Ô:ˆØ ×Ò˜C¥3¤:Ð/?Ð"@Ð!AÑBÔBÐBÐBÐBrcóz—| d¦«}tjdfh}| ||¦«dS)zw Test that type comments for function arguments are all attributed to the function definition. z]def f( a, # type: int b, # type: str ): # type: (...) -> None pass )rJz # type: strz# type: (...) -> NoneN)rGrrrL)r rFÚexpecteds rÚ#test_function_def_assigned_commentszrgs«ðØ € € € àÐÐÐÐÐØ*Ð*Ð*Ð*Ð*Ð*ðIGðIGðIGðIGðIG˜8ñIGôIGðIGðXe+ðe+ðe+ðe+ðe+˜xñe+ôe+ðe+ðe+ðe+r