+
    Bi5                         ^ RI t ^ RIt^ RIt^ RIHtHt ^ RIt^ RIHt  ! R R]P                  4      t	]! 4        ! R R]P                  4      4       t
]R8X  d   ]P                  ! 4        R# R# )	    N)script_helperrequires_subprocess)mockc                      a  ] tR t^t o R tR tR tR t]P                  ! R4      R 4       t
]P                  ! R4      R 4       tRtV tR	# )
TestScriptHelperc                h    \         P                  ! R R4      pV P                  ^ V^ ,          R4       R# )-cimport sys; sys.exit(0)zreturn code was not 0N)r   assert_python_okassertEqual)selfts   & ./usr/lib/python3.14/test/test_script_helper.pytest_assert_python_ok&TestScriptHelper.test_assert_python_ok   s,    **41JKAaD"9:    c                `    \         P                  ! R R4      w  rpV P                  ^ VR4       R# )r	   sys.exit(0)zreturn code should not be 0N)r   assert_python_failureassertNotEqual)r   rcouterrs   &   r   test_assert_python_failure+TestScriptHelper.test_assert_python_failure   s+    $::4OAr#@Ar   c                   V P                  \        4      ;_uu_ 4       p\        P                  ! R R4       RRR4       \	        XP
                  4      pV P                  RV4       V P                  RVRR7       R#   + '       g   i     LM; i)r	   r   Nzcommand line:zunexpected command linemsg)assertRaisesAssertionErrorr   r   str	exceptionassertInr   error_context	error_msgs   &  r   test_assert_python_ok_raises-TestScriptHelper.test_assert_python_ok_raises   sd    ~..-**4? ///0	oy1mY4MN	 /.   A;;B	c                   V P                  \        4      ;_uu_ 4       p\        P                  ! R R4       RRR4       \	        XP
                  4      pV P                  RV4       V P                  RVRR7       R#   + '       g   i     LM; i)r	   r
   NzProcess return code is 0
zunexpected command line.r   )r   r    r   r   r!   r"   r#   r$   s   &  r   !test_assert_python_failure_raises2TestScriptHelper.test_assert_python_failure_raises   sl    ~..-//6OP ///0	2I>/4 	 	6	 /.r)   zsubprocess.Popenc                   \         P                  P                  \        R RR7      ;_uu_ 4       p\	        R4      Vn         \        P                  ! RRR4       V P                  ^VP                  4       V P                  ^VP                  4       VP                  ^ ,          ^ ,          pV P                  \        P                  V^ ,          4       V P                  RV4       V P                  RV4       V P                  R	V4       RRR4       R#   \         d.   pT P                  RTP                  ^ ,          4        Rp?LRp?ii ; i  + '       g   i     R# ; i)
 interpreter_requires_environmentFreturn_valuebail out of unittestTr	   NoneN-I-E)r   patchobjectr   RuntimeErrorside_effect_assert_pythonr   args
call_count	call_argssys
executabler#   assertNotInr   
mock_popenmock_ire_funcr   popen_commands   &&   r   1test_assert_python_isolated_when_env_not_requiredBTestScriptHelper.test_assert_python_isolated_when_env_not_required&   s!   ZZ}A,1  3 36C%12H%IJ"F,,T4@ Q
 5 56Q 8 89&003A6MS^^]1-=>MM&-0MM$.T=13 3   F  !7!EEF3 3 3s6   EDB/EE
#E EE

