+
    Bi&                         ^ RI t ^ RIt^ RIt^ RIt^ RIHt ^ RIHt ^ RIH	t	 ^ RI
Ht ^ RIHt  ! R R]P                  4      t ! R	 R
]P                  4      t ! R R]P                  4      tR# )    N)patch)dedent)force_not_colorized)InteractiveColoredConsole)_more_linesc                      a  ] tR t^t o R tR t]R 4       tR tR t	R t
]R 4       t]R 4       tR	 tR
 tR tR tR tRtV tR# )TestSimpleInteractc                V   / p\        R 4      p\        VRR7      p\        P                  ! 4       p\        P
                  ! \        R4      ;_uu_ 4       p\        P
                  ! \        RVP                  R7      ;_uu_ 4       p\        P                  ! V4      ;_uu_ 4        VP                  VRRR7      pRRR4       RRR4       RRR4       V P                  X4       XP                  4        R#   + '       g   i     LC; i  + '       g   i     LN; i  + '       g   i     LY; i)	z        class A:
            def foo(self):


                pass

        class B:
            def bar(self):
                pass

        a = 1
        a
        <stdin>filenameshowsyntaxerror	runsource)wrapssingler   _symbolN)r   r   ioStringIOr   objectr   
contextlibredirect_stdoutpushassertFalseassert_not_called)self	namespacecodeconsolefr   r   mores   &       5/usr/lib/python3.14/test/test_pyrepl/test_interact.pytest_multiple_statements+TestSimpleInteract.test_multiple_statements   s    	   ,I	JKKMLL24EFF/LL2KwGXGXYY]f&&q))<<y(<KD * Z G
 	))+	 *) ZY GFs<   0DD	"C27D	?D2D=D	DDD(	c                b   / p\        R 4      p\        VRR7      p\        P                  ! 4       p\        P
                  ! V4      ;_uu_ 4        VP                  VRRR7      pRRR4       V P                  X4       V P                  VP                  4       R4       R#   + '       g   i     LC; i)z8        b = 1
        b
        a = 1
        a
        r   r   r   r   Nz1
)
r   r   r   r   r   r   r   r   assertEqualgetvaluer   r   r   r   r    r!   s   &     r"   test_multiple_statements_output2TestSimpleInteract.test_multiple_statements_output*   s    	   ,I	JKKM''**<<y(<KD +u- +*s   BB.	c                p   \        4       p\        R 4      p\        P                  ! 4       p\        P
                  ! V4      ;_uu_ 4        VP                  V4       RRR4       V P                  RVP                  4       4       V P                  RVP                  4       4       R#   + '       g   i     LR; i)zQ        raise Exception('foobar')
        print('spam', 'eggs', sep='&')
        NzException: foobarz	spam&eggs)
