ó
    ÞÅŸgËÅ  ã                   ó¢   • S r SSKJr  SSKJr  SSKJrJrJ	r	   " S S\5      r
 " S S\5      r " S	 S
\5      r " S S\5      r " S S\5      rg)z&
Tests for various Pyflakes behavior.
é    )Úversion_info)Úmessages)ÚTestCaseÚskipÚskipIfc                   óh  • \ rS rSrS rS rS rS rS rS r	S r
S	 rS
 rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS r S r!S  r"S! r#S" r$S# r%S$ r&S% r'S& r(S' r)S( r*\+" S)5      S* 5       r,S+ r-S, r.S- r/S. r0S/ r1S0 r2S1 r3S2 r4S3 r5S4 r6S5 r7S6 r8S7 r9S8r:g9):ÚTesté   c                 óD   • U R                  S[        R                  5        g )Nzdef fu(bar, bar): pass)ÚflakesÚmÚDuplicateArgument©Úselfs    ÚY/var/www/blue/EV-Temp_rev04/venv/lib/python3.13/site-packages/pyflakes/test/test_other.pyÚtest_duplicateArgsÚTest.test_duplicateArgs   s   € Ø�‰Ð,¬a×.AÑ.AÕBó    c                 ób   • U R                  S[        R                  [        R                  5        g )NzG
        a = 1
        def f():
            a; a=1
        f()
        )r   r   ÚUndefinedLocalÚUnusedVariabler   s    r   Ú$test_localReferencedBeforeAssignmentÚ)Test.test_localReferencedBeforeAssignment   s&   € Ø�‰ð ô
 ×Ñœq×/Ñ/õ	1r   c                 óÌ   • U R                  S5        U R                  S5        U R                  S[        R                  5        U R                  S5        U R                  S5        g)zG
Test that reusing a variable in a generator does not raise
a warning.
z8
        a = 1
        (1 for a, b in [(1, 2)])
        zU
        class A:
            a = 1
            list(1 for a, b in [(1, 2)])
        zQ
        def f():
            a = 1
            (1 for a, b in [(1, 2)])
        zK
        (1 for a, b in [(1, 2)])
        (1 for a, b in [(1, 2)])
        zY
        for a, b in [(1, 2)]:
            pass
        (1 for a, b in [(1, 2)])
        N©r   r   r   r   s    r   Útest_redefinedInGeneratorÚTest.test_redefinedInGenerator   ól   € ð
 	�‰ð ô 	ð 	�‰ð ô 	ð
 	�‰ð ô ×Ñô		ð
 	�‰ð ô 	ð 	�‰ð õ 	r   c                 óÌ   • U R                  S5        U R                  S5        U R                  S[        R                  5        U R                  S5        U R                  S5        g)zO
Test that reusing a variable in a set comprehension does not raise
a warning.
z8
        a = 1
        {1 for a, b in [(1, 2)]}
        zQ
        class A:
            a = 1
            {1 for a, b in [(1, 2)]}
        zQ
        def f():
            a = 1
            {1 for a, b in [(1, 2)]}
        zK
        {1 for a, b in [(1, 2)]}
        {1 for a, b in [(1, 2)]}
        zY
        for a, b in [(1, 2)]:
            pass
        {1 for a, b in [(1, 2)]}
        Nr   r   s    r   Ú test_redefinedInSetComprehensionÚ%Test.test_redefinedInSetComprehension5   r   r   c                 óÌ   • U R                  S5        U R                  S5        U R                  S[        R                  5        U R                  S5        U R                  S5        g)zP
Test that reusing a variable in a dict comprehension does not raise
a warning.
z<
        a = 1
        {1: 42 for a, b in [(1, 2)]}
        zU
        class A:
            a = 1
            {1: 42 for a, b in [(1, 2)]}
        zU
        def f():
            a = 1
            {1: 42 for a, b in [(1, 2)]}
        zS
        {1: 42 for a, b in [(1, 2)]}
        {1: 42 for a, b in [(1, 2)]}
        z]
        for a, b in [(1, 2)]:
            pass
        {1: 42 for a, b in [(1, 2)]}
        Nr   r   s    r   Ú!test_redefinedInDictComprehensionÚ&Test.test_redefinedInDictComprehensionR   r   r   c                 óD   • U R                  S[        R                  5        g)zN
Test that shadowing a function definition with another one raises a
warning.
z5
        def a(): pass
        def a(): pass
        N©r   r   ÚRedefinedWhileUnusedr   s    r   Útest_redefinedFunctionÚTest.test_redefinedFunctiono   s    € ð
 	�‰ð ô ×#Ñ#õ	%r   c                 óD   • U R                  S[        R                  5        g )Nz-
        x = 1
        def x(): pass
        r&   r   s    r   Ú(test_redefined_function_shadows_variableÚ-Test.test_redefined_function_shadows_variabley   s   € Ø�‰ð ô ×#Ñ#õ	%r   c                 ó&   • U R                  S5        g)zY
Test that shadowing a function definition named with underscore doesn't
raise anything.
z5
        def _(): pass
        def _(): pass
        N©r   r   s    r   Ú test_redefinedUnderscoreFunctionÚ%Test.test_redefinedUnderscoreFunction   ó   € ð
 	�‰ð õ 	r   c                 óD   • U R                  S[        R                  5        g)zA
Test that shadowing an underscore importation raises a warning.
z;
        from .i18n import _
        def _(): pass
        Nr&   r   s    r   Ú#test_redefinedUnderscoreImportationÚ(Test.test_redefinedUnderscoreImportation‰   ó    € ð 	�‰ð ô ×#Ñ#õ	%r   c                 óD   • U R                  S[        R                  5        g)z_
Test that shadowing a function definition in a class suite with another
one raises a warning.
zN
        class A:
            def a(): pass
            def a(): pass
        Nr&   r   s    r   Útest_redefinedClassFunctionÚ Test.test_redefinedClassFunction’   ó    € ð
 	�‰ð ô ×#Ñ#õ		%r   c                 ó&   • U R                  S5        g)zc
Test that shadowing a function definition twice in an if
and else block does not raise a warning.
z\
        if True:
            def a(): pass
        else:
            def a(): pass
        Nr.   r   s    r   Útest_redefinedIfElseFunctionÚ!Test.test_redefinedIfElseFunction�   ó   € ð
 	�‰ð õ 	r   c                 óD   • U R                  S[        R                  5        g)zP
Test that shadowing a function definition within an if block
raises a warning.
zN
        if True:
            def a(): pass
            def a(): pass
        Nr&   r   s    r   Útest_redefinedIfFunctionÚTest.test_redefinedIfFunction©   r9   r   c                 ó&   • U R                  S5        g)zc
Test that shadowing a function definition twice in try
and except block does not raise a warning.
zZ
        try:
            def a(): pass
        except:
            def a(): pass
        Nr.   r   s    r   Útest_redefinedTryExceptFunctionÚ$Test.test_redefinedTryExceptFunction´   r=   r   c                 óD   • U R                  S[        R                  5        g)zP
Test that shadowing a function definition within a try block
raises a warning.
zk
        try:
            def a(): pass
            def a(): pass
        except:
            pass
        Nr&   r   s    r   Útest_redefinedTryFunctionÚTest.test_redefinedTryFunctionÀ   s    € ð
 	�‰ð ô ×#Ñ#õ	%r   c                 ó&   • U R                  S5        g)zj
Test that shadowing a variable in a list comprehension in
an if and else block does not raise a warning.
zY
        if False:
            a = 1
        else:
            [a for a in '12']
        Nr.   r   s    r   Útest_redefinedIfElseInListCompÚ#Test.test_redefinedIfElseInListCompÍ   r=   r   c                 ó&   • U R                  S5        g)zo
Test that shadowing a function definition with a decorated version of
that function does not raise a warning.
zi
        from somewhere import somedecorator

        def a(): pass
        a = somedecorator(a)
        Nr.   r   s    r   Útest_functionDecoratorÚTest.test_functionDecoratorÙ   r=   r   c                 ó&   • U R                  S5        g)z€
Test that shadowing a function definition in a class suite with a
decorated version of that function does not raise a warning.
zS
        class A:
            def a(): pass
            a = classmethod(a)
        Nr.   r   s    r   Útest_classFunctionDecoratorÚ Test.test_classFunctionDecoratorå   ó   € ð
 	�‰ð õ 	r   c                 ó&   • U R                  S5        g )Nzî
        class A:
            @property
            def t(self):
                pass
            @t.setter
            def t(self, value):
                pass
            @t.deleter
            def t(self):
                pass
        r.   r   s    r   Útest_modernPropertyÚTest.test_modernPropertyð   s   € Ø�‰ð õ 	r   c                 ó&   • U R                  S5        g)zDon't die on unary +.z+1Nr.   r   s    r   Útest_unaryPlusÚTest.test_unaryPlusþ   s   € à�‰�DÕr   c                 óD   • U R                  S[        R                  5        g)zV