EE	c                   \         P                  P                  \        R RR7      ;_uu_ 4       p\	        R4      Vn         \        P                  ! RRR4       VP                  ^ ,          ^ ,          pV P                  RV4       V P                  RV4       RRR4       R#   \         d.   pT P                  RTP                  ^ ,          4        Rp?L{Rp?ii ; i  + '       g   i     R# ; i)	r.   Tr/   r1   r	   r2   Nr3   r4   )r   r5   r6   r   r7   r8   r9   r   r:   r<   r?   r@   s   &&   r   4test_assert_python_not_isolated_when_env_is_requiredETestScriptHelper.test_assert_python_not_isolated_when_env_is_required8   s     ZZ}A,0  2 25B%12H%IJ"F,,T4@ '003A6MT=1T=12 2   F  !7!EEF2 2 2s5   CB!>C!C,#CCCCC-	 N)__name__
__module____qualname____firstlineno__r   r   r'   r+   r   r5   rD   rG   __static_attributes____classdictcell____classdict__s   @r   r   r      sW     ;B
O6 
ZZ"#2 $2" 
ZZ"#2 $2r   r   c                      a  ] tR t^Ht o R tR t]P                  ! R4      R 4       t]P                  ! R4      R 4       t	]P                  ! R4      R 4       t
]P                  ! R4      R 4       tRtV tR	# )
TestScriptHelperEnvironmentc                X    V P                  \        R 4       R\        P                  R &   R# )$__cached_interp_requires_environmentN)assertHasAttrr   __dict__r   s   &r   setUp!TestScriptHelperEnvironment.setUpL   s$    =*PQIMEFr   c                ,    R \         P                  R&   R # )NrU   )r   rW   rX   s   &r   tearDown$TestScriptHelperEnvironment.tearDownQ   s    IMEFr   zsubprocess.check_callc                   \         P                  P                  \        P                  4      ;_uu_ 4        \        P                  P                  R R4       \        P                  ! RR4      Vn        V P                  \        P                  ! 4       4       V P                  \        P                  ! 4       4       V P                  ^VP                  4       RRR4       R#   + '       g   i     R# ; i)
PYTHONHOMEN )r   r5   dictosenvironpop
subprocessCalledProcessErrorr8   
assertTruer   r.   r   r;   r   mock_check_calls   &&r   *test_interpreter_requires_environment_trueFTestScriptHelperEnvironment.test_interpreter_requires_environment_trueU   s    ZZ__RZZ((JJNN<.*4*G*GB*OO'OOMJJLMOOMJJLMQ : :; )(((s   B!C!!C2	c                   \         P                  P                  \        P                  4      ;_uu_ 4        \        P                  P                  R R4       \        P                  ! 4        V P                  \        P                  ! 4       4       V P                  ^VP                  4       RRR4       R#   + '       g   i     R# ; i)r_   N)r   r5   ra   rb   rc   rd   r   r.   assertFalser   r;   rh   s   &&r   +test_interpreter_requires_environment_falseGTestScriptHelperEnvironment.test_interpreter_requires_environment_false^   ss    ZZ__RZZ((JJNN<.::<]KKMNQ : :; )(((s   A6B66C	c                   \         P                  P                  \        P                  4      ;_uu_ 4        \        P                  P                  R R4       \        P                  ! 4        V P                  \        P                  ! 4       4       V P                  \        P                  ! 4       4       V P                  ^VP                  4       VP                  ^ ,          ^ ,          pV P                  \        P                  V^ ,          4       V P                  RV4       RRR4       R#   + '       g   i     R# ; i)r_   Nr4   )r   r5   ra   rb   rc   rd   r   r.   rm   r   r;   r<   r=   r>   r#   )r   ri   check_call_commands   && r   -test_interpreter_requires_environment_detailsITestScriptHelperEnvironment.test_interpreter_requires_environment_detailsg   s    ZZ__RZZ((JJNN<.::<]KKMN]KKMNQ : :;!0!:!:1!=a!@S^^-?-BCMM$ 23 )(((s   C-D--D>	c                   \         P                  P                  \        P                  4      ;_uu_ 4        R \        P                  R&   V P                  \        P                  ! 4       4       V P                  \        P                  ! 4       4       V P                  ^ VP                  4       RRR4       R#   + '       g   i     R# ; i)
MockedHomer_   N)
r   r5   ra   rb   rc   rg   r   r.   r   r;   rh   s   &&r   5test_interpreter_requires_environment_with_pythonhomeQTestScriptHelperEnvironment.test_interpreter_requires_environment_with_pythonhomes   sv    ZZ__RZZ(('3BJJ|$OOMJJLMOOMJJLMQ : :;	 )(((s   A8B88C		rI   N)rJ   rK   rL   rM   rY   r\   r   r5   rj   rn   rr   rv   rN   rO   rP   s   @r   rS   rS   H   s     N
N 
ZZ'(< )< 
ZZ'(< )< 
ZZ'(	4 )	4 
ZZ'(< )<r   rS   __main__)re   r=   rb   test.supportr   r   unittestr   TestCaser   rS   rJ   mainrI   r   r   <module>r}      si     
 	 ;  :2x(( :2z 0<("3"3 0< 0<f zMMO r   