r   r   r   r   r   redirect_stderrr   assertInr'   assertNotIn)r   r   r   r    s   &   r"   #test_multiple_statements_fail_early6TestSimpleInteract.test_multiple_statements_fail_early9   s~    +-   KKM''**d# +)1::<8ajjl3 +*s   	B%%B5	c                P   / pR p\        VRR7      p\        P                  ! 4       p\        P                  ! V4      ;_uu_ 4        VP                  VRRR7      pRRR4       V P                  X4       V P                  VP                  4       R 4       R#   + '       g   i     LC; i) r   r   r   r   N)	r   r   r   r   r   r   r   r&   r'   r(   s   &     r"   
test_emptyTestSimpleInteract.test_emptyF   sz    	+I	JKKM''**<<y(<KD +r* +*s   BB%	c                    \        4       pR p\        P                  ! VR4      ;_uu_ 4       pVP                  V4       VP	                  4        RRR4       R#   + '       g   i     R# ; i)print('Hello, world!')runcodeN)r   r   r   r   assert_called_once)r   r   sourcemock_runcodes   &   r"   %test_runsource_compiles_and_runs_code8TestSimpleInteract.test_runsource_compiles_and_runs_codeP   sK    +-)\\'9--f%++- .---s   "AA)	c                    \        4       pR p\        P                  ! 4       p\        P                  ! V4      ;_uu_ 4        VP                  V4      pRRR4       V P                  X4       R#   + '       g   i     L#; i)r6   N)r   r   r   r   r   r   r   r   r   r9   r    results   &    r"   7test_runsource_returns_false_for_successful_compilationJTestSimpleInteract.test_runsource_returns_false_for_successful_compilationW   sW    +-)KKM''**&&v.F +  +*s    A--A=	c                @   \        4       pR p\        P                  ! 4       p\        P                  ! V4      ;_uu_ 4        VP                  V4      pRRR4       V P                  X4       V P                  RVP                  4       4       R#   + '       g   i     LC; i)print('Hello, world!'NSyntaxError	r   r   r   r   r,   r   r   r-   r'   r>   s   &    r"   3test_runsource_returns_false_for_failed_compilationFTestSimpleInteract.test_runsource_returns_false_for_failed_compilation_   sk    +-(KKM''**&&v.F + mQZZ\2 +*s    BB	c                B   \        4       pR p\        P                  ! 4       p\        P                  ! V4      ;_uu_ 4        VP                  V4      pRRR4       V P                  X4       RpV P                  WSP                  4       4       R#   + '       g   i     LD; i)zdef f(x, x): ...Nz_
    def f(x, x): ...
             ^
SyntaxError: duplicate argument 'x' in function definitionrE   )r   r   r9   r    r?   rs   &     r"   )test_runsource_show_syntax_error_location<TestSimpleInteract.test_runsource_show_syntax_error_locationi   sr    +-#KKM''**&&v.F + > 	a& +*s    BB	c                   \        4       pR p\        P                  ! VR4      ;_uu_ 4       pVP                  V4       VP	                  4        RRR4       \        R4      p\        P                  ! VR4      ;_uu_ 4       pVP                  V4       VP	                  4        RRR4       R#   + '       g   i     Lf; i  + '       g   i     R# ; i)rC   r   NzN        match 1:
            case {0: _, 0j: _}:
                pass
        )r   r   r   r   r8   r   )r   r   r9   mock_showsyntaxerrors   &   r"   8test_runsource_shows_syntax_error_for_failed_compilationKTestSimpleInteract.test_runsource_shows_syntax_error_for_failed_compilationw   s    +-(\\'#4559Mf% 335 6   
 \\'#4559Mf% 335 65 65 655s   "B, "B?,B<	?C	c           	        \        4       pR p\        P                  ! 4       p\        P                  ! V4      ;_uu_ 4        \        P
                  ! V4      ;_uu_ 4        VP                  V4      pRRR4       RRR4       V P                  X4       V P                  RVP                  4       4       R#   + '       g   i     LK; i  + '       g   i     LV; i)z 
Nz,source code string cannot contain null bytes)
r   r   r   r   r   r,   r   r   r-   r'   r>   s   &    r"   "test_runsource_survives_null_bytes5TestSimpleInteract.test_runsource_survives_null_bytes   s    +-KKM''**J,F,Fq,I,I&&v.F -J* DajjlS -J,I**s$    CB4	1C4C?CC	c                R   \        4       p\        R 4      p\        P                  ! 4       p\        P
                  ! V4      ;_uu_ 4        VP                  V4      pRRR4       V P                  X4       V P                  VP                  4       R4       R#   + '       g   i     LC; i)z:        x: int = 1
        print(__annotate__(1))
        Nz{'x': <class 'int'>}

r   r   r   r   r   r   r   r   r&   r'   r>   s   &    r"   test_no_active_future(TestSimpleInteract.test_no_active_future   sz    +-   KKM''**&&v.F + '?@ +*   	BB&	c                R   \        4       p\        R 4      p\        P                  ! 4       p\        P
                  ! V4      ;_uu_ 4        VP                  V4      pRRR4       V P                  X4       V P                  VP                  4       R4       R#   + '       g   i     LC; i)zo        from __future__ import annotations
        def g(x: int): ...
        print(g.__annotations__)
        Nz{'x': 'int'}
rT   r>   s   &    r"   test_future_annotations*TestSimpleInteract.test_future_annotations   sz    +-  
 KKM''**&&v.F + '78 +*rW   c                ^   \        4       p\        P                  ! 4       p\        P                  ! V4      ;_uu_ 4        VP                  R 4      pVP                  R4      pRRR4       V P                  X4       V P                  VP                  4       R4       R#   + '       g   i     LC; i)z&from __future__ import barry_as_FLUFL