If a name in the base list of a class definition is undefined, a
warning is emitted.
z2
        class foo(foo):
            pass
        N©r   r   ÚUndefinedNamer   s    r   Útest_undefinedBaseClassÚTest.test_undefinedBaseClass  ó   € ð
 	�‰ð ô �_‰_õ	r   c                 óD   • U R                  S[        R                  5        g)z{
If a class name is used in the body of that class's definition and
the name is not already defined, a warning is emitted.
z,
        class foo:
            foo
        NrX   r   s    r   Ú"test_classNameUndefinedInClassBodyÚ'Test.test_classNameUndefinedInClassBody  r\   r   c                 ó&   • U R                  S5        g)zŽ
If a class name is used in the body of that class's definition and
the name was previously defined in some other way, no warning is
emitted.
z?
        foo = None
        class foo:
            foo
        Nr.   r   s    r   Útest_classNameDefinedPreviouslyÚ$Test.test_classNameDefinedPreviously  s   € ð 	�‰ð õ 	r   c                 óD   • U R                  S[        R                  5        g)zG
If a class is defined twice in the same module, a warning is emitted.
zQ
        class Foo:
            pass
        class Foo:
            pass
        Nr&   r   s    r   Útest_classRedefinitionÚTest.test_classRedefinition"  ó    € ð 	�‰ð ô
 ×#Ñ#õ	%r   c                 óD   • U R                  S[        R                  5        g)z>
If a function is redefined as a class, a warning is emitted.
zQ
        def Foo():
            pass
        class Foo:
            pass
        Nr&   r   s    r   Útest_functionRedefinedAsClassÚ"Test.test_functionRedefinedAsClass-  rf   r   c                 óD   • U R                  S[        R                  5        g)z>
If a class is redefined as a function, a warning is emitted.
zQ
        class Foo:
            pass
        def Foo():
            pass
        Nr&   r   s    r   Útest_classRedefinedAsFunctionÚ"Test.test_classRedefinedAsFunction8  rf   r   c                 óD   • U R                  S[        R                  5        g)z;
If a return is used inside a class, a warning is emitted.
z7
        class Foo(object):
            return
        N©r   r   ÚReturnOutsideFunctionr   s    r   Útest_classWithReturnÚTest.test_classWithReturnC  s    € ð 	�‰ð ô ×$Ñ$õ	&r   c                 óD   • U R                  S[        R                  5        g)z@
If a return is used at the module level, a warning is emitted.
z
        return
        Nrn   r   s    r   Útest_moduleWithReturnÚTest.test_moduleWithReturnL  s   € ð 	�‰ð ä×$Ñ$õ	&r   c                 óD   • U R                  S[        R                  5        g)z:
If a yield is used inside a class, a warning is emitted.
z6
        class Foo(object):
            yield
        N©r   r   ÚYieldOutsideFunctionr   s    r   Útest_classWithYieldÚTest.test_classWithYieldT  r5   r   c                 óD   • U R                  S[        R                  5        g)z?
If a yield is used at the module level, a warning is emitted.
z
        yield
        Nrv   r   s    r   Útest_moduleWithYieldÚTest.test_moduleWithYield]  ó   € ð 	�‰ð ä×#Ñ#õ	%r   c                 óD   • U R                  S[        R                  5        g)z?
If a yield from is used inside a class, a warning is emitted.
zE
        class Foo(object):
            yield from range(10)
        Nrv   r   s    r   Útest_classWithYieldFromÚTest.test_classWithYieldFrome  r5   r   c                 óD   • U R                  S[        R                  5        g)zD
