+
    Bi5                         R t ^ 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# )	zEUnittests for test.support.script_helper.  Who tests the test helper?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)
z>Ensure that -I is not passed when the environment is required.r-   Tr.   r0   r   r1   Nr2   r3   )r   r4   r5   r   r6   r7   r8   r   r9   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   r4   rC   rF   __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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
# )TestScriptHelperEnvironmentz5Code coverage for interpreter_requires_environment().c                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 # )NrT   )r   rV   rW   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   r4   dictosenvironpop
subprocessCalledProcessErrorr7   
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   r4   r`   ra   rb   rc   r   r-   assertFalser   r:   rg   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^   Nr3   )r   r4   r`   ra   rb   rc   r   r-   rl   r   r:   r;   r<   r=   r"   )r   rh   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   r4   r`   ra   rb   rf   r   r-   r   r:   rg   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		rH   N)rI   rJ   rK   rL   __doc__rX   r[   r   r4   ri   rm   rq   ru   rM   rN   rO   s   @r   rR   rR   H   s     ?N
N 
ZZ'(< )< 
ZZ'(< )< 
ZZ'(	4 )	4 
ZZ'(< )<r   rR   __main__)rw   rd   r<   ra   test.supportr   r   unittestr   TestCaser   rR   rI   mainrH   r   r   <module>r}      sj    K  
 	 ;  :2x(( :2z 0<("3"3 0< 0<f zMMO r   