h%Z dZedkr edddlZddlZddlZddlZddlZddlZddl Z ddl Z ddl Z ddl Z ddl Z ddlZddlmZ ddlmZn #e$rdZYnwxYwgdZd Ze jd kr d e jvrd Zn e jd krd ZdZdZdZejejeZejeZejeZ eje Z!Gdde"Z#Gdde#Z$Gdde$Z%Gdde#Z&Gdde j'Z(dZ)dZ*dZ+dZ,dZ-da.da/dZ0dZ1da2dZ3d Z4d!Z5d"Z6d#Z7dd$Z8d%Z9d&Z:d'Z;d(Zddddd*d,Z?d-Z@d.ZAd/ZBe jCeDEd0Fd1d2ZGdd4ZHdd6ZIdd8ZJdd:ZKd;ZLdd=ZMe jCed>ZNe jFd?ZOePe d@ZQe jdAvreQrdBndCZRndZRe jdDkZSe jdEkZTePedFoeS oeT ZUdGZVeS oeT ZWdHZXeS oeT ZYddIdJZZdZ[e jd kr! e j\dKdKkZ[n #e]$rYnwxYwdLZ^dZ_dZ`ejaedMZbdNZcddOZddPZeddddRdSZfdTZgejhdUZidVZjdWZkdXZldYZmejhdZZnd[Zod\Zpd]ZqePe d^rd_epzZpd`ZqepdazZrdbZsdcZtddZudeZvdfZwejhdgZxdhZydiZzdjezzZ{dke{zZ|dle{zZ}e j~ZdmZGdndoZddqZdrZGdsdtZduZdvZdwZddxZdyZdzZd{Zd|Zd}Zd~ZdadadadZdZddZdZdZdZeoe jd koe jd Zejduoe Ze jCedZddZdZdZe je_dadZejhdZejhdZdZdZGddeZdadZGddZdZdddZ ddZddZGddZdZejhdZdZddZgfdZdadZejhdZGddZdZGddZeZGddZeZejGddZeZejGddZe¦ZdZe jjZedvsJdZGddZdddZdZdZejhddZdededefdZdeddfdZdZejhdZdS)z7Supporting definitions for the Python regression tests.z test.supportz.support must be imported from the test packageN)get_test_runner)unicode_legacy_string)K PIPE_MAX_SIZEverbose max_memuse use_resourcesfailfastError TestFailed TestDidNotRunResourceDeniedrecord_original_stdoutget_original_stdoutcaptured_stdoutcaptured_stdincaptured_stderris_resource_enabledrequiresrequires_freebsd_versionrequires_linux_versionrequires_mac_vercheck_syntax_errorBasicTestRunner run_unittest run_doctest requires_gzip requires_bz2 requires_lzma bigmemtestbigaddrspacetest cpython_only get_attributerequires_IEEE_754 requires_zlibhas_fork_support requires_forkhas_subprocess_supportrequires_subprocesshas_socket_supportrequires_working_socketanticipate_failureload_package_testsdetect_api_mismatch check__all__skip_if_buggy_ucrt_strfptimecheck_disallow_instantiationcheck_sanitizerskip_if_sanitizer is_jython is_android is_emscriptenis_wasicheck_impl_detail unix_shellsetswitchintervalopen_urlresource reap_childrenrun_with_locale swap_itemfindfileinfinite_recursion swap_attrMatcher set_memlimitSuppressCrashReportsortdict run_with_tzPGOmissing_compiler_executable ALWAYS_EQNEVER_EQLARGESTSMALLESTLOOPBACK_TIMEOUTINTERNET_TIMEOUT SHORT_TIMEOUT LONG_TIMEOUTg@win32z 32 bit (ARM) vxworksgN@g>@gr@ceZdZdZdS)r z*Base class for regression test exceptions.N__name__ __module__ __qualname____doc__,/usr/lib/python3.11/test/support/__init__.pyr r rs4444r[r ceZdZdZdS)r Test failed.NrUrZr[r\r r usr[r c(eZdZdZfdZdZxZS)TestFailedWithDetailsr^cx||_||_||_t|||dSN)msgerrorsfailuressuper__init__)selfrcrdre __class__s r\rgzTestFailedWithDetails.__init__zs:    fh/////r[c|jSrb)rcrhs r\__str__zTestFailedWithDetails.__str__s xr[)rVrWrXrYrgrl __classcell__)ris@r\r`r`xsM00000 r[r`ceZdZdZdS)r zTest did not run any subtests.NrUrZr[r\r r s((((r[r ceZdZdZdS)rzTest skipped because it requested a disallowed resource. This is raised when a test calls requires() for a resource that has not be enabled. It is used to distinguish between expected and unexpected skips. NrUrZr[r\rrsr[rc$|r tjSdS)zDecorator to mark a test that is known to be broken in some cases Any use of this decorator should have a comment identifying the associated tracker issue. c|SrbrZ)fs r\z$anticipate_failure..sQr[)unittestexpectedFailure) conditions r\r,r,s ('' ;r[cv|d}t}||||}|||S)zGeneric load_tests implementation for simple test packages. Most packages can implement load_tests using this function as follows: def load_tests(*args): return load_package_tests(os.path.dirname(__file__), *args) Nztest*) start_dir top_level_dirpattern) STDLIB_DIRdiscoveraddTests)pkg_dirloaderstandard_testsrztop_dir package_testss r\r-r-sOGOOg29,3$55MM*** r[cx t||}|S#t$rtjd|d|wxYw)z?Get an attribute, raising SkipTest if AttributeError is raised.zobject z has no attribute )getattrAttributeErrorrtSkipTest)objname attributes r\r#r#s^C&&  OOO333 MNNNOs%9Fc |adSrb)_original_stdout)stdouts r\rrsr[c(tp tjSrb)rsysrrZr[r\rrs  )sz)r[cv ||S#t$r/}tdkrt|jjd|d}~wt $rp}tdkr7t|jjd|td|j|t j|tj ||cYd}~Sd}~wwxYw)Nz: zre-run ) FileNotFoundErrorrprintrirVOSErroroschmodstatS_IRWXU)pathfuncargserrs r\ _force_runrs tT{  a<< cm444cc: ; ; ;  a<< cm444cc: ; ; ; E4==$$7 8 8 8 t|$$$tT{ s% B8*; B8A%B3-B83B8c &ttdr tjSddl}d}tjdr|rd}ntjdrddlddld}d}Gfddj }j j }| }|s |}j}||||||} | s t'|j|zsd}ntjd krdd lm} mm} m } dd lm} | | d }|dkrd }nYGfdd| }|}| |}||dks||dkrd}|s ddlm}|}| |!|"nn#tF$ra}tI|}tK|dkr |dddz}d&tO|j(|}Yd}~nd}~wwxYw|t_)| t_tjS)Nresultrwinz(gui is not available on Windows IoT CorercbeZdZdjjfdjjfdjjfgZdS)*_is_gui_available..USEROBJECTFLAGSfInherit fReserveddwFlagsN)rVrWrXwintypesBOOLDWORD_fields_)ctypessr\USEROBJECTFLAGSrs=#V_%9:$fo&:;"FO$9:.ProcessSerialNumber highLongOfPSN lowLongOfPSNN)rVrWrXr)rsr\ProcessSerialNumberrs&,e4+U35r[rz#cannot run without OS X gui process)Tk2z [...]zTk unavailable due to {}: {})*hasattr_is_gui_availablerplatformr startswith win32_is_iotrctypes.wintypesrwindlluser32GetProcessWindowStationWinErrorrrGetUserObjectInformationWbyrefsizeofboolrrrr ctypes.utilr LoadLibraryCGMainDisplayIDGetCurrentProcessSetFrontProcesstkinterrwithdrawupdatedestroy ExceptionstrlenformattyperVreason)rr UOI_FLAGS WSF_VISIBLErdllhuofneededresrrrr app_servicesrpsnpsn_prroote err_stringrrs @@r\rrs (++( ''OOO F |u%%2?(*?*?*A*A2?;   ' '0?     < < < < < <   G G " " " " " "244D MMOOO KKMMM LLNNNN G G GQJ:##'_x7 3::477;K;EGGFFFFFF  G &#)z  ##s3A J K+ AK&&K+c&tdup|tvS)zTest whether a resource is enabled. Known resources are set by regrtest.py. If not running under regrtest.py, all resources are assumed enabled unless use_resources has been set. N)r resources r\rr%s D =H $==r[ct|s|d|z}t||dvrtstd|dkr'tsttjdSdS)z@Raise ResourceDenied if the specified resource is not available.Nz"Use of the %r resource not enabled>networkurlfetchzNo socket supportgui)rrr*rr)rrcs r\rr-s x ( (" ;6ACS!!!***3E*01115!2!4!4.5666r[cddl}dtt|}|ddd}||krO ttt|d}||k}n#t$rd}YnwxYwd}tj ||d|d|S) zDecorator raising SkipTest if the OS is `sysname` and the version is less than `min_version`. For example, @_requires_unix_version('FreeBSD', (7, 2)) raises SkipTest if the FreeBSD version is less than 7.2. rN.-rFz version  or higher required, not ) rjoinmaprreleasesplitsystemtupleint ValueErrorrtskipIf)sysname min_versionrmin_version_txt version_txtversionskips r\_requires_unix_versionr8sOOOhhs3 4455O""$$**32215KG## )C[%6%6s%;%;<<==G[(DD   DDD   ?   _       s45B00 B?>B?c"td|S)zDecorator raising SkipTest if the OS is FreeBSD and the FreeBSD version is less than `min_version`. For example, @requires_freebsd_version(7, 2) raises SkipTest if the FreeBSD version is less than 7.2. FreeBSDrrs r\rrSs ")[ 9 99r[c"td|S)zDecorator raising SkipTest if the OS is Linux and the Linux version is less than `min_version`. For example, @requires_linux_version(2, 6, 32) raises SkipTest if the Linux version is less than 2.6.32. Linuxrrs r\rr\s "'; 7 77r[cfd}|S)zDecorator raising SkipTest if the OS is Mac OS X and the OS X version if less than min_version. For example, @requires_mac_ver(10, 5) raises SkipTest if the OS X version is lesser than 10.5. cXtjfd}|_|S)Nctjdkrddl}|d} tt t |d}|krBdt t}tj d|d|n#t$rYnwxYw|i|S)Nrrrz Mac OS X r) rrmac_verrrrrrrrtrr)rkwrrrrrrs r\wrapperz4requires_mac_ver..decorator..wrapperms|x''&..003  >#C[->->s-C-C$D$DEEG,,*-((3sK3H3H*I*I&//. =>>>-"D4$$$ $s5B// B<;B<) functoolswrapsr)rr rs` r\ decoratorz#requires_mac_ver..decoratorlsF    % % % % %   %*r[rZ)rr s` r\rres$& r[c|sd} tjdk}n>#ttf$r*}t jd|dtd}Yd}~nd}~wwxYwtj ||S)z4Decorator raising SkipTest if running on a buildbot.znot suitable for buildbotsbuildbotzgetpass.getuser() failed rFN) getpassgetuserlowerKeyErrorEnvironmentErrorwarningswarnRuntimeWarningrtr)r isbuildbotrs r\skip_if_buildbotrs .-_&&,,..*< & ' 8#888.III  ?:v . ..s)0A+ A&&A+addressmemoryubc|s|s|stdtjdpd}tjdpd}d|vpd|v}d|vpd|v}d|vpd |v}|r|p|o|p|o|S) z9Returns True if Python is compiled with sanitizer supportz3At least one of address, memory, or ub must be TrueCFLAGS CONFIG_ARGSz-fsanitize=memoryz--with-memory-sanitizerz-fsanitize=addressz-fsanitize=undefinedz#--with-undefined-behavior-sanitizer)r sysconfigget_config_var)rrr_cflags _config_argsmemory_sanitizeraddress_sanitizer ub_sanitizers r\r2r2s PvPPNOOO&x006BG+M::@bLw& 2!\1 ' 2!\1 ') >-=  $$   &&   r[cX|sd}t|||}tj||S)z>Decorator raising SkipTest if running with a sanitizer active.z"not working with sanitizers activer)r2rtr)rrrrrs r\r3r3s5 65 76b A A AD ?4 ( ((r[cFtjfd}|S)z5Skip the test on TLS certificate validation failures.c |i|dS#t$r+}dt|vrtjdd}~wwxYw)NCERTIFICATE_VERIFY_FAILEDz.system does not contain necessary certificates)rrrtr)rkwargsrrrs r\decz&system_must_validate_cert..decst  At v        *c!ff44')ABBB   s A&=A)r r )rrr-s` r\system_must_validate_certr.s8_Q Jr[i@idoubleIEEEztest requires IEEE 754 doubles requires zlibc\ ddl}n#t$rd}YnwxYwtj||SNr)zlib ImportErrorrt skipUnless)rr4s r\r%r%I   tV , ,,   requires gzipc\ ddl}n#t$rd}YnwxYwtj||Sr3)gzipr5rtr6)rr;s r\rrr7r8 requires bz2c\ ddl}n#t$rd}YnwxYwtj||Sr3)bz2r5rtr6)rr>s r\rrsI   sF + ++r8 requires lzmac\ ddl}n#t$rd}YnwxYwtj||Sr3)lzmar5rtr6)rrAs r\rrr7r8c ddl}n"#t$rtjdwxYw|}t |d S)Nr_testinternalcapi requiredcode_debug_ranges)_testinternalcapir5rtr get_configr)rEconfigs r\has_no_debug_rangesrHsk>     >>> <===>  ) ) + +FF./00 00&$requires co_positions / debug_rangescDtjt|Srb)rtrrH)rs r\requires_debug_rangesrLs ?.00& 9 99r[zrequires legacy Unicode C APIjavagetandroidapilevel)rQrSz/system/bin/shz/bin/sh emscriptenwasiforkc6tjtdS)Nzrequires working os.fork())rtr6r&rZr[r\r'r' s  /1M N NNr[c6tjtdS)z3Used for subprocess, os.spawn calls, fd inheritancezrequires subprocess support)rtr6r(rZr[r\r)r)s  57T U UUr[)modulecxd}|rtstj|dStjt|S)zSkip tests or modules that require working sockets Can be used as a function/class decorator or to skip an entire module. zrequires socket supportN)r*rtrr6)rTrcs r\r+r+sJ $C <! )#C(( ( ) )"#5s;;;r[z%4Yzhttp://www.pythontest.netdatactjdkrdSddl}d}|d}|\}}t ||dt |t d|zdS)zOAssure user that loud errors generated by macOS libc's malloc are expected.rNrz NOTICE z may generate "malloc can't allocate region" warnings on macOS systems. This behavior is known. Do not report a bug unless tests are also failing. See bpo-40928.r)rrshutilget_terminal_sizercenter) test_namerXrcdetailpadding_s r\darwin_malloc_err_warningr_;s |xMMM CKKKF))++JGQ #**Wc " "### &MMM #-r[cFtj|r|S| tj||}tgt jz}|D]E}tj||}tj|r|cSF|S)a[Try to find a file on sys.path or in the test directory. If it is not found the argument passed to the function is returned (this does not necessarily signal failure; could still be the legitimate path). Setting *subdir* indicates a relative path to use to find the file rather than looking directly in the path directories. )rrisabsr TEST_HOME_DIRrexists)filenamesubdirrdnfns r\r?r?Ms w}}X 7<<11 ?SX %D)) W\\"h ' ' 7>>"  (byyy( Or[ct|}d|D}d|}d|zS)z%Like repr(dict), but in sorted order.cg|]}d|zS)z%r: %rrZ).0pairs r\ zsortdict..cs333TD333r[z, z{%s})sorteditemsr)dictrn reprpairs withcommass r\rErE`sF 4::<< E33U333I9%%J J r[r)linenooffsetc||t|5}t|dddddn #1swxYwY|j}||j|||j|||j|||j|dSdS)Nz exec)assertRaisesRegex SyntaxErrorcompile exceptionassertIsNotNonerr assertEqualrs)testcase statementerrtextrrrscmrs r\rrgs  # #K 9 94R ?F333444444444444444 ,C SZ((( SZ000 SZ((( SZ00000s :>>c ddl}ddl}ddlm} ddl}n#t $rd}YnwxYwdd |j|d dd}tj t|} fd}tj |r||} | | S||td t r t#d |zt% |j} |r| jd | |t0 } |r4| jddkr|| } t/|d5} | } | r+| | | } | +dddn #1swxYwY| n#| wxYw||} | | St?d|z)Nrr)unlinkcheckr/ct|gRi}|S|r|d|S|dSr3)openseekclose)rgrrrrrs r\check_valid_filez*open_urlresource..check_valid_files_  !d ! ! !b ! ! =H U1XX  FF1IIIH  r[rz fetching %s ...file)zAccept-Encodingr;timeoutzContent-Encodingr;)fileobjwbzinvalid resource %r) urllib.request urllib.parse os_helperrr;r5popparseurlparserrrr TEST_DATA_DIRrcrrrrrequest build_opener addheadersappendrrNheadersgetGzipFilereadwriterr )urlrrurllibrr;rdrgrrropeneroutsrs `` @r\r;r;ss''''''''!!!!!!  FF7D ! !E|$$S))!,22377;H mX . .B w~~b  R  =Hr  ZE !C'.A.C.CDDDD ^ ( ( * *F >  !<=== C!1 22A % 011V;; MM!M $ $ "d^^ sA  ! FFHH                   A} *R/ 0 00s= ''H,AG:. H:G>>HG>HH0c#Kddl}tt|}tt|| tt|Vtt||dS#tt||wxYw)zReturn a context manager used by captured_stdout/stdin/stderr that temporarily replaces the sys stream *stream_name* with a StringIO.rN)iorrsetattrStringIO) stream_namer orig_stdouts r\captured_outputrsIII#{++K Cbkkmm,,,/c;'''''[+.....[+....s A44B c tdS)zCapture the output of sys.stdout: with captured_stdout() as stdout: print("hello") self.assertEqual(stdout.getvalue(), "hello\n") rrrZr[r\rr 8 $ $$r[c tdS)zCapture the output of sys.stderr: with captured_stderr() as stderr: print("hello", file=sys.stderr) self.assertEqual(stderr.getvalue(), "hello\n") stderrrrZr[r\rrrr[c tdS)a Capture the input to sys.stdin: with captured_stdin() as stdin: stdin.write('hello\n') stdin.seek(0) # call test code that consumes from sys.stdin captured = input() self.assertEqual(captured, "hello") stdinrrZr[r\rrs 7 # ##r[cddl}|trtjd||dS)aForce as many objects as possible to be collected. In non-CPython implementations of Python, this is needed because timely deallocation is not guaranteed by the garbage collector. (Even in CPython this can be the case in case of reference cycles.) This means that __del__ methods may be called later than expected and weakrefs may remain alive for longer than expected. This function tries its best to force all garbage objects to disappear. rN皙?)gccollectr4timesleep)rs r\ gc_collectrsMIIIJJLLL 3JJLLLJJLLLLLr[c#Kddl}|}| dV|r|dSdS#|r|wwxYwr3)r isenableddisableenable)rhave_gcs r\ disable_gcrsy IIIllnnGJJLLL    IIKKKKK  7  IIKKKK s AA'ctjdpd}d}|D]}|dr|}|dvS)z,Find if Python was built with optimizations. PY_CFLAGSrz-O)rz-O0z-Og)r!r"rr)cflags final_optopts r\python_is_optimizedrsY  %k 2 2 8bFI||~~ >>$   I . ..r[nP0n getobjects2P0PncTddl}|t|ztzSr3)structcalcsize_header_alignfmtrs r\ calcobjsizers&MMM ??7S=61 2 22r[cTddl}|t|ztzSr3)rr_vheaderrrs r\ calcvobjsizers&MMM ??8c>F2 3 33r[i@ic ddl}n"#t$rtjdwxYwt j|}t |t kr|jtzs4t |t kr&t |jtzr ||j z }dt |||fz}| |||dS)NrrCz&wrong size for %s: got %d, expected %d) rEr5rtrr getsizeofr __flags___TPFLAGS_HEAPTYPE_TPFLAGS_HAVE_GCSIZEOF_PYGC_HEADr{)testosizerErrcs r\ check_sizeofrs>     >>> <===> ]1  F aDq{->> q''T//Q 14D D/ !22 2Aww% &CVT3'''''rIc'ZK ddl}t||}||}|D]!} |||n#YxYwn#t$rdx}}YnxYw dV|r|r|||dSdSdS#|r|r|||wwwxYwr3)localer setlocaler)catstrlocalesrcategory orig_localelocs r\r=r=!s& 66**&&x00   C   3///   $##4   4k 4   X{ 3 3 3 3 3 4 4 4 46 4k 4   X{ 3 3 3 3 4 4s")AA  AA$(B B*cfd}|S)NcFfd}j|_j|_|S)Nc tj}n"#t$rtjdwxYwdt jvrt jd}nd}t jd<| |i||t jd=n|t jd<tjS#|t jd=n|t jd<tjwxYw)Nztzset requiredTZ)rtzsetrrtrrenviron)rkwdsrorig_tzrtzs r\innerz-run_with_tz..decorator..innerAs : ! : : :'(8999 :rz!!*T*!BJt  EGGG tT*T**? 4(('.BJt$ ? 4(('.BJt$ s //B))4C)rVrY)rrrs` r\r zrun_with_tz..decorator@s;      ,   r[rZ)rr s` r\rFrF?s$4 r[ircdttdtzd}tjd|tjtjz}|t d|tt| d|| d z}|a |tkrt}|tdz krt d|d|adS) Nr)kmgtz(\d+(\.\d+)?) (K|M|G|T)b?$zInvalid memory limit rz Memory limit z too low to be useful)_1M_1Grematch IGNORECASEVERBOSErrfloatgrouprreal_max_memuseMAX_Py_ssize_t_2Gr)limitsizesrmemlimits r\rCrCis   #X   E .+ - -Ayjee=>>>5$$uQWWQZZ-=-=-?-?'@@AAHO.  !#'j555JKKKJJJr[c$eZdZdZdZdZdZdS)_MemoryWatchdogz`An object which periodically watches the process' memory consumption and prints it out. cldtj|_d|_dS)Nz/proc/{pid}/statm)pidF)rrgetpidprocfilestartedrks r\rgz_MemoryWatchdog.__init__s++22ry{{2CC  r[cddl} t|jd}n_#t$rR}|jd|t tj Yd}~dSd}~wwxYwddl }|5td}| tj |g||j|_dddn #1swxYwYd|_dS)Nrrz!/proc not available for stats: {}zmemory_watchdog.py)rrT)rrrrrrrrrflush subprocessr?Popen executableDEVNULL mem_watchdogr)rhrrrrrwatchdog_scripts r\startz_MemoryWatchdog.startsS T]C((AA    HM=DDQGG( * * * J      FFFFF     L L&';<C  CCc||jr4|j|jdSdSrb)rr terminatewaitrks r\stopz_MemoryWatchdog.stopsF < %   ' ' ) ) )   " " $ $ $ $ $ % %r[N)rVrWrXrYrgrrrZr[r\r r ~sK$%%%%%r[r Tcfd}|S)atDecorator for bigmem tests. 'size' is a requested size for the test (in arbitrary, test-interpreted units.) 'memuse' is the number of bytes per unit for the test, or a good estimate of it. For example, a test that needs two byte buffers, of 4 GiB each, could be decorated with @bigmemtest(size=_4G, memuse=2). The 'size' argument is normally passed to the decorated test method as an extra argument. If 'dry_run' is true, the value passed to the test method may be less than the requested value. If 'dry_run' is false, it means the test doesn't support dummy runs when -M is not specified. c6fd__S)Ncj}j}tsd}n|}tss+t||zkrtjd||zdz ztrat rZt t d||zdz t}| nd} |||r| SS#|r| wwxYw)Ni'not enough memory: %.1fG minimum needed@z* ... expected peak memory use: {peak:.1f}G)peak) rmemuserrtrrrrr rr)rhrr$maxsizewatchdogdry_runrrr s r\r z.bigmemtest..decorator..wrappers)v??AAA*,,     $qw''$MMOOOO$8$MMOOOO$s ; CC7)rr$)rrr r'r$rs`@r\r zbigmemtest..decorators= $ $ $ $ $ $ $: r[rZ)rr$r'r s``` r\r r s1       B r[cfd}|S)z0Decorator for tests that fill the address space.cttkrItdkrtdkrtjdtjdtdz z|S)Nllz-not enough memory: try a 32-bit build insteadr!r")rrrtr)rhrrs r\r z!bigaddrspacetest..wrapperst  & &**zU/B/B'CEEE'=%356661T77Nr[rZ)rrr s` r\r!r!s#      Nr[ceZdZdZdS)rcBtj}|||Srb)rt TestResult)rhrrs r\runzBasicTestRunner.runs"$&& V  r[N)rVrWrXr-rZr[r\rrs#r[rc|SrbrZ)rs r\_idr/s Jr[c|dkr,tstjtjSt |rt Stjd|S)Nrzresource {0!r} is not enabled)rrtrrrr/rrs r\requires_resourcer1sb5!2!4!4}.56668$$O }<CCHMMNNNr[c4td|S)z9 Decorator for tests only applicable on CPython. T)cpython) impl_detailrs r\r"r"s %;t $ $ $T * **r[c tdi|rtS|bt|\}}|rd}nd}t|}|d|}tj|S)Nz*implementation detail not available on {0}z%implementation detail specific to {0}z or rZ) r8r/ _parse_guardsrmkeysrrrtr)rcguards guardnamesdefaults r\r4r4s""6""  {+F33 G  :>CC9CJOO--.. jjZ0011 =  r[c|sddidfSt|d}t||gt|zksJ|| fS)Nr3TFr)listvaluesr)r9is_trues r\r7r7so *D!5))6==??##A&G   WIF $; ; ; ; ; K  r[c pt|\}}|tjj|S)a5This function returns True or False depending on the host platform. Examples: if check_impl_detail(): # only on CPython (default) if check_impl_detail(jython=True): # only on Jython if check_impl_detail(cpython=False): # everywhere except on CPython )r7rrimplementationr)r9r;s r\r8r8s/$F++OFG ::c(-w 7 77r[ctttdsStjfd}|S)zEDecorator to temporarily turn off tracing for the duration of a test.gettracectj} tjd|i|tj|S#tj|wxYwrb)rrCsettrace)rr,original_tracers r\r zno_tracing..wrappers^ \^^N - T"""tT,V,, ^,,,, ^,,,,s AA)rrr r )rr s` r\ no_tracingrGsO 3 # #     - - - -   -r[c:tt|S)aDecorator for tests which involve reference counting. To start, the decorator does not run the test if is not run by CPython. After that, any trace function is unset during the test to prevent unexpected refcounts caused by the trace function. )rGr"r5s r\ refcount_testrI*s l4(( ) ))r[cg}|jD]b}t|tjr&t ||||B||r||c||_dS)z>Recursively filter test cases in a suite based on a predicate.N)_tests isinstancert TestSuite _filter_suiter)suiteprednewtestsrs r\rNrN5sH && dH. / / & $ % % % OOD ! ! ! !tDzz &%%%ELLLr[cttjttdu}||}t,t||js|j st| st|j dkr|js|j dd}nAt|jdkr|j s|jdd}nd}ts|dz }d|j D}d|jD}t|||dS) z2Run tests from a unittest.TestSuite-derived class.N) verbositycapture_outputrrzmultiple errors occurredz!; run in verbose mode for detailsc6g|]\}}t||fSrZrrjtcexc_strs r\rlz_run_suite..Vs'FFFW3r77G$FFFr[c6g|]\}}t||fSrZrVrWs r\rlz_run_suite..Ws'JJJ;2wSWWg&JJJr[)rrrrjunit_xml_listr-rget_xml_elementtestsRunskippedr wasSuccessfulrrdrer`)rOrunnerrrrdres r\ _run_suiteraAsG SZ'.-;4-GJJJFZZ  F!f4466777 ?6>    ! ! ; v}   " "6? "-"1%CC  ! !Q & &v} &/!$Q'CC,C FC#FFCFF FFFJJ&/JJJ#C::: ; ;r[cVtdSt|SNT)_match_test_funcidr5s r\ match_testrfbs#t ***r[c6d|votjd| S)Nrz[?*\[\]])rsearch)rzs r\_is_full_match_testrijs" 7N ERY{G%D%D!DEr[c|d}|d}dx|tkrt|\}|tkrt|\}t|at|a fd}|adSdS)NrZcJd}d}r |}r |}|o| S)NTFrZ)test_idacceptignore accept_func ignore_funcs r\match_functionz'set_match_tests..match_functionsHFF .$W-- .$W--(&j (r[)_accept_test_patterns_compile_match_function_ignore_test_patternsrrd)accept_patternsignore_patternsrqrorps @@r\set_match_testsrwts $$K+///'>'O'O$///'>'O'O$"/22!/22+"9 ) ) ) ) ) )*#:"9r[c |sd}d}nttt|rt|j}nLddl}dt|j|}tj |j fd}|}||fS)NrZr|c~|rdStt|dS)NTr)anyrr)rl regex_matchs r\match_test_regexz1_compile_match_function..match_test_regexsC{7## At 3{GMM#,>,>??@@@r[) allrriset __contains__fnmatchr translaterrxr)patternsrrregexr}r|s @r\rsrss   S$h / / 0 0 8}})W.99::j''-  A A A A A  T>r[cFtjtjf}tj}tj}|D]}t |t rV|t jvr9|| t j|^tdt ||r|||| |t|tt|dS)z1Run tests from unittest.TestCase-derived classes.z)str arguments must be keys in sys.modulesN)rtrMTestCase TestLoaderrLrrmodulesaddTestloadTestsFromModulerloadTestsFromTestCaserNrfra)classes valid_typesrrOclss r\rrs%x'89K  " "F   E = = c3   =ck!! f88S9IJJKKKK !LMMM [ ) ) = MM#     MM&66s;; < < < <%$$$ur[cdS)z,Just used to check if docstrings are enabledNrZrZr[r\_check_docstringsrsr[WITH_DOC_STRINGSztest requires docstringscddl}|t}nd}||||\}}|rtd||fztrt d|j|fz||fS)aRun doctest on the given module. Return (#failures, #tests). If optional argument verbosity is not specified (or is None), pass support's belief about verbosity on to doctest. Else doctest's usual behavior is used (it searches sys.argv for -v). rN)r optionflagsz%d of %d doctests failedz,doctest (%s) ... %d tests with zero failures)doctestrtestmodr rrV)rTrSrrrrrs r\rrsNNN  ??69+? N NDAq>3q!f<===$ <"# $ $ $ a4Kr[ctjtjtj tjdSdSrb)rrrrrZr[r\flush_std_streamsrsH z  z r[cttj}|D]}t d|||dS)Nz Warning -- r)r print_warning orig_stderr splitlinesrr)rcstreamlines r\rrs_  &F  11 "D""00000 LLNNNNNr[cttdrttdsdStsdS tjdtj\}}n#t $rYdSwxYw|dkrdSt d|daR)zUse this function at the end of test_main() whenever sub-processes are started. This will help ensure that no extra children (zombies) stick around to hog resources and create problems when looking for refleaks. waitpidWNOHANGNTrrz%reap_children() reaped child process )rrr(rrrrenvironment_altered)r statuss r\r<r<s B " "wr9'='= # # *R44KC    EE  !88 ECcCCDDD" #s"A A)(A)c#Kt||rOt||}t||| |Vt|||dS#t|||wxYwt||| dVt||rt||dSdS#t||rt||wwxYw)aTemporary swap out an attribute with a new object. Usage: with swap_attr(obj, "attr", 5): ... This will set obj.attr to 5 for the duration of the with: block, restoring the old value at the end of the block. If `attr` doesn't exist on `obj`, it will be created and then deleted at the end of the block. The old value (or None if it doesn't exist) will be assigned to the target of the "as" clause, if there is one. N)rrrdelattr)rattrnew_valreal_vals r\rArA3s sD #3%%T7### )NNN Cx ( ( ( ( (GCx ( ( ( (T7### # EEEsD!! #T""""" # #wsD!! #T"""" #sA A4B#B?c#K||vr#||}|||< |V|||<dS#|||<wxYw|||< dV||vr||=dSdS#||vr||=wxYw)aTemporary swap out an item with a new object. Usage: with swap_item(obj, "item", 5): ... This will set obj["item"] to 5 for the duration of the with: block, restoring the old value at the end of the block. If `item` doesn't exist on `obj`, it will be created and then deleted at the end of the block. The old value (or None if it doesn't exist) will be assigned to the target of the "as" clause, if there is one. NrZ)ritemrrs r\r>r>Rs  s{{t9D  !NNN CIIICI D   EEEs{{III{ts{{I s '? Ac2ddl}|S)znReturn a list of command-line arguments reproducing the current settings in sys.flags and sys.warnoptions.rN)r_args_from_interpreter_flagsrs r\args_from_interpreter_flagsrqs"  2 2 4 44r[c2ddl}|S)zgReturn a list of command-line arguments reproducing the current optimization settings in sys.flags.rN)r"_optim_args_from_interpreter_flagsrs r\!optim_args_from_interpreter_flagsrws"  8 8 : ::r[ceZdZdZdZdZdS)rB)rcmessagec d}|D]:}||}||}||||sd}n;|S)a. Try to match a single dict with the supplied arguments. Keys whose values are strings and which are in self._partial_matches will be checked for partial (i.e. substring) matches. You can extend this scheme to (for example) do regular expression matching, etc. TF)r match_value)rhdr,rrvdvs r\matcheszMatcher.matchess`  Aq AqB##Ar1--   r[ct|t|krd}n?t|tus ||jvr||k}n||dk}|S)zT Try to match a single stored value (dv) with a supplied value (v). Fr)rr_partial_matchesfind)rhrrrrs r\rzMatcher.match_valuesc 77d2hh  FF "XXS AT-B$B$B2gFFWWQZZ1_F r[N)rVrWrXrrrrZr[r\rBrB~s8)"     r[rBcddl}tItjdkr7|dkrt jjdkrdandatrtj d|n|S) a- Skip decorator for tests that use buggy strptime/strftime If the UCRT bugs are present time.localtime().tm_zone will be an empty string, otherwise we assume the UCRT bugs are fixed See bpo-37552 [Windows] strptime/strftime return invalid results with UCRT version 17763.615 rNrQcp65001rTFz!buggy MSVC UCRT strptime/strftime) r _buggy_ucrtrr getencodingr localtimetm_zonertr)rrs r\r0r0sMMM <7 " """$$ 11  (B..KKKGR \ =8=< = =d C C CX\\r[cheZdZdZddZejdkrdZndZdZdZ d Z d d d Z d d d Z dS) PythonSymlinkz3Creates a symlink for the current Python executableNc ddlm}|ptj||_g|_tjtj |_ g|_ d|_ | dS)Nr)TESTFN)rrrrabspathlink_linkedrealpathrrreal _also_link_env_platform_specific)rhrrs r\rgzPythonSymlink.__init__st%%%%%%3BGOOF33  G$$S^44   !!!!!r[rQc bddl}ddl}tj|jr>tj|js|d|_|tj }tj |}tj |j }|j |tj|tj|f|tj||dD]Y}|j |tj|tj|fZdtjD|_tj |j|jd<t'jrt*|jd<dSdS)Nrzvcruntime*.dllc\i|])}|tj|*SrZ)upperrgetenv)rjrs r\ z4PythonSymlink._platform_specific..s*EEEQBIaLLEEEr[ PYTHONHOME PYTHONPATH)glob_winapirrlexistsrrcGetModuleFileNamer dllhandledirnamerrrrbasenameescaperrr!is_python_buildr{)rhrrrsrc_dirdest_dirruntimes r\rz PythonSymlink._platform_specifics KKK NNNwty)) 9"'..2K2K 9$55a88 ++CM::Cgooc**Gwty11H O " " Xrw'7'7'<'<==$    99RW\\$++g2F2FHX%Y%YZZ  &&GLL27+;+;G+D+DEE( FE"*EEEDI&(goodi&@&@DIl #(** 5*4 ,''' 5 5r[cdSrbrZrks r\rz PythonSymlink._platform_specifics Dr[ctj|j|j|j|j|jD]4\}}tj|||j|5|Srb)rsymlinkrrrrr)rhrrs r\ __enter__zPythonSymlink.__enter__su 49di((( DI&&&/ & &JD$ JtT " " " L   % % % % r[c|jD]X} tj|#t$r4}tr#t d||Yd}~Qd}~wwxYwdS)Nzfailed to clean up {}: {})rrremoveIOErrorrrr)rhexc_type exc_valueexc_tbrexs r\__exit__zPythonSymlink.__exit__sL H HD H $ H H HH5< > MMOO <: % % 3d1Q4jj!!!d1Q4jjsz22229@@NNPP Pr[r)rc<||j|d|Srb)rrrhrrs r\ call_realzPythonSymlink.call_realszz$)T4<<z&detect_api_mismatch..sdFFa ||C00F45JJt4D4DFFFFFFFr[)rdir)ref_api other_apirn missing_itemss r\r.r.syG %%C NN(;(;;M %V$ FF=FFFFFM r[c| |jf}nt|tr|f}t|}t |D]~}|ds||vrt ||}t |dd|vs*t|ds/t|tj s| || |j |dS)a)Assert that the __all__ variable of 'module' contains all public names. The module's public names (its API) are detected automatically based on whether they match the public name convention and were defined in 'module'. The 'name_of_module' argument can specify (as a string or tuple thereof) what module(s) an API could be defined in in order to be detected as a public API. One case for this is when 'module' imports part of its public API from other modules, possibly a C backend (like 'csv' and its '_csv'). The 'extra' argument can be a set of names that wouldn't otherwise be automatically detected as "public", like objects without a proper '__module__' attribute. If provided, it will be added to the automatically detected ones. The 'not_exported' argument can be a set of names that must not be treated as part of the public API even though their names indicate otherwise. Usage: import bar import foo import unittest from test import support class MiscTestCase(unittest.TestCase): def test__all__(self): support.check__all__(self, foo) class OtherTestCase(unittest.TestCase): def test__all__(self): extra = {'BAR_CONST', 'FOO_CONST'} not_exported = {'baz'} # Undocumented name. # bar imports part of its API from _bar. support.check__all__(self, bar, ('bar', '_bar'), extra=extra, not_exported=not_exported) Nr^rW) rVrLrrrrrrtypes ModuleTypeaddassertCountEqual__all__) test_caserTname_of_moduleextra not_exportedexpectedrrs r\r/r/sR /, NC ( (,(+5zzHF  ??3   4<#7#7 fd## Ct , , > >S,// ?U%566 ? LL    v~x88888r[c ddl}n#t$rYdSwxYw||j|jz|jz|jzt|drf|j|j |j fD]S}|r7| ||j | ||j;| |dRdSdS)NrCrtSetReportMode)msvcrtr5 SetErrorModeSEM_FAILCRITICALERRORSSEM_NOALIGNMENTFAULTEXCEPTSEM_NOGPFAULTERRORBOXSEM_NOOPENFILEERRORBOXrCRT_WARN CRT_ERROR CRT_ASSERTrCRTDBG_MODE_FILECrtSetReportFileCRTDBG_FILE_STDERR)rrrs r\suppress_msvcrt_assertsr#Ys  5 ;< 67!78999 v)**./6#3V5FG . .A .''6+BCCC''6+DEEEE''1---- .. . .s  c&eZdZdZdZdZdZdZdS)rDzTry to prevent a crash report from popping up. On Windows, don't display the Windows Error Reporting dialog. On UNIX, disable the creation of coredump file. Nc:tjdr ddl}n#t$rYdSwxYw||_||j|jzt|dr`i|_ |j |j |j fD]D}|||j}|||j}||f|j |<En7 ddl}||_n#t$r d|_YnwxYw|jt |j|jj|_|j|jjd|jdfn#t,t.f$rYnwxYwtjdkrddl}gd}|||j|j}|5|d} dddn #1swxYwY| d krt;d d d |S)zOn Windows, disable Windows Error Reporting dialogs using SetErrorMode() and CrtSetReportMode(). On UNIX, try to save the previous core file size limit, then set soft limit to 0. rrNrrr)z/usr/bin/defaultsrzcom.apple.CrashReporter DialogType)rrs developerz:this test triggers the Crash Reporter, that is intentionalrT)endr)rrrrr5 GetErrorMode old_valuerrr old_modesrrrrr r!r"r getrlimit RLIMIT_CORE setrlimitrrrrrrstripr) rhr report_typeold_modeold_filerrrprocrs r\rzSuppressCrashReport.__enter__ws < " "5 ) )7 E      $0022DN   1M M N N Nv122 E!#$*O$*$4$*$5$7EEK &66{"3 5 5H%66{"5 7 7H2:H2DDN;// % (  % % % $  %}(%)]%<%>\11057tEEEE sC& 44% C11DDAE,,F?F?G&&G*-G*c|jdStjdrwddl}||j|jrN|jD]6\}\}}|||| ||5dSdS|j E |j |j j |jdS#ttf$rYdSwxYwdS)zARestore Windows ErrorMode or core file behavior to initial value.Nrr)r)rrrrrr*rnrr!rr-r,rr)rh ignore_excrr/r0r1s r\rzSuppressCrashReport.__exit__s$ > ! F < " "5 ) )  MMM    / / /~ C9=9M9M9O9OCC5K!5(H++KBBB++KBBBB C CCC}(M++DM,Et~VVVVV"G,DD)(s(*CC)(C))rVrWrXrYr)r*rrrZr[r\rDrDnsL II@@@Dr[rDctd jdn(#ttf$rtdYnwxYwfd}||t |dS)zOverride 'object_to_patch'.'attr_name' with 'new_value'. Also, add a cleanup procedure to 'test_instance' to restore 'object_to_patch' value for 'attr_name'. The 'attr_name' should be a valid attribute for 'object_to_patch'. FTNcRrtdStdSrb)rr) attr_is_local attr_nameobject_to_patchr)sr\cleanupzpatch..cleanups9  0 OY : : : : : OY / / / / /r[)r__dict__rr addCleanupr) test_instancer9r8 new_valuer:r7r)s `` @@r\patchr?s OY'''M#,Y7   H %>>>OY== > 00000000 W%%% OY 22222s ("A  A c#NK |dd}dV||dd<dS#||dd<wxYw)z-Like unittest.mock.patch.dict, but for lists.NrZ)origsaveds r\ patch_listrCsGQQQ QQQ%QQQs $c ddl}|rtjdn#t$rYnwxYwddl}||S)zi Run code in a subinterpreter. Raise unittest.SkipTest if the tracemalloc module is enabled. rNzUrun_in_subinterp() cannot be used if tracemalloc module is tracing memory allocations) tracemalloc is_tracingrtrr5 _testcapirun_in_subinterp)coderErGs r\rHrHs;  ! ! # # ;#%:;; ; ;        % %d + ++s / <<cGfdd|}d||||ttt|dS)NceZdZfdZdS)%check_free_after_iterating..AcNd tdS#t$rYdSwxYwrc)next StopIteration)rhdoneits r\__del__z-check_free_after_iterating..A.__del__s>D R     s  $$N)rVrWrXrR)rPrQsr\ArLs3        r[rSF) assertRaisesrOrNr assertTrue)riterrrrSrPrQs @@r\check_free_after_iteratingrWsC D aahBmT2...LLLOODr[cddlm}m}m}m}|}|j||jdkr' |n#|j $rYdSwxYw|j D]S}|r||vr t||}|r| Jd|zn|s.| |d |dcSTdS)a<Check if the compiler components used to build the interpreter exist. Check for the existence of the compiler executables whose names are listed in 'cmd_names' or all the compiler executables when 'cmd_names' is empty and return the first missing executable or None when none is found missing. r) ccompilerr!spawnrdmsvcNz%the '%s' executable is not configured) distutilsrYr!rZrd new_compilercustomize_compiler compiler_type initializeDistutilsPlatformError executablesrfind_executable) cmd_namesrYr!rZrdcompilerrrs r\rHrH!s0>===========%%''H I ***''     ! ! ! !,   66 $    Y.. h%%  ??;dB#???    Q ( ( 0q6MMM 1  sA A A cd}trG||krAt1ddl}|ddgdkatr|}t j|S)Ngh㈵>rgetpropzro.kernel.qemu1)r5_is_android_emulatorr check_outputr.rr:)intervalminimum_intervalrs r\r:r:Bs}(h!111  '    $.$;$; )+;<%>%>>Cegg%N  ('H   * **r[c#Kddl}tj}|} |dV|r||ddSdS#|r||dwwxYw)NrT)r all_threads) faulthandlerr __stderr__fileno is_enabledrr)rofdrrs r\disable_faulthandlerrtQs    B((**J;   ;   RT  : : : : : ; ;: ;   RT  : : : : ;s A//B c$eZdZdZdZdZdZdS) SaveSignalsz Save and restore signal handlers. This class is only able to save/restore signal handlers registered by the Python signal module: see bpo-13285 for "external" signal handlers. cddl}||_||_dD]>} t||}n#t$rY wxYw|j|?i|_dS)Nr)SIGKILLSIGSTOP)signal valid_signalssignalsrrrhandlers)rhrzsignamesignums r\rgzSaveSignals.__init__ls  ++-- - ( (G  11!     L   ' ' ' ' s; AAch|jD])}|j|}|||j|<*dSrb)r|rz getsignalr}rhrhandlers r\savezSaveSignals.saveysKl , ,Fk++F33G $+DM& ! ! , ,r[cz|jD] \}}|j||!dSrb)r}rnrzrs r\restorezSaveSignals.restoresH#}2244 0 0OFG K  vw / / / / 0 0r[N)rVrWrXrYrgrrrZr[r\rvrvcsK    , , ,00000r[rvcddl}|jSr3)rG WITH_PYMALLOC)rGs r\ with_pymallocrs  ""r[ceZdZdZdZdZdS) _ALWAYS_EQz+ Object that is equal to anything. cdSrcrZrhothers r\__eq__z_ALWAYS_EQ.__eq__tr[cdSNFrZrs r\__ne__z_ALWAYS_EQ.__ne__ur[N)rVrWrXrYrrrZr[r\rrs<r[rc$eZdZdZdZdZdZdS) _NEVER_EQz/ Object that is not equal to anything. cdSrrZrs r\rz_NEVER_EQ.__eq__rr[cdSrcrZrs r\rz_NEVER_EQ.__ne__rr[cdS)NrrZrks r\__hash__z_NEVER_EQ.__hash__sqr[N)rVrWrXrYrrrrZr[r\rrsKr[rceZdZdZdZdZdS)_LARGESTz? Object that is greater than anything (except itself). c,t|tSrb)rLrrs r\rz_LARGEST.__eq__s%***r[cdSrrZrs r\__lt__z_LARGEST.__lt__rr[N)rVrWrXrYrrrZr[r\rrs<+++r[rceZdZdZdZdZdS) _SMALLESTz< Object that is less than anything (except itself). c,t|tSrb)rLrrs r\rz_SMALLEST.__eq__s%+++r[cdSrrZrs r\__gt__z_SMALLEST.__gt__rr[N)rVrWrXrYrrrZr[r\rrs<,,,r[rc"ddl}|jjS)zDReturn the global event loop policy if one is set, else return None.rN)asyncio.eventsevents_event_loop_policy)asyncios r\maybe_get_event_loop_policyrs > ,,r[) @c||}}ddl}|5}|dz}t|d|_||}|dz |z |z}||z} || z } || z } ||dz z|dz |z |zz| d| z zz} t | t | fcdddS#1swxYwYdS)Nrrr)decimal localcontext bit_lengthmaxprecDecimalrsqrt) nbinsnballsrrrctxbitsrfp1empty meanemptyoccupied collisionsvars r\collision_statsrs6 &qA$NNN      43||~~!tR== __Q  Fb=Q&K y=\ "Q$i"Q$Q&a)m)DDZ  % "3"33 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4sB(CCCc*eZdZdZdZdZdZdZdS)catch_unraisable_exceptiona Context manager catching unraisable exception using sys.unraisablehook. Storing the exception value (cm.unraisable.exc_value) creates a reference cycle. The reference cycle is broken explicitly when the context manager exits. Storing the object (cm.unraisable.object) can resurrect it if it is set to an object which is being finalized. Exiting the context manager clears the stored object. Usage: with support.catch_unraisable_exception() as cm: # code creating an "unraisable exception" ... # check the unraisable exception: use cm.unraisable ... # cm.unraisable attribute no longer exists at this point # (to break a reference cycle) c"d|_d|_dSrb) unraisable _old_hookrks r\rgz#catch_unraisable_exception.__init__sr[c||_dSrb)r)rhrs r\_hookz catch_unraisable_exception._hook s%r[cJtj|_|jt_|Srb)runraisablehookrrrks r\rz$catch_unraisable_exception.__enter__s+!Z r[c,|jt_|`dSrb)rrrr)rhexc_infos r\rz#catch_unraisable_exception.__exit__s!^ OOOr[N)rVrWrXrYrgrrrrZr[r\rrsZ0%%%  r[rrc tjdkrddl}|t}t j}d}d} tj|tj\}}|dkrnt j|z } | |krX tj||j tj|dn#t$rYnwxYwtd|d| d d t|d z|}t j |ntj|d\}}tj|} | |krtd|d | d |d||krtd|d|dS)a Wait until process pid completes and check that the process exit code is exitcode. Raise an AssertionError if the process exit code is not equal to exitcode. If the process runs longer than timeout seconds (LONG_TIMEOUT by default), kill the process (if signal.SIGKILL is available) and raise an AssertionError. The timeout feature is not available on Windows. ntrNgMbP?rTzprocess z is still running after z.1fz secondsrz exited with code z, but exit code z is expectedzpid z != pid )rrrzrPr monotonicrrkillrxrAssertionErrorminrwaitstatus_to_exitcode) r exitcoderrzt0r max_sleeppid2rdt exitcode2s r\ wait_processrs w$ ?"G ^    :c2:66LD&qyy!!B&BG||GC000JsA&&&&D%&?&?&?.0%>&?&?&?@@@ 9--E Ju   ' &z#q)) f)&11IHEEEyEE.6EEEFF F s{{7D77#77888{s>K |w P     & & & & & P P P#$Ns$N$NOO O P sA A,A''A,c|j}|j}|dkr|d|}n|}dtj|d}|jt ||g|Ri|dS)z Check that given type cannot be instantiated using *args and **kwds. See bpo-43916: Add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag. builtinsrzcannot create 'z ' instancesN)rWrVrrrv TypeError)r|tprrmodrqualnamercs r\r1r1gs| -C ;D j??D??9 .s4DDE/2e99///DDDDDDr[rnr) rrrfiltersrrLrPatternrzrr_filters_mutated) r new_filtersractionrrrTrrrcs r\clear_ignored_deprecationsrs  YWXXXKDDVDDDDDH5=5EHH166 X  (.@"@"@'2:.. $om||H%% FGXvvFGGGG;&&)!#####'&r[c ddl}n%#t$rtjddcYSwxYw ddl}n#t$rd}YnwxYwtj|dS)NrTzvenv: ensurepip requires zlibzvenv: pip requires ctypes)r4r5rtrrr6)r4rs r\requires_venv_with_piprsF FFFt%DEEEEEF    v'B C CCs))2 AAc#Ktj} tj|dVtj|dS#tj|wxYw)z>Temporarily change the integer string conversion length limit.N)rget_int_max_str_digitsset_int_max_str_digits) max_digitscurrents r\adjust_int_max_str_digitsr sc(**G, ":...  "7+++++"7++++rrb)r1)r9)r<)r?)rJ)r)T)NNr3)NrZrZ)F)rZ)r)rYrVr5 contextlibr rrrrrr!rr rtr testresultrrGrrrMrrrNrOrPrrr__file__TEST_SUPPORT_DIRrbr{ REPO_ROOTrr r r`r rrr,r-r#rr rrr[r rrrrrrrrrrrrr2r3r.r SOCK_MAX_SIZEr6r __getformat__rr$r%rrrrHrLrequires_legacy_unicode_capir4rr5r9r6r7r&r'r(r)r*r+has_strftime_extensionsstrftimer TEST_HTTP_URLrGrrrr_r?rErr;contextmanagerrrrrrrrrrrrrrrrr=rFrrr_4Gr%rrCr r r!rr/r1r"r4r7r8rGrIrNrardrrrtrfrirwrsrrr"MISSING_C_DOCSTRINGSHAVE_DOCSTRINGSrequires_docstringsrrrrrrr<rAr>rrrrBrr0rrr.r/r#rDr?rCrHrWrHrir:rtrvrrrIrrJtotal_orderingrrKrrLr hash_infowidth NHASHBITSrrrrr1r@rrrrr rZr[r\rs== ~ +F G GG  ''''''!///////!!! !# # # ^<7#+==\Y  7??27??8#<#<== 011 W__] + + GOOJ ' ' 55555I555     J   )))))E)))X&$     ***   "K$K$K$Z>>> 7 7 7 76:::888: / / / / %Uu6)eEe)))))   $$ % (H' !!,,V44$&&--------,,,,----111:::: 3x23H7 9 9 L # #F + + WS. / / <+++%/>!!YJJJ , ,& 72v&&L}+<LWOOO+*:7{VVV '&6w;&+ < < < < < <7 "/$-"6"6%"?      ,    ]F33 $& 1$t 1 1 1 1 1414141n  / / /%%%%%% $ $ $" ///   73 WnG F S=333444  ( ( ($ 444:F Sj#g#g*%%%%%%%%B....`   $ OOO+++    !!!888    ***   ;;;6+++FFF****B@0777*)++I /I4I45GHHH%,D8,++*h)/*DFF6 J ###< ###< <555 ;;;fD ]]]*OBOBOBOBOBOBOBOBd44479     @B 89898989v....*]]]]]]]]@333D ,,,(&+-@ + + + ;;;"$0$0$0$0$0$0$0$0N###  JLL          9;;  (**  9;;--- M  H 444D))))))))X,02929292929hPPP2 B B B  . . . .S36$$4$$$$* D D D  ,,,,,s$ AAAJ&&J.-J.