If a yield from is used at the module level, a warning is emitted.
z&
        yield from range(10)
        Nrv   r   s    r   Útest_moduleWithYieldFromÚTest.test_moduleWithYieldFromn  r}   r   c                 ó„  • U R                  S[        R                  5        U R                  S[        R                  5        U R                  S[        R                  5        U R                  S[        R                  5        U R                  S[        R                  5        U R                  S[        R                  5        g )Nz
        continue
        z/
        def f():
            continue
        zQ
        while True:
            pass
        else:
            continue
        z�
        while True:
            pass
        else:
            if 1:
                if 2:
                    continue
        zK
        while True:
            def f():
                continue
        zK
        while True:
            class A:
                continue
        )r   r   ÚContinueOutsideLoopr   s    r   Útest_continueOutsideLoopÚTest.test_continueOutsideLoopv  s²   € Ø�‰ð ä×"Ñ"ô	$ð 	�‰ð ô ×"Ñ"ô	$ð
 	�‰ð ô
 ×"Ñ"ô	$ð 	�‰ð ô ×"Ñ"ô	$ð 	�‰ð ô ×"Ñ"ô		$ð 	�‰ð ô ×"Ñ"õ		$r   c                 óÐ   • U R                  S5        U R                  S5        U R                  S5        U R                  S5        U R                  S5        U R                  S5        g )Nz2
        while True:
            continue
        z:
        for i in range(10):
            continue
        zH
        while True:
            if 1:
                continue
        zP
        for i in range(10):
            if 1:
                continue
        z”
        while True:
            while True:
                pass
            else:
                continue
        else:
            pass
        z‘
        while True:
            try:
                pass
            finally:
                while True:
                    continue
        r.   r   s    r   Útest_continueInsideLoopÚTest.test_continueInsideLoopœ  sr   € Ø�‰ð ô 	ð
 	�‰ð ô 	ð
 	�‰ð ô 	ð 	�‰ð ô 	ð 	�‰ð ô 	ð 	�‰ð õ 	r   c                 óÄ  • U R                  S[        R                  5        U R                  S[        R                  5        U R                  S[        R                  5        U R                  S[        R                  5        U R                  S[        R                  5        U R                  S[        R                  5        U R                  S[        R                  5        g )Nz
        break
        z,
        def f():
            break
        zN
        while True:
            pass
        else:
            break
        z~
        while True:
            pass
        else:
            if 1:
                if 2:
                    break
        zH
        while True:
            def f():
                break
        zH
        while True:
            class A:
                break
        zJ
        try:
            pass
        finally:
            break
        )r   r   ÚBreakOutsideLoopr   s    r   Útest_breakOutsideLoopÚTest.test_breakOutsideLoopÆ  sÐ   € Ø�‰ð ä×Ñô	!ð 	�‰ð ô ×Ñô	!ð
 	�‰ð ô
 ×Ñô	!ð 	�‰ð ô ×Ñô	!ð 	�‰ð ô ×Ñô		!ð 	�‰ð ô ×Ñô		!ð 	�‰ð ô
 ×Ñõ	!r   c                 ó  • U R                  S5        U R                  S5        U R                  S5        U R                  S5        U R                  S5        U R                  S5        U R                  S5        U R                  S5        g )	Nz/
        while True:
            break
        z7
        for i in range(10):
            break
        zE
        while True:
            if 1:
                break
        zM
        for i in range(10):
            if 1:
                break
        z‘
        while True:
            while True:
                pass
            else:
                break
        else:
            pass
        zŽ
        while True:
            try:
                pass
            finally:
                while True:
                    break
        zn
        while True:
            try:
                pass
            finally:
                break
        z¦
        while True:
            try:
                pass
            finally:
                if 1:
                    if 2:
                        break
        r.   r   s    r   Útest_breakInsideLoopÚTest.test_breakInsideLoopó  s˜   € Ø�‰ð ô 	ð
 	�‰ð ô 	ð
 	�‰ð ô 	ð 	�‰ð ô 	ð 	�‰ð ô 	ð 	�‰ð ô 	ð 	�‰ð ô 	ð 	�‰ð õ 	r   c                 óÐ   • U R                  S5        U R                  S5        U R                  S5        U R                  S5        U R                  S5        U R                  S5        g)z£
A default except block should be last.

YES:

try:
    ...
except Exception:
    ...
except:
    ...

NO:

try:
    ...
except:
    ...
except Exception:
    ...
zS
        try:
            pass
        except ValueError:
            pass
        zt
        try:
            pass
        except ValueError:
            pass
        except:
            pass
        zH
        try:
            pass
        except:
            pass
        zr
        try:
            pass
        except ValueError:
            pass
        else:
            pass
        zg
        try:
            pass
        except:
            pass
        else:
            pass
        z“
        try:
            pass
        except ValueError:
            pass
        except:
            pass
        else:
            pass
        Nr.   r   s    r   Útest_defaultExceptLastÚTest.test_defaultExceptLast/  st   € ð, 	�‰ð ô 	ð 	�‰ð ô 	ð 	�‰ð ô 	ð 	�‰ð ô 	ð 	�‰ð ô 	ð 	�‰ð 	õ 		r   c                 ó|  • U R                  S[        R                  5        U R                  S[        R                  5        U R                  S[        R                  5        U R                  S[        R                  [        R                  5        U R                  S[        R                  5        U R                  S[        R                  5        U R                  S[        R                  5        U R                  S[        R                  [        R                  5        U R                  S	[        R                  5        U R                  S
[        R                  5        U R                  S[        R                  5        U R                  S[        R                  [        R                  5        U R                  S[        R                  5        U R                  S[        R                  5        U R                  S[        R                  5        U R                  S[        R                  [        R                  5        g )Nzt
        try:
            pass
        except:
            pass
        except ValueError:
            pass
        zi
        try:
            pass
        except:
            pass
        except:
            pass
        z•
        try:
            pass
        except:
            pass
        except ValueError:
            pass
        except:
            pass
        zÁ
        try:
            pass
        except:
            pass
        except ValueError:
            pass
        except:
            pass
        except ValueError:
            pass
        z“
        try:
            pass
        except:
            pass
        except ValueError:
            pass
        else:
            pass
        zˆ
        try:
            pass
        except:
            pass
        except:
            pass
        else:
            pass
        z´
        try:
            pass
        except:
            pass
        except ValueError:
            pass
        except:
            pass
        else:
            pass
        zà
        try:
            pass
        except:
            pass
        except ValueError:
            pass
        except:
            pass
        except ValueError:
            pass
        else:
            pass
        z–
        try:
            pass
        except:
            pass
        except ValueError:
            pass
        finally:
            pass
        z‹
        try:
            pass
        except:
            pass
        except:
            pass
        finally:
            pass
        z·
        try:
            pass
        except:
            pass
        except ValueError:
            pass
        except:
            pass
        finally:
            pass
        zã
        try:
            pass
        except:
            pass
        except ValueError:
            pass
        except:
            pass
        except ValueError:
            pass
        finally:
            pass
        zµ
        try:
            pass
        except:
            pass
        except ValueError:
            pass
        else:
            pass
        finally:
            pass
        zª
        try:
            pass
        except:
            pass
        except:
            pass
        else:
            pass
        finally:
            pass
        zÖ
        try:
            pass
        except:
            pass
        except ValueError:
            pass
        except:
            pass
        else:
            pass
        finally:
            pass
        a  
        try:
            pass
        except:
            pass
        except ValueError:
            pass
        except:
            pass
        except ValueError:
            pass
        else:
            pass
        finally:
            pass
        )r   r   ÚDefaultExceptNotLastr   s    r   Útest_defaultExceptNotLastÚTest.test_defaultExceptNotLasty  s   € Ø�‰ð ô ×#Ñ#ô	%ð 	�‰ð ô ×#Ñ#ô	%ð 	�‰ð 	ô ×#Ñ#ô		%ð 	�‰ð ô ×#Ñ#¤Q×%;Ñ%;ô	=ð 	�‰ð 	ô ×#Ñ#ô		%ð 	�‰ð 	ô ×#Ñ#ô		%ð 	�‰ð ô ×#Ñ#ô	%ð 	�‰ð ô ×#Ñ#¤Q×%;Ñ%;ô	=ð 	�‰ð 	ô ×#Ñ#ô		%ð 	�‰ð 	ô ×#Ñ#ô		%ð 	�‰ð ô ×#Ñ#ô	%ð 	�‰ð ô ×#Ñ#¤Q×%;Ñ%;ô	=ð 	�‰ð ô ×#Ñ#ô	%ð 	�‰ð ô ×#Ñ#ô	%ð 	�‰ð ô ×#Ñ#ô	%ð 	�‰ð ô ×#Ñ#¤Q×%;Ñ%;õ	=r   c                 ó€  • U R                  S5        U R                  S5        U R                  S5        U R                  S5        U R                  S5        U R                  S5        U R                  S5        U R                  S5        U R                  S	5        S
R                  S [        S5       5       5      S-   nU R                  U5        SS
R                  S [        S5       5       5      -   S-   nU R                  U5        SS
R                  S [        S5       5       5      -   S-   nU R                  U5        g)z&
Python 3 extended iterable unpacking
z#
        a, *b = range(10)
        z#
        *a, b = range(10)
        z&
        a, *b, c = range(10)
        z%
        (a, *b) = range(10)
        z%
        (*a, b) = range(10)
        z(
        (a, *b, c) = range(10)
        z%
        [a, *b] = range(10)
        z%
        [*a, b] = range(10)
        z(
        [a, *b, c] = range(10)
        ú, c              3   ó*   #   • U H
  nS U-  v •  M     g7f©za%dN© ©Ú.0Úis     r   Ú	<genexpr>Ú5Test.test_starredAssignmentNoError.<locals>.<genexpr>k  ó   é € Ð;Ñ): A�e˜a–iÒ):ùó   ‚é€   z, *rest = range(1<<8)Ú(c              3   ó*   #   • U H
  nS U-  v •  M     g7frœ   r�   rž   s     r   r¡   r¢   o  ó   é € ÐAÑ/@¨!˜E AžIÒ/@ùr¤   z, *rest) = range(1<<8)Ú[c              3   ó*   #   • U H
  nS U-  v •  M     g7frœ   r�   rž   s     r   r¡   r¢   s  r¨   r¤   z, *rest] = range(1<<8)N)r   ÚjoinÚrange©r   Úss     r   Útest_starredAssignmentNoErrorÚ"Test.test_starredAssignmentNoErrorB  s=  € ð 	�‰ð ô 	ð 	�‰ð ô 	ð 	�‰ð ô 	ð 	�‰ð ô 	ð 	�‰ð ô 	ð 	�‰ð ô 	ð 	�‰ð ô 	ð 	�‰ð ô 	ð 	�‰ð ô 	ð
 �I‰IÑ;¬¨zÔ):Ó;Ó;Ø#ñ$ˆà�‰�AŒà�$—)‘)ÑA¬u°ZÔ/@ÓAÓAÑAØ$ñ%ˆà�‰�AŒà�$—)‘)ÑA¬u°ZÔ/@ÓAÓAÑAØ$ñ%ˆà�‰�A�r   c                 óŒ  • SR                  S [        S5       5       5      S-   nU R                  U[        R                  5        SSR                  S [        S5       5       5      -   S-   nU R                  U[        R                  5        SSR                  S	 [        S5       5       5      -   S
-   nU R                  U[        R                  5        SR                  S [        S5       5       5      S-   nU R                  U[        R                  5        SSR                  S [        S5       5       5      -   S-   nU R                  U[        R                  5        SSR                  S [        S5       5       5      -   S-   nU R                  U[        R                  5        U R                  S[        R
                  5        U R                  S[        R
                  5        U R                  S[        R
                  5        U R                  S[        R
                  5        U R                  S[        R
                  5        U R                  S[        R
                  5        U R                  S[        R
                  5        U R                  S[        R
                  5        U R                  S[        R
                  5        g)zX
SyntaxErrors (not encoded in the ast) surrounding Python 3 extended
iterable unpacking
rš   c              3   ó*   #   • U H
  nS U-  v •  M     g7frœ   r�   rž   s     r   r¡   Ú4Test.test_starredAssignmentErrors.<locals>.<genexpr>}  s   é € Ð7© A�e˜a–iªùr¤   é   z, *rest = range(1<<8 + 1)r¦   c              3   ó*   #   • U H
  nS U-  v •  M     g7frœ   r�   rž   s     r   r¡   r³   �  ó   é € Ð=©}¨!˜E AžIª}ùr¤   z, *rest) = range(1<<8 + 1)r©   c              3   ó*   #   • U H
  nS U-  v •  M     g7frœ   r�   rž   s     r   r¡   r³   …  r¶   r¤   z, *rest] = range(1<<8 + 1)c              3   ó*   #   • U H
  nS U-  v •  M     g7frœ   r�   rž   s     r   r¡   r³   ‰  r£   r¤   i   z, *rest = range(1<<8 + 2)c              3   ó*   #   • U H
  nS U-  v •  M     g7frœ   r�   rž   s     r   r¡   r³   �  r¨   r¤   z, *rest) = range(1<<8 + 2)c              3   ó*   #   • U H
  nS U-  v •  M     g7frœ   r�   rž   s     r   r¡   r³   ‘  r¨   r¤   z, *rest] = range(1<<8 + 2)z'
        a, *b, *c = range(10)
        z*
        a, *b, c, *d = range(10)
        z(
        *a, *b, *c = range(10)
        z)
        (a, *b, *c) = range(10)
        z,
        (a, *b, c, *d) = range(10)
        z*
        (*a, *b, *c) = range(10)
        z)
        [a, *b, *c] = range(10)
        z,
        [a, *b, c, *d] = range(10)
        z*
        [*a, *b, *c] = range(10)
        N)r«   r¬   r   r   Ú%TooManyExpressionsInStarredAssignmentÚTwoStarredExpressionsr­   s     r   Útest_starredAssignmentErrorsÚ!Test.test_starredAssignmentErrorsw  sO  € ð �I‰IÑ7¬¨v¬Ó7Ó7Ø'ñ(ˆà�‰�A”q×>Ñ>Ô?à�$—)‘)Ñ=¬u°V¬}Ó=Ó=Ñ=Ø(ñ)ˆà�‰�A”q×>Ñ>Ô?à�$—)‘)Ñ=¬u°V¬}Ó=Ó=Ñ=Ø(ñ)ˆà�‰�A”q×>Ñ>Ô?à�I‰IÑ;¬¨zÔ):Ó;Ó;Ø'ñ(ˆà�‰�A”q×>Ñ>Ô?à�$—)‘)ÑA¬u°ZÔ/@ÓAÓAÑAØ(ñ)ˆà�‰�A”q×>Ñ>Ô?à�$—)‘)ÑA¬u°ZÔ/@ÓAÓAÑAØ(ñ)ˆà�‰�A”q×>Ñ>Ô?ð 	�‰ð ä×$Ñ$ô	&ð 	�‰ð ä×$Ñ$ô	&ð 	�‰ð ä×$Ñ$ô	&ð 	�‰ð ä×$Ñ$ô	&ð 	�‰ð ä×$Ñ$ô	&ð 	�‰ð ä×$Ñ$ô	&ð 	�‰ð ä×$Ñ$ô	&ð 	�‰ð ä×$Ñ$ô	&ð 	�‰ð ä×$Ñ$õ	&r   z<todo: Too hard to make this warn but other cases stay silentc                 óD   • U R                  S[        R                  5        g)zL
If a variable is re-assigned to without being used, no warning is
emitted.
z'
        x = 10
        x = 20
        Nr&   r   s    r   Útest_doubleAssignmentÚTest.test_doubleAssignment¾  s    € ð 	�‰ð ô ×#Ñ#õ	%r   c                 ó&   • U R                  S5        g)zK
If a variable is re-assigned within a conditional, no warning is
emitted.
z<
        x = 10
        if True:
            x = 20
        Nr.   r   s    r   Ú"test_doubleAssignmentConditionallyÚ'Test.test_doubleAssignmentConditionallyÉ  rP   r   c                 ó&   • U R                  S5        g)zJ
If a variable is re-assigned to after being used, no warning is
emitted.
z9
        x = 10
        y = x * 2
        x = 20
        Nr.   r   s    r   Útest_doubleAssignmentWithUseÚ!Test.test_doubleAssignmentWithUseÔ  rP   r   c                 ó&   • U R                  S5        g)zi
If a defined name is used on either side of any of the six comparison
operators, no warning is emitted.
z
        x = 10
        y = 20
        x < y
        x <= y
        x == y
        x != y
        x >= y
        x > y
        Nr.   r   s    r   Útest_comparisonÚTest.test_comparisonß  s   € ð
 	�‰ð 	õ 		r   c                 ó&   • U R                  S5        g)zV
If a defined name is used on either side of an identity test, no
warning is emitted.
zI
        x = 10
        y = 20
        x is y
        x is not y
        Nr.   r   s    r   Útest_identityÚTest.test_identityï  r=   r   c                 ó&   • U R                  S5        g)zX
If a defined name is used on either side of a containment test, no
warning is emitted.
zI
        x = 10
        y = 20
        x in y
        x not in y
        Nr.   r   s    r   Útest_containmentÚTest.test_containmentû  r=   r   c                 óH   • U R                  S5        U R                  S5        g)z.
break and continue statements are supported.
z4
        for x in [1, 2]:
            break
        z7
        for x in [1, 2]:
            continue
        Nr.   r   s    r   Útest_loopControlÚTest.test_loopControl  s(   € ð 	�‰ð ô 	ð 	�‰ð õ 	r   c                 ó&   • U R                  S5        g)z#
Ellipsis in a slice is supported.
z
        [1, 2][...]
        Nr.   r   s    r   Útest_ellipsisÚTest.test_ellipsis  ó   € ð 	�‰ð õ 	r   c                 ó&   • U R                  S5        g)z 
Extended slices are supported.
z+
        x = 3
        [1, 2][x,:]
        Nr.   r   s    r   Útest_extendedSliceÚTest.test_extendedSlice  ó   € ð 	�‰ð õ 	r   c                 ó&   • U R                  S5        g)zP
Augmented assignment of a variable is supported.
We don't care about var refs.
z*
        foo = 0
        foo += 1
        Nr.   r   s    r   Útest_varAugmentedAssignmentÚ Test.test_varAugmentedAssignment%  r1   r   c                 ó&   • U R                  S5        g)zQ
Augmented assignment of attributes is supported.
We don't care about attr refs.
z7
        foo = None
        foo.bar += foo.baz
        Nr.   r   s    r   Útest_attrAugmentedAssignmentÚ!Test.test_attrAugmentedAssignment/  r1   r   c                 ó&   • U R                  S5        g)z@
A 'global' can be declared in one scope and reused in another.
zV
        def f(): global foo
        def g(): foo = 'anything'; foo.is_used()
        Nr.   r   s    r   Ú#test_globalDeclaredInDifferentScopeÚ(Test.test_globalDeclaredInDifferentScope9  rÛ   r   c                 óŒ   • U R                  S5        U R                  S5        U R                  S5        U R                  S5        g)z+
Test to traverse ARG and ARGUMENT handler
z1
        def foo(a, b):
            pass
        z6
        def foo(a, b, c=0):
            pass
        z=
        def foo(a, b, c=0, *args):
            pass
        zG
        def foo(a, b, c=0, *args, **kwargs):
            pass
        Nr.   r   s    r   Útest_function_argumentsÚTest.test_function_argumentsB  sN   € ð 	�‰ð ô 	ð
 	�‰ð ô 	ð
 	�‰ð ô 	ð
 	�‰ð õ 	r   c                 ó&   • U R                  S5        g )NzL
        def foo(a, b, c=0, *args, d=0, **kwargs):
            pass
        r.   r   s    r   Útest_function_arguments_python3Ú$Test.test_function_arguments_python3Z  ó   € Ø�‰ð õ 	r   r�   N);Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__r   r   r   r    r#   r(   r+   r/   r3   r7   r;   r?   rB   rE   rH   rK   rN   rR   rU   rZ   r^   ra   rd   rh   rk   rp   rs   rx   r{   r   r‚   r†   r‰   r�   r�   r“   r—   r¯   r½   r   rÀ   rÃ   rÆ   rÉ   rÌ   rÏ   rÒ   rÕ   rÙ   rÝ   rà   rã   ræ   ré   Ú__static_attributes__r�   r   r   r	   r	      s-  † òCò1òò:ò:ò:%ò%òò%ò	%ò
ò	%ò
ò%ò
ò
ò	òòòòò
ò	%ò	%ò	%ò&ò&ò%ò%ò%ò%ò$$òL(òT+!òZ:òxHòTG=òR3òjE&ñN 
Ð
HÓIñ%ó Jð%ò	ò	òò 
ò
òòòòòòòõ0r   r	   c                   ó�  • \ rS rSrSrS rS rS rS r\	" S5      S 5       r
S	 rS
 rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS r S r!S  r"S! r#S" r$S# r%S$ r&S% r'S& r(S' r)S( r*S) r+S* r,\-" \.S+:  S,5      S- 5       r/S. r0S/ r1S0 r2S1 r3S2 r4S3 r5S4 r6S5 r7S6 r8S7 r9S8 r:S9 r;S: r<S; r=S<r>g=)>ÚTestUnusedAssignmentia  z-
Tests for warning about unused assignments.
c                 óD   • U R                  S[        R                  5        g)zK
Warn when a variable in a function is assigned a value that's never
used.
z,
        def a():
            b = 1
        Nr   r   s    r   Útest_unusedVariableÚ(TestUnusedAssignment.test_unusedVariablef  s    € ð
 	�‰ð ô ×Ñõ	r   c                 ó&   • U R                  S5        g)zP
Don't warn when the magic "_" (underscore) variable is unused.
See issue #202.
zC
        def a(unused_param):
            _ = unused_param
        Nr.   r   s    r   Útest_unusedUnderscoreVariableÚ2TestUnusedAssignment.test_unusedUnderscoreVariablep  r1   r   c                 ó&   • U R                  S5        g)z?
Using locals() it is perfectly valid to have unused variables
zH
        def a():
            b = 1
            return locals()
        Nr.   r   s    r   Útest_unusedVariableAsLocalsÚ0TestUnusedAssignment.test_unusedVariableAsLocalsz  ó   € ð 	�‰ð õ 	r   c                 óD   • U R                  S[        R                  5        g)z1
Using locals() in wrong scope should not matter
zq
        def a():
            locals()
            def a():
                b = 1
                return
        Nr   r   s    r   Útest_unusedVariableNoLocalsÚ0TestUnusedAssignment.test_unusedVariableNoLocals„  s    € ð 	�‰ð ô ×Ñõ	r   zAtodo: Difficult because it doesn't apply in the context of a loopc                 óD   • U R                  S[        R                  5        g)zF
Shadowing a used variable can still raise an UnusedVariable warning.
zR
        def a():
            b = 1
            b.foo()
            b = 2
        Nr   r   s    r   Útest_unusedReassignedVariableÚ2TestUnusedAssignment.test_unusedReassignedVariable�  s    € ð
 	�‰ð ô
 ×Ñõ	r   c                 ó&   • U R                  S5        g)z\
Shadowing a used variable cannot raise an UnusedVariable warning in the
context of a loop.
z^
        def a():
            b = True
            while b:
                b = False
        Nr.   r   s    r   Útest_variableUsedInLoopÚ,TestUnusedAssignment.test_variableUsedInLoopœ  r=   r   c                 ó&   • U R                  S5        g)z
Assigning to a global and then not using that global is perfectly
acceptable. Do not mistake it for an unused local variable.
zO
        b = 0
        def a():
            global b
            b = 1
        Nr.   r   s    r   Útest_assignToGlobalÚ(TestUnusedAssignment.test_assignToGlobal¨  r=   r   c                 ó&   • U R                  S5        g)z‚
Assigning to a nonlocal and then not using that binding is perfectly
acceptable. Do not mistake it for an unused local variable.
zW
        b = b'0'
        def a():
            nonlocal b
            b = b'1'
        Nr.   r   s    r   Útest_assignToNonlocalÚ*TestUnusedAssignment.test_assignToNonlocal´  r=   r   c                 ó&   • U R                  S5        g)zš
Assigning to a member of another object and then not using that member
variable is perfectly acceptable. Do not mistake it for an unused
local variable.
zR
        class b:
            pass
        def a():
            b.foo = 1
        Nr.   r   s    r   Útest_assignToMemberÚ(TestUnusedAssignment.test_assignToMemberÀ  ó   € ð 	�‰ð õ 	r   c                 ó&   • U R                  S5        g)zG
Don't warn when a variable in a for loop is assigned to but not used.
zO
        def f():
            for i in range(10):
                pass
        Nr.   r   s    r   Útest_assignInForLoopÚ)TestUnusedAssignment.test_assignInForLoopÏ  rü   r   c                 ó&   • U R                  S5        g)zQ
Don't warn when a variable in a list comprehension is
assigned to but not used.
z@
        def f():
            [None for i in range(10)]
        Nr.   r   s    r   Útest_assignInListComprehensionÚ3TestUnusedAssignment.test_assignInListComprehensionÙ  r1   r   c                 ó&   • U R                  S5        g)zS
Don't warn when a variable in a generator expression is
assigned to but not used.
z@
        def f():
            (None for i in range(10))
        Nr.   r   s    r   Útest_generatorExpressionÚ-TestUnusedAssignment.test_generatorExpressionã  r1   r   c                 ó&   • U R                  S5        g)zG
Don't warn when a variable assignment occurs lexically after its use.
z 
        def f():
            x = None
            for i in range(10):
                if i > 2:
                    return x
                x = i * 2
        Nr.   r   s    r   Útest_assignmentInsideLoopÚ.TestUnusedAssignment.test_assignmentInsideLoopí  s   € ð 	�‰ð õ 	r   c                 ó&  • U R                  S5        U R                  S[        R                  [        R                  5        U R                  S5        U R                  S[        R                  5        U R                  S[        R                  5        g)zÑ
Don't warn when a variable included in tuple unpacking is unused. It's
very common for variables in a tuple unpacking assignment to be unused
in good Python code, so warning will only create false positives.
z6
        def f(tup):
            (x, y) = tup
        z4
        def f():
            (x, y) = 1, 2
        zq
        def f():
            (x, y) = coords = 1, 2
            if x > 1:
                print(coords)
        z=
        def f():
            (x, y) = coords = 1, 2
        z=
        def f():
            coords = (x, y) = 1, 2
        Nr   r   s    r   Útest_tupleUnpackingÚ(TestUnusedAssignment.test_tupleUnpackingú  sŠ   € ð 	�‰ð ô 	ð 	�‰ð ô ×Ñœq×/Ñ/ô	1ð 	�‰ð ô 	ð 	�‰ð ô ×Ñô	ð 	�‰ð ô ×Ñõ	r   c                 ó„   • U R                  S5        U R                  S[        R                  [        R                  5        g)zB
Don't warn when a variable included in list unpacking is unused.
z6
        def f(tup):
            [x, y] = tup
        z6
        def f():
            [x, y] = [1, 2]
        Nr   r   s    r   Útest_listUnpackingÚ'TestUnusedAssignment.test_listUnpacking  s;   € ð 	�‰ð ô 	ð 	�‰ð ô ×Ñœq×/Ñ/õ	1r   c                 ó&   • U R                  S5        g)z>
Don't warn when the assignment is used in an inner function.
z~
        def barMaker():
            foo = 5
            def bar():
                return foo
            return bar
        Nr.   r   s    r   Útest_closedOverÚ$TestUnusedAssignment.test_closedOver$  s   € ð 	�‰ð õ 	r   c                 ó&   • U R                  S5        g)zz
Don't warn when the assignment is used in an inner function, even if
that inner function itself is in an inner function.
z�
        def barMaker():
            foo = 5
            def bar():
                def baz():
                    return foo
            return bar
        Nr.   r   s    r   Útest_doubleClosedOverÚ*TestUnusedAssignment.test_doubleClosedOver0  s   € ð
 	�‰ð õ 	r   c                 ó&   • U R                  S5        g)ze
Do not warn about unused local variable __tracebackhide__, which is
a special variable for py.test.
zL
            def helper():
                __tracebackhide__ = True
        Nr.   r   s    r   Ú!test_tracebackhideSpecialVariableÚ6TestUnusedAssignment.test_tracebackhideSpecialVariable>  r1   r   c                 ó¦   • U R                  S5        U R                  S[        R                  5        U R                  S[        R                  5        g)z)
Test C{foo if bar else baz} statements.
za = 'moo' if True else 'oink'za = foo if True else 'oink'za = 'moo' if True else barNrX   r   s    r   Ú
test_ifexpÚTestUnusedAssignment.test_ifexpH  s7   € ð 	�‰Ð3Ô4Ø�‰Ð1´1·?±?ÔCØ�‰Ð0´!·/±/ÕBr   c                 óÈ   • U R                  S5        U R                  S5        U R                  S[        R                  5        U R                  S[        R                  5        g)z
Test C{if (foo,)} conditions.
zif (): passzC
        if (
            True
        ):
            pass
        zD
        if (
            True,
        ):
            pass
        z?
        x = 1 if (
            True,
        ) else 2
        N)r   r   ÚIfTupler   s    r   Útest_if_tupleÚ"TestUnusedAssignment.test_if_tupleP  sZ   € ð 	�‰Ð%Ô&Ø�‰ð ô 	ð 	�‰ð ô
 �Y‰Yô	ð 	�‰ð ô �Y‰Yõ		r   c                 ó&   • U R                  S5        g)zk
No warnings are emitted for using inside or after a nameless C{with}
statement a name defined beforehand.
zR
        bar = None
        with open("foo"):
            bar
        bar
        Nr.   r   s    r   Útest_withStatementNoNamesÚ.TestUnusedAssignment.test_withStatementNoNamesg  r=   r   c                 ó&   • U R                  S5        g)zi
No warnings are emitted for using a name defined by a C{with} statement
within the suite or afterwards.
zF
        with open('foo') as bar:
            bar
        bar
        Nr.   r   s    r   Útest_withStatementSingleNameÚ1TestUnusedAssignment.test_withStatementSingleNames  rP   r   c                 ó&   • U R                  S5        g)zV
No warnings are emitted for using an attribute as the target of a
C{with} statement.
zR
        import foo
        with open('foo') as foo.bar:
            pass
        Nr.   r   s    r   Útest_withStatementAttributeNameÚ4TestUnusedAssignment.test_withStatementAttributeName~  rP   r   c                 ó&   • U R                  S5        g)zU
No warnings are emitted for using a subscript as the target of a
C{with} statement.
zQ
        import foo
        with open('foo') as foo[0]:
            pass
        Nr.   r   s    r   Útest_withStatementSubscriptÚ0TestUnusedAssignment.test_withStatementSubscript‰  rP   r   c                 óD   • U R                  S[        R                  5        g)zq
An undefined name warning is emitted if the subscript used as the
target of a C{with} statement is not defined.
zS
        import foo
        with open('foo') as foo[bar]:
            pass
        NrX   r   s    r   Ú$test_withStatementSubscriptUndefinedÚ9TestUnusedAssignment.test_withStatementSubscriptUndefined”  ó   € ð
 	�‰ð ô �_‰_õ		r   c                 ó&   • U R                  S5        g)z|
No warnings are emitted for using any of the tuple of names defined by
a C{with} statement within the suite or afterwards.
zW
        with open('foo') as (bar, baz):
            bar, baz
        bar, baz
        Nr.   r   s    r   Útest_withStatementTupleNamesÚ1TestUnusedAssignment.test_withStatementTupleNamesŸ  rP   r   c                 ó&   • U R                  S5        g)z{
No warnings are emitted for using any of the list of names defined by a
C{with} statement within the suite or afterwards.
zW
        with open('foo') as [bar, baz]:
            bar, baz
        bar, baz
        Nr.   r   s    r   Útest_withStatementListNamesÚ0TestUnusedAssignment.test_withStatementListNamesª  rP   r   c                 ó&   • U R                  S5        g)aA  
If the target of a C{with} statement uses any or all of the valid forms
for that part of the grammar (See
U{http://docs.python.org/reference/compound_stmts.html#the-with-statement}),
the names involved are checked both for definedness and any bindings
created are respected in the suite of the statement and afterwards.
z©
        c = d = e = g = h = i = None
        with open('foo') as [(a, b), c[d], e.f, g[h:i]]:
            a, b, c, d, e, g, h, i
        a, b, c, d, e, g, h, i
        Nr.   r   s    r   Ú#test_withStatementComplicatedTargetÚ8TestUnusedAssignment.test_withStatementComplicatedTargetµ  r  r   c                 óD   • U R                  S[        R                  5        g)z}
An undefined name warning is emitted if the name first defined by a
C{with} statement is used before the C{with} statement.
zG
        bar
        with open('foo') as bar:
            pass
        NrX   r   s    r   Ú%test_withStatementSingleNameUndefinedÚ:TestUnusedAssignment.test_withStatementSingleNameUndefinedÄ  rA  r   c                 óD   • U R                  S[        R                  5        g)z™
An undefined name warning is emitted if a name first defined by the
tuple-unpacking form of the C{with} statement is used before the
C{with} statement.
zN
        baz
        with open('foo') as (bar, baz):
            pass
        NrX   r   s    r   Ú%test_withStatementTupleNamesUndefinedÚ:TestUnusedAssignment.test_withStatementTupleNamesUndefinedÏ  s   € ð 	�‰ð ô �_‰_õ		r   c                 óD   • U R                  S[        R                  5        g)zy
A redefined name warning is emitted if a name bound by an import is
rebound by the name defined by a C{with} statement.
zN
        import bar
        with open('foo') as bar:
            pass
        Nr&   r   s    r   Ú%test_withStatementSingleNameRedefinedÚ:TestUnusedAssignment.test_withStatementSingleNameRedefinedÛ  r9   r   c                 óD   • U R                  S[        R                  5        g)z�
A redefined name warning is emitted if a name bound by an import is
rebound by one of the names defined by the tuple-unpacking form of a
C{with} statement.
zU
        import bar
        with open('foo') as (bar, baz):
            pass
        Nr&   r   s    r   Ú%test_withStatementTupleNamesRedefinedÚ:TestUnusedAssignment.test_withStatementTupleNamesRedefinedæ  s    € ð 	�‰ð ô ×#Ñ#õ		%r   c                 óD   • U R                  S[        R                  5        g)zz
An undefined name warning is emitted if a name is used inside the
body of a C{with} statement without first being bound.
z:
        with open('foo') as bar:
            baz
        NrX   r   s    r   Ú!test_withStatementUndefinedInsideÚ6TestUnusedAssignment.test_withStatementUndefinedInsideò  r\   r   c                 ó&   • U R                  S5        g)zd
A name defined in the body of a C{with} statement can be used after
the body ends without warning.
zK
        with open('foo') as bar:
            baz = 10
        baz
        Nr.   r   s    r   Ú#test_withStatementNameDefinedInBodyÚ8TestUnusedAssignment.test_withStatementNameDefinedInBodyü  rP   r   c                 ó„   • U R                  S[        R                  5        U R                  S[        R                  5        g)zo
An undefined name warning is emitted if a name in the I{test}
expression of a C{with} statement is undefined.
z3
        with bar as baz:
            pass
        z3
        with bar as bar:
            pass
        NrX   r   s    r   Ú'test_withStatementUndefinedInExpressionÚ<TestUnusedAssignment.test_withStatementUndefinedInExpression  s:   € ð
 	�‰ð ô �_‰_ô	ð
 	�‰ð ô �_‰_õ	r   c                 ó&   • U R                  S5        g)z+
Dict comprehensions are properly handled.
z/
        a = {1: x for x in range(10)}
        Nr.   r   s    r   Útest_dictComprehensionÚ+TestUnusedAssignment.test_dictComprehension  r×   r   c                 ó&   • U R                  S5        g)z*
Set comprehensions are properly handled.
zB
        a = {1, 2, 3}
        b = {x for x in range(10)}
        Nr.   r   s    r   Útest_setComprehensionAndLiteralÚ4TestUnusedAssignment.test_setComprehensionAndLiteral  rÛ   r   c                 óH   • U R                  S5        U R                  S5        g )Nz<
        try: pass
        except Exception as e: e
        zc
        def download_review():
            try: pass
            except Exception as e: e
        r.   r   s    r   Útest_exceptionUsedInExceptÚ/TestUnusedAssignment.test_exceptionUsedInExcept'  s&   € Ø�‰ð ô 	ð
 	�‰ð õ 	r   c                 óD   • U R                  S[        R                  5        g )Nz?
        try: pass
        except Exception as e: pass
        r   r   s    r   Útest_exceptionUnusedInExceptÚ1TestUnusedAssignment.test_exceptionUnusedInExcept3  s   € Ø�‰ð ô ×Ñõ	r   )é   r
   znew in Python 3.11c                 óD   • U R                  S[        R                  5        g )Nzf
            try:
                pass
            except* OSError as e:
                pass
        r   r   s    r   Ú$test_exception_unused_in_except_starÚ9TestUnusedAssignment.test_exception_unused_in_except_star9  s   € à�‰ð ô
 ×Ñõ	r   c                 óD   • U R                  S[        R                  5        g )Nzf
        def download_review():
            try: pass
            except Exception as e: pass
        r   r   s    r   Ú&test_exceptionUnusedInExceptInFunctionÚ;TestUnusedAssignment.test_exceptionUnusedInExceptInFunctionB  s   € Ø�‰ð ô ×Ñõ		r   c                 ó&   • U R                  S5        g)zš
Don't issue false warning when an unnamed exception is used.
Previously, there would be a false warning, but only when the
try..except was in a function
zw
        import tokenize
        def foo():
            try: pass
            except tokenize.TokenError: pass
        Nr.   r   s    r   Ú test_exceptWithoutNameInFunctionÚ5TestUnusedAssignment.test_exceptWithoutNameInFunctionI  s   € ð 	�‰ð õ 	r   c                 ó&   • U R                  S5        g)zo
Don't issue false warning when an unnamed exception is used.
This example catches a tuple of exception types.
z‹
        import tokenize
        def foo():
            try: pass
            except (tokenize.TokenError, IndentationError): pass
        Nr.   r   s    r   Ú%test_exceptWithoutNameInFunctionTupleÚ:TestUnusedAssignment.test_exceptWithoutNameInFunctionTupleV  r=   r   c                 ó&   • U R                  S5        g)z\
Consider a function that is called on the right part of an
augassign operation to be used.
zJ
        from foo import bar
        baz = 0
        baz += bar()
        Nr.   r   s    r   Ú,test_augmentedAssignmentImportedFunctionCallÚATestUnusedAssignment.test_augmentedAssignmentImportedFunctionCallb  rP   r   c                 ó&   • U R                  S5        g)z,An assert without a message is not an error.z(
        a = 1
        assert a
        Nr.   r   s    r   Útest_assert_without_messageÚ0TestUnusedAssignment.test_assert_without_messagem  ó   € à�‰ð õ 	r   c                 ó&   • U R                  S5        g)z)An assert with a message is not an error.z-
        a = 1
        assert a, 'x'
        Nr.   r   s    r   Útest_assert_with_messageÚ-TestUnusedAssignment.test_assert_with_messaget  r  r   c                 ób   • U R                  S[        R                  [        R                  5        g)z.An assert of a non-empty tuple is always True.z>
        assert (False, 'x')
        assert (False, )
        N)r   r   ÚAssertTupler   s    r   Útest_assert_tupleÚ&TestUnusedAssignment.test_assert_tuple{  s"   € à�‰ð ô �]‰]œAŸM™Mõ	+r   c                 ó&   • U R                  S5        g)z,An assert of an empty tuple is always False.z
        assert ()
        Nr.   r   s    r   Útest_assert_tuple_emptyÚ,TestUnusedAssignment.test_assert_tuple_empty‚  s   € à�‰ð õ 	r   c                 ó&   • U R                  S5        g)z,An assert of a static value is not an error.z.
        assert True
        assert 1
        Nr.   r   s    r   Útest_assert_staticÚ'TestUnusedAssignment.test_assert_staticˆ  r  r   c                 óD   • U R                  S[        R                  5        g)z
