
    j                     R    S SK Jr  S SKJrJrJrJrJrJ	r	  S SK
Jr   " S S\5      rg)    )messages)FunctionScope
ClassScopeModuleScopeArgumentFunctionDefinition
Assignment)TestCasec                   6    \ rS rSrSrS rS rS rS rS r	Sr
g	)
TestCodeSegments   z 
Tests for segments of a module
c                 b    U R                  SSS9  U R                  S[        R                  SS9  g )NzH
        def foo():
            def bar():
                pass
        T
is_segmentzI
        def foo():
            def bar():
                x = 0
        flakesmUnusedVariableselfs    W/var/www/html/KUNJ/venv/lib/python3.13/site-packages/pyflakes/test/test_code_segment.pytest_function_segment&TestCodeSegments.test_function_segment   B      	 	 	 	  $	 	 	0    c                 b    U R                  SSS9  U R                  S[        R                  SS9  g )NzH
        class Foo:
            class Bar:
                pass
        Tr   zI
        class Foo:
            def bar():
                x = 0
        r   r   s    r   test_class_segment#TestCodeSegments.test_class_segment   r   r   c                 P   U R                  SSS9nUR                  nU Vs/ s H  o3R                  [        L d  M  UPM     nnU Vs/ s H  o3R                  [        L d  M  UPM     nnU Vs/ s H  o3R                  [
        L d  M  UPM     nnU R                  [        U5      S5        U R                  [        U5      S5        U R                  [        U5      S5        US   nUS   nU R                  U[        5        U R                  U[
        5        U R                  SU5        U R                  SU5        U R                  SU5        U R                  S	U5        U R                  S
U5        U R                  SU5        U R                  US   [        5        U R                  US   [        5        U R                  US   [        5        U R                  US	   [        5        U R                  US
   [        5        U R                  US   [        5        g s  snf s  snf s  snf )Nzi
        class Foo:
            x = 0
            def bar(a, b=1, *d, **e):
                pass
        Tr   r      xbarabde)r   
deadScopes	__class__r   r   r   assertEquallenassertIsInstanceassertInr   r	   r   )	r   checkerscopesscopemodule_scopesclass_scopesfunction_scopesclass_scopefunction_scopes	            r   test_scope_class!TestCodeSegments.test_scope_class&   s   ++ 
    ##%I%eK)GEv 	 I  &H%eJ)FEv 	 H  &K%eM)IEv 	 K
 	]+Q/\*A._-q1"1o(+k:6nm<c;'e[)c>*c>*c>*c>*k%02DEk#.
;nS18<nS18<nS18<nS18<CIHKs"   HHH!H-H#H#c                    U R                  SSS9nUR                  nU Vs/ s H  o3R                  [        L d  M  UPM     nnU Vs/ s H  o3R                  [        L d  M  UPM     nnU R                  [        U5      S5        U R                  [        U5      S5        US   nUS   nU R                  U[        5        U R                  U[        5        U R                  SU5        U R                  SU5        U R                  S	U5        U R                  S
U5        U R                  SU5        U R                  SU5        U R                  SU5        U R                  SU5        U R                  SU5        U R                  US   [        5        U R                  US   [        5        U R                  US   [        5        U R                  US	   [        5        U R                  US
   [        5        U R                  US   [        5        U R                  US   [        5        U R                  US   [        5        U R                  US   [        5        g s  snf s  snf )Nzf
        def foo(a, b=1, *d, **e):
            def bar(f, g=1, *h, **i):
                pass
        Tr   r      r    r#   r$   r%   r&   r"   fghi)r   r'   r(   r   r   r)   r*   r+   r,   r   r   )r   r-   r.   r/   r0   r2   function_scope_foofunction_scope_bars           r   test_scope_function$TestCodeSegments.test_scope_functionR   s;   ++  	   ##%I%eK)GEv 	 I  &K%eM)IEv 	 K
 	]+Q/_-q1,Q/,Q/0-@0-@c-.c-.c-.c-.e/0c-.c-.c-.c-.079KL05x@05x@05x@05x@05x@05x@05x@05x@IIKs   III!Ic                 $    U R                  SSS9  g )Nzasync def foo(): passTr   )r   r   s    r   test_scope_async_function*TestCodeSegments.test_scope_async_function   s    +=r    N)__name__
__module____qualname____firstlineno____doc__r   r   r5   r?   rB   __static_attributes__rD   r   r   r   r      s#    00*=X,A\>r   r   N)pyflakesr   r   pyflakes.checkerr   r   r   r   r   r	   pyflakes.test.harnessr
   r   rD   r   r   <module>rN      s%    "H H *z>x z>r   