zprint("black" <> 'blue')
NzTrue
)	r   r   r   r   r   r   r   r&   r'   )r   r   r    r?   s   &   r"   test_future_barry_as_flufl-TestSimpleInteract.test_future_barry_as_flufl   s|    +-KKM''**&&'PQF&&'GHF + 	 x0	 +*s   #BB,	 N)__name__
__module____qualname____firstlineno__r#   r)   r   r/   r3   r;   r@   rF   rJ   rN   rQ   rU   rY   r\   __static_attributes____classdictcell____classdict__s   @r"   r	   r	      sz     ,8. 
4 
4+.! 3 3 ' '6T
A91 1    r	   c                   b   a  ] tR t^t o R tR tR tR tR tR t	R t
R tR	 tR
 tR tRtV tR# )TestMoreLinesc                \    / pR p\        VRR7      pV P                  \        W24      4       R# )zif foor   r   Nr   r   r   r   r   r   r   s   &   r"   test_invalid_syntax_single_line-TestMoreLines.test_invalid_syntax_single_line   s+    	+I	JW34rg   c                \    / pR p\        VRR7      pV P                  \        W24      4       R# )r2   r   r   Nrk   rl   s   &   r"   test_empty_lineTestMoreLines.test_empty_line   s+    	+I	JW34rg   c                \    / pR p\        VRR7      pV P                  \        W24      4       R# )zfoo = 1r   r   Nrk   rl   s   &   r"   test_valid_single_statement)TestMoreLines.test_valid_single_statement   s+    	+I	JW34rg   c                n    / p\        R 4      p\        VRR7      pV P                  \        W24      4       R# )zF        foo = [
            1,
            2,
            3,
        ]r   r   Nr   r   r   r   rl   s   &   r"    test_multiline_single_assignment.TestMoreLines.test_multiline_single_assignment   s7    	   ,I	JW34rg   c                n    / p\        R 4      p\        VRR7      pV P                  \        W24      4       R# )z?        def foo():
            '''docs'''

            return 1r   r   Nr   r   
assertTruer   rl   s   &   r"   test_multiline_single_block)TestMoreLines.test_multiline_single_block   s5    	  
 ,I	JG23rg   c                \    / pR p\        VRR7      pV P                  \        W24      4       R# )zfoo = 1;bar = 2r   r   Nrk   rl   s   &   r"   $test_multiple_statements_single_line2TestMoreLines.test_multiple_statements_single_line   s+    	 +I	JW34rg   c                n    / p\        R 4      p\        VRR7      pV P                  \        W24      4       R# )z$        import time

        foo = 1r   r   Nrz   rl   s   &   r"   r#   &TestMoreLines.test_multiple_statements   s5    	   ,I	JG23rg   c                n    / p\        R 4      p\        VRR7      pV P                  \        W24      4       R# )z|        from dataclasses import dataclass

        @dataclass
        class Point:
            x: float
            y: floatr   r   Nrz   rl   s   &   r"   test_multiple_blocks"TestMoreLines.test_multiple_blocks   s5    	   ,I	JG23rg   c                n    / p\        R 4      p\        VRR7      pV P                  \        W24      4       R# )z        from dataclasses import dataclass

        @dataclass
        class Point:
            x: float
            y: float
        r   r   Nrv   rl   s   &   r"   "test_multiple_blocks_empty_newline0TestMoreLines.test_multiple_blocks_empty_newline   s7    	   ,I	JW34rg   c                \    / pR p\        VRR7      pV P                  \        W24      4       R# )zYfrom dataclasses import dataclass

@dataclass
class Point:
    x: float
    y: float
    r   r   Nrk   rl   s   &   r"   %test_multiple_blocks_indented_newline3TestMoreLines.test_multiple_blocks_indented_newline  s2    	 	 ,I	JW34rg   c                \    / pR p\        VRR7      pV P                  \        W24      4       R# )zif foo:r   r   N)r   r{   r   rl   s   &   r"   test_incomplete_statement'TestMoreLines.test_incomplete_statement  s)    	+I	JG23rg   r^   N)r_   r`   ra   rb   rm   rp   rs   rw   r|   r   r#   r   r   r   r   rc   rd   re   s   @r"   ri   ri      sA     555	5454
4554 4rg   ri   c                   &   a  ] tR tRt o R tRtV tR# )TestWarningsi  c                <   \        4       p\        R 4      p\        P                  ! RR7      ;_uu_ 4       p\        P                  ! R4       VP                  V4       RRR4       \        R X 4       4      pV P                  V^4       R#   + '       g   i     L6; i)zq        def f():
            try:
                return 1
            finally:
                return 2
        T)recorddefaultNc              3   R   "   T F  pR \        VP                  4      9   x  K  	  R# 5i)z'return' in a 'finally' blockN)strmessage).0ws   & r"   	<genexpr>4TestWarnings.test_pep_765_warning.<locals>.<genexpr>+  s$      %# 4s199~E#s   %')r   r   warningscatch_warningssimplefilterr   sumr&   )r   r   r   caughtcounts   &    r"   test_pep_765_warning!TestWarnings.test_pep_765_warning  s     ,-   $$D11V!!),d# 2  %#% %" 21s   (BB	r^   N)r_   r`   ra   rb   r   rc   rd   re   s   @r"   r   r     s     # #rg   r   )r   r   unittestr   unittest.mockr   textwrapr   test.supportr   _pyrepl.consoler   _pyrepl.simple_interactr   TestCaser	   ri   r   r^   rg   r"   <module>r      s\     	     , 5 /b1** b1Jb4H%% b4J#8$$ #rg   