Test C{yield from} statement
z9
        def bar():
            yield from foo()
        NrX   r   s    r   Útest_yieldFromUndefinedÚ,TestUnusedAssignment.test_yieldFromUndefined�  s   € ð 	�‰ð ô �_‰_õ	r   c                 ó&   • U R                  S5        g)z.Test PEP 498 f-strings are treated as a usage.z3
        baz = 0
        print(f'{4*baz}')
        Nr.   r   s    r   Útest_f_stringÚ"TestUnusedAssignment.test_f_string˜  r  r   c                 ó&   • U R                  S5        g)zATest PEP 572 assignment expressions are treated as usage / write.zJ
        from foo import y
        print(x := y)
        print(x)
        Nr.   r   s    r   Útest_assign_exprÚ%TestUnusedAssignment.test_assign_exprŸ  ó   € à�‰ð õ 	r   c                 ó&   • U R                  S5        g)z5Test assignment expressions in generator expressions.zO
        if (any((y := x[0]) for x in [[True]])):
            print(y)
        Nr.   r   s    r   Ú test_assign_expr_generator_scopeÚ5TestUnusedAssignment.test_assign_expr_generator_scope§  r  r   c                 ó&   • U R                  S5        g)z2Test assignment expressions in nested expressions.zz
        if ([(y:=x) for x in range(4) if [(z:=q) for q in range(4)]]):
            print(y)
            print(z)
        Nr.   r   s    r   Útest_assign_expr_nestedÚ,TestUnusedAssignment.test_assign_expr_nested®  r–  r   r�   N)?rì   rí   rî   rï   Ú__doc__rô   r÷   rú   rþ   r   r  r  r  r
  r  r  r  r  r  r  r   r#  r&  r)  r,  r0  r3  r6  r9  r<  r?  rC  rF  rI  rL  rO  rR  rU  rX  r[  r^  ra  rd  rg  rj  r   r   rn  rq  rt  rw  rz  r}  r�  r…  rˆ  r‹  rŽ  r‘  r”  r˜  r›  rð   r�   r   r   rò   rò   a  sH  † ñòòòò
ñ 
Ð
MÓNñ	ó Oð	ò
ò
ò
òòòòòòò:1ò
òòòCòò.
ò	ò	ò	ò	ò	ò	òò	ò
ò	%ò
%òò	òòòò
òñ ˆL˜7Ñ"Ð$8Ó9ñó :ðòòò
ò	òòò+òòòòòòõr   rò   c                   ó,   • \ rS rSrS rS rS rS rSrg)ÚTestStringFormattingi·  c                 ój  • U R                  S[        R                  5        U R                  S[        R                  5        U R                  S[        R                  5        U R                  S[        R                  5        U R                  S5        U R                  S5        U R                  S5        g )Nzf'foo'z=
            f"""foo
            bar
            """
        zX
            print(
                f'foo'
                f'bar'
            )
        zf'{{}}'z5
            x = 5
            print(f'{x}')
        z?
            x = 'a' * 90
            print(f'{x:.8}')
        zC
            x = y = 5
            print(f'{x:>2} {y:>2}')
        )r   r   ÚFStringMissingPlaceholdersr   s    r   Ú"test_f_string_without_placeholdersÚ7TestStringFormatting.test_f_string_without_placeholders¹  s�   € Ø�‰�Hœa×:Ñ:Ô;Ø�‰ð ô ×)Ñ)ô		+ð
 	�‰ð ô
 ×)Ñ)ô	+ð 	�‰�Iœq×;Ñ;Ô<à�‰ð ô 	ð
 	�‰ð ô 	ð
 	�‰ð õ 	r   c                 ó2  • U R                  S[        R                  5        U R                  S[        R                  5        U R                  S[        R                  5        U R                  S[        R                  5        U R                  S[        R
                  5        U R                  S[        R                  5        U R                  S[        R                  5        U R                  S[        R                  5        U R                  S	[        R                  5        U R                  S
5        U R                  S5        U R                  S5        U R                  S5        U R                  S5        U R                  S5        U R                  S5        g )Nz#
            '{'.format(1)
        z+
            '{} {1}'.format(1, 2)
        z+
            '{0} {}'.format(1, 2)
        z'
            '{}'.format(1, 2)
        z+
            '{}'.format(1, bar=2)
        z'
            '{} {}'.format(1)
        z$
            '{2}'.format()
        z&
            '{bar}'.format()
        z0
            '{:{:{}}}'.format(1, 2, 3)
        z'{.__class__}'.format('')z('{foo[bar]}'.format(foo={'bar': 'barv'})z8
            print('{:{}} {}'.format(1, 15, 2))
        z-
            print('{:2}'.format(1))
        z1
            '{foo}-{}'.format(1, foo=2)
        z8
            a = ()
            "{}".format(*a)
        z<
            k = {}
            "{foo}".format(**k)
        )r   r   ÚStringDotFormatInvalidFormatÚStringDotFormatMixingAutomaticÚ'StringDotFormatExtraPositionalArgumentsÚ"StringDotFormatExtraNamedArgumentsÚStringDotFormatMissingArgumentr   s    r   Útest_invalid_dot_format_callsÚ2TestStringFormatting.test_invalid_dot_format_callsØ  su  € Ø�‰ð ä×+Ñ+ô	-ð 	�‰ð ä×-Ñ-ô	/ð 	�‰ð ä×-Ñ-ô	/ð 	�‰ð ä×6Ñ6ô	8ð 	�‰ð ä×1Ñ1ô	3ð 	�‰ð ä×-Ñ-ô	/ð 	�‰ð ä×-Ñ-ô	/ð 	�‰ð ä×-Ñ-ô	/ð 	�‰ð ä×+Ñ+ô	-ð 	�‰Ð/Ô0Ø�‰Ð>Ô?à�‰ð ô 	ð 	�‰ð ô 	ð 	�‰ð ô 	ð 	�‰ð ô 	ð 	�‰ð õ 	r   c                 óL  • U R                  S[        R                  5        U R                  S[        R                  5        U R                  S[        R                  5        U R                  S[        R                  5        U R                  S[        R
                  5        U R                  S[        R
                  5        U R                  S[        R                  5        U R                  S[        R                  5        U R                  S	[        R                  5        U R                  S
[        R                  5        U R                  S[        R                  5        U R                  S5        U R                  S5        U R                  S5        U R                  S5        g )Nz/
            '%(foo)' % {'foo': 'bar'}
        z3
            '%s %(foo)s' % {'foo': 'bar'}
        z3
            '%(foo)s %s' % {'foo': 'bar'}
        z!
            '%j' % (1,)
        z$
            '%s %s' % (1,)
        z)
            '%s %s' % (1, 2, 3)
        z$
            '%(bar)s' % {}
        z6
            '%(bar)s' % {'bar': 1, 'baz': 2}
        z+
            '%(bar)s' % (1, 2, 3)
        z*
            '%s %s' % {'k': 'v'}
        z1
            '%(bar)*s' % {'bar': 'baz'}
        z:
            '%s' % {'foo': 'bar', 'baz': 'womp'}
        z+
            "%1000000000000f" % 1
        z,
            '%% %s %% %s' % (1, 2)
        zO
            '%.*f' % (2, 1.1234)
            '%*.*f' % (5, 2, 3.1234)
        )r   r   ÚPercentFormatInvalidFormatÚ$PercentFormatMixedPositionalAndNamedÚ'PercentFormatUnsupportedFormatCharacterÚ$PercentFormatPositionalCountMismatchÚPercentFormatMissingArgumentÚ PercentFormatExtraNamedArgumentsÚPercentFormatExpectedMappingÚPercentFormatExpectedSequenceÚ!PercentFormatStarRequiresSequencer   s    r   Ú!test_invalid_percent_format_callsÚ6TestStringFormatting.test_invalid_percent_format_calls  s€  € Ø�‰ð ä×)Ñ)ô	+ð 	�‰ð ä×3Ñ3ô	5ð 	�‰ð ä×3Ñ3ô	5ð 	�‰ð ä×6Ñ6ô	8ð 	�‰ð ä×3Ñ3ô	5ð 	�‰ð ä×3Ñ3ô	5ð 	�‰ð ä×+Ñ+ô	.ð 	�‰ð ä×/Ñ/ô	1ð 	�‰ð ä×+Ñ+ô	-ð 	�‰ð ä×,Ñ,ô	.ð 	�‰ð ä×0Ñ0ô	2ð 	�‰ð ô 	ð 	�‰ð ô 	ð 	�‰ð ô 	ð 	�‰ð õ 	r   c                 óH   • U R                  S5        U R                  S5        g )NzS
            a = []
            '%s %s' % [*a]
            '%s %s' % (*a,)
        z8
            k = {}
            '%(k)s' % {**k}
        r.   r   s    r   Ú5test_ok_percent_format_cannot_determine_element_countÚJTestStringFormatting.test_ok_percent_format_cannot_determine_element_countB  s&   € Ø�‰ð ô 	ð
 	�‰ð õ 	r   r�   N)	rì   rí   rî   rï   r¢  rª  r¶  r¹  rð   r�   r   r   rŸ  rŸ  ·  s   † òò>4òl2õh	r   rŸ  c                   ó\   • \ rS rSrS rS rS rS rS rS r	S r
S	 rS
 rS rS rS rSrg)ÚTestAsyncStatementsiN  c                 ó&   • U R                  S5        g )Nz8
        async def bar():
            return 42
        r.   r   s    r   Útest_asyncDefÚ!TestAsyncStatements.test_asyncDefP  rë   r   c                 ó&   • U R                  S5        g )NzS
        async def read_data(db):
            await db.fetch('SELECT ...')
        r.   r   s    r   Útest_asyncDefAwaitÚ&TestAsyncStatements.test_asyncDefAwaitV  rë   r   c                 óD   • U R                  S[        R                  5        g )Nz;
        async def bar():
            return foo()
        rX   r   s    r   Útest_asyncDefUndefinedÚ*TestAsyncStatements.test_asyncDefUndefined\  s   € Ø�‰ð ô �_‰_õ	r   c                 ó&   • U R                  S5        g )Nz©
        async def read_data(db):
            output = []
            async for row in db.cursor():
                output.append(row)
            return output
        r.   r   s    r   Útest_asyncForÚ!TestAsyncStatements.test_asyncForb  ó   € Ø�‰ð õ 	r   c                 ó&   • U R                  S5        g )NzY
        async def coro(it):
            async for _ in it:
                pass
        r.   r   s    r   Útest_asyncForUnderscoreLoopVarÚ2TestAsyncStatements.test_asyncForUnderscoreLoopVark  ó   € Ø�‰ð õ 	r   c                 óH   • U R                  S5        U R                  S5        g )Nzë
        async def read_data(db):
            output = []
            async for row in db.cursor():
                if row[0] == 'skip':
                    continue
                output.append(row)
            return output
        zè
        async def read_data(db):
            output = []
            async for row in db.cursor():
                if row[0] == 'stop':
                    break
                output.append(row)
            return output
        r.   r   s    r   Útest_loopControlInAsyncForÚ.TestAsyncStatements.test_loopControlInAsyncForr  s&   € Ø�‰ð ô 	ð 	�‰ð õ 	r   c                 ó„   • U R                  S[        R                  5        U R                  S[        R                  5        g )NzÔ
        async def read_data(db):
            output = []
            async for row in db.cursor():
                output.append(row)
            else:
                continue
            return output
        zÑ
        async def read_data(db):
            output = []
            async for row in db.cursor():
                output.append(row)
            else:
                break
            return output
        )r   r   r…   rŒ   r   s    r   Útest_loopControlInAsyncForElseÚ2TestAsyncStatements.test_loopControlInAsyncForElse‡  s<   € Ø�‰ð ô ×"Ñ"ô	$ð 	�‰ð ô ×Ñõ	!r   c                 ó&   • U R                  S5        g )Nz‹
        async def commit(session, data):
            async with session.transaction():
                await session.update(data)
        r.   r   s    r   Útest_asyncWithÚ"TestAsyncStatements.test_asyncWithœ  rÍ  r   c                 ó&   • U R                  S5        g )NzÃ
        async def commit(session, data):
            async with session.transaction() as trans:
                await trans.begin()
                ...
                await trans.end()
        r.   r   s    r   Útest_asyncWithItemÚ&TestAsyncStatements.test_asyncWithItem£  rÉ  r   c                 ó&   • U R                  S5        g )Nz9
        def foo(a, b):
            return a @ b
        r.   r   s    r   Útest_matmulÚTestAsyncStatements.test_matmul¬  rë   r   c                 ó&   • U R                  S5        g )NzE
        hi = 'hi'
        mom = 'mom'
        f'{hi} {mom}'
        r.   r   s    r   Útest_formatstringÚ%TestAsyncStatements.test_formatstring²  rÍ  r   c                 óÈ   • U R                  S5        U R                  S5        U R                  S[        R                  5        U R                  S[        R                  5        g )Nz;
        raise NotImplementedError("This is fine")
        z+
        raise NotImplementedError
        z?
        raise NotImplemented("This isn't gonna work")
        z&
        raise NotImplemented
        )r   r   ÚRaiseNotImplementedr   s    r   Útest_raise_notimplementedÚ-TestAsyncStatements.test_raise_notimplemented¹  s^   € Ø�‰ð ô 	ð 	�‰ð ô 	ð 	�‰ð ä×"Ñ"ô	$ð 	�‰ð ä×"Ñ"õ	$r   r�   N)rì   rí   rî   rï   r¾  rÁ  rÄ  rÇ  rË  rÏ  rÒ  rÕ  rØ  rÛ  rÞ  râ  rð   r�   r   r   r¼  r¼  N  s>   † òòòòòòò*!ò*òòòõ$r   r¼  c                   óB   • \ rS rSrSrS rS rS rS rS r	S r
S	 rS
rg)ÚTestIncompatiblePrintOperatoriË  z8
Tests for warning about invalid use of print function.
c                 ó&   • U R                  S5        g )Nz 
        print("Hello")
        r.   r   s    r   Útest_valid_printÚ.TestIncompatiblePrintOperator.test_valid_printÐ  s   € Ø�‰ð õ 	r   c                 óÎ   • U R                  S[        R                  5      R                  S   nU R	                  UR
                  S5        U R	                  UR                  S5        g )Nzn
        from __future__ import print_function
        import sys
        print >>sys.stderr, "Hello"
        r   é   )r   r   ÚInvalidPrintSyntaxr   ÚassertEqualÚlinenoÚcol)r   Úexcs     r   Ú,test_invalid_print_when_imported_from_futureÚJTestIncompatiblePrintOperator.test_invalid_print_when_imported_from_futureÕ  sX   € Ø�k‰kð ô ×!Ñ!ó	#÷ $,¡8¨Añ	/ˆð 	×Ñ˜Ÿ™ QÔ'Ø×Ñ˜Ÿ™ !Õ$r   c                 ó&   • U R                  S5        g )Nz
print += 1r.   r   s    r   Útest_print_augmented_assignÚ9TestIncompatiblePrintOperator.test_print_augmented_assignß  s   € à�‰�LÕ!r   c                 ó&   • U R                  S5        g)z:
A valid assignment, tested for catching false positives.
z`
        from __future__ import print_function
        log = print
        log("Hello")
        Nr.   r   s    r   Útest_print_function_assignmentÚ<TestIncompatiblePrintOperator.test_print_function_assignmentã  rü   r   c                 ó&   • U R                  S5        g )NzQ
        from __future__ import print_function
        a = lambda: print
        r.   r   s    r   Útest_print_in_lambdaÚ2TestIncompatiblePrintOperator.test_print_in_lambdaí  rë   r   c                 ó&   • U R                  S5        g )Nza
        from __future__ import print_function
        def a():
            return print
        r.   r   s    r   Útest_print_returned_in_functionÚ=TestIncompatiblePrintOperator.test_print_returned_in_functionó  rÍ  r   c                 ó&   • U R                  S5        g )NzN
        from __future__ import print_function
        if print: pass
        r.   r   s    r   Útest_print_as_condition_testÚ:TestIncompatiblePrintOperator.test_print_as_condition_testú  rë   r   r�   N)rì   rí   rî   rï   r�  rç  rð  ró  rö  rù  rü  rÿ  rð   r�   r   r   rå  rå  Ë  s*   † ñòò
%ò"òòòõr   rå  N)r�  Úsysr   Úpyflakesr   r   Úpyflakes.test.harnessr   r   r   r	   rò   rŸ  r¼  rå  r�   r   r   Ú<module>r     s`   ðñõ å "ß 8Ñ 8ôSˆ8ô Sôl"S	˜8ô S	ôlT˜8ô Tônz$˜(ô z$ôz3 Hõ 3r   