��
���Lc:@s�dZedjoed��nddkZddkZddkZddkZddkZddkZddk Z ddk
Z
ddkZddddd d
ddd
ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5g1Zde
fd6��YZdefd7��YZdefd8��YZdefd9��YZed:�Zd;ZdZd<ad<adad=�Zd>�Zd?�Zd@�ZdA�ZdB�ZdC�Z ddD�Z!dEZ"ei#ei$dF�Z%e"dG�Z&dHZ'dI�Z(ye)e*Z+Wne,j
o
eZ+nXei-i.dJ�Z/ei0dJjo
dKZ1n�ei0dLjo
dMZ1n�dNZ1e+o�e2dOe)�o
dPZ3ne)dPdQ�Z3ei4�Z5e6edR�pei7�dSdTjo
dZ8qOe9dU�Z8ye8i:dV�Wne;j
oqOXdWe8GHndZ<ye=e1dX�Z<Wnie>j
o]ei?i@dYe1�ZAye=eAdX�Z<eAZ1[AWq�e>j
odZe1eAfGHq�XnXe<dj oe<iB�ee1�n[<eCd[�ZDd\d]�ZEd^�ZFd_�ZGd`�ZHda�ZIdb�ZJdceKfdd��YZLede�ZMeiNdf��ZOeiNdg��ZPd%eKfdh��YZQd&eKfdi��YZRd)eKfdj��YZSdk�ZTeiNdl��ZUdm�ZVdn�ZWd~ZXdoeXZYdTeYZZdpeYZ[ei\Z]dq�Z^dreXds�Z_dreXdt�Z`du�Zad/ddv��YZbdw�Zcdx�Zdddy�Zedz�Zfd{�Zgd|�Zhd}�ZidS(�s7Supporting definitions for the Python regression tests.stest.test_supports3test_support must be imported from the test packagei����NtErrort
TestFailedtTestSkippedtResourceDeniedt
import_moduletverboset
use_resourcest
max_memusetrecord_original_stdouttget_original_stdouttunloadtunlinktrmtreetforgettis_resource_enabledtrequirestfind_unused_portt bind_porttfcmpthave_unicodet is_jythontTESTFNtHOSTtFUZZtfindfiletverifytvereqtsortdicttcheck_syntax_errortopen_urlresourcetcheck_warningst_check_py3k_warningstCleanImporttEnvironmentVarGuardtcaptured_outputtcaptured_stdouttTransientResourcettransient_internettrun_with_localetset_memlimitt
bigmemtesttbigaddrspacetesttBasicTestRunnertrun_unittesttrun_doctesttthreading_setuptthreading_cleanupt
reap_childrentstrip_python_stderrcBseZdZRS(s*Base class for regression test exceptions.(t__name__t
__module__t__doc__(((s'/usr/lib/python2.6/test/test_support.pyRscBseZdZRS(sTest failed.(R1R2R3(((s'/usr/lib/python2.6/test/test_support.pyR scBseZdZRS(s!Test skipped.
This can be raised to indicate that a test was deliberatly
skipped, but not because a feature wasn't available. For
example, if some resource can't be used, such as the network
appears to be unavailable, this should be raised instead of
TestFailed.
(R1R2R3(((s'/usr/lib/python2.6/test/test_support.pyR#scBseZdZRS(s�Test 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.
(R1R2R3(((s'/usr/lib/python2.6/test/test_support.pyR-scCs�ti�ii�zb|otiddt�nyt|dd�}Wn#tj
otd|��nX|SWdQXdS(sOImport the module to be tested, raising TestSkipped if it is not
available.tignores.+ (module|package)tlevelisNo module named N( twarningstcatch_warningst__exit__t __enter__tfilterwarningstDeprecationWarningt
__import__tImportErrorR(tnamet
deprecatedtmodule((s'/usr/lib/python2.6/test/test_support.pyR5siicCs
|adS(N(t_original_stdout(tstdout((s'/usr/lib/python2.6/test/test_support.pyRMscCstptiS(N(RAtsysRB(((s'/usr/lib/python2.6/test/test_support.pyR QscCs(yti|=Wntj
onXdS(N(RCtmodulestKeyError(R>((s'/usr/lib/python2.6/test/test_support.pyR
TscCs+yti|�Wntj
onXdS(N(tosRtOSError(tfilename((s'/usr/lib/python2.6/test/test_support.pyRZscCsPyti|�Wn8tj
o,}|ititifjo�qLnXdS(N(tshutilRRGterrnotENOENTtESRCH(tpathte((s'/usr/lib/python2.6/test/test_support.pyR`s
cCsjt|�xYtiD]N}ttii||tid��ttii||tid��qWdS(sm"Forget" a module was ever imported by removing it from sys.modules and
deleting any .pyc and .pyo files.tpyctpyoN(R
RCRMRRFtjointextsep(tmodnametdirname((s'/usr/lib/python2.6/test/test_support.pyR
hs
$cCstdj o
|tjS(sPTest whether a resource is enabled. Known resources are set by
regrtest.py.N(RtNone(tresource((s'/usr/lib/python2.6/test/test_support.pyRsscCscti�iiid�djodSt|�p+|djod|}nt|��ndS(s�Raise ResourceDenied if the specified resource is not available.
If the caller's module is __main__ then automatically return True. The
possibility of False being returned occurs when regrtest.py is executing.R1t__main__Ns$Use of the `%s' resource not enabled(RCt _getframetf_backt f_globalstgetRRUR(RVtmsg((s'/usr/lib/python2.6/test/test_support.pyRxs"
t localhostcCs/ti||�}t|�}|i�~|S(s�
Returns an unused port that should be suitable for binding. This is
achieved by creating a temporary socket with the same family and type as
the 'sock' parameter (default is AF_INET, SOCK_STREAM), and binding it to
the specified host address (defaults to 0.0.0.0) with the port set to 0,
eliciting an unused ephemeral port from the OS. The temporary socket is
then closed and deleted, and the ephemeral port is returned.
Either this method or bind_port() should be used for any tests where a
server socket needs to be bound to a particular port for the duration of
the test. Which one to use depends on whether the calling code is creating
a python socket, or if an unused port needs to be provided in a constructor
or passed to an external program (i.e. the -accept argument to openssl's
s_server mode). Always prefer bind_port() over find_unused_port() where
possible. Hard coded ports should *NEVER* be used. As soon as a server
socket is bound to a hard coded port, the ability to run multiple instances
of the test simultaneously on the same host is compromised, which makes the
test a ticking time bomb in a buildbot environment. On Unix buildbots, this
may simply manifest as a failed test, which can be recovered from without
intervention in most cases, but on Windows, the entire python process can
completely and utterly wedge, requiring someone to log in to the buildbot
and manually kill the affected process.
(This is easy to reproduce on Windows, unfortunately, and can be traced to
the SO_REUSEADDR socket option having different semantics on Windows versus
Unix/Linux. On Unix, you can't have two AF_INET SOCK_STREAM sockets bind,
listen and then accept connections on identical host/ports. An EADDRINUSE
socket.error will be raised at some point (depending on the platform and
the order bind and listen were called on each socket).
However, on Windows, if SO_REUSEADDR is set on the sockets, no EADDRINUSE
will ever be raised when attempting to bind two identical host/ports. When
accept() is called on each socket, the second caller's process will steal
the port from the first caller, leaving them both in an awkwardly wedged
state where they'll no longer respond to any signals or graceful kills, and
must be forcibly killed via OpenProcess()/TerminateProcess().
The solution on Windows is to use the SO_EXCLUSIVEADDRUSE socket option
instead of SO_REUSEADDR, which effectively affords the same semantics as
SO_REUSEADDR on Unix. Given the propensity of Unix developers in the Open
Source world compared to Windows ones, this is a common mistake. A quick
look over OpenSSL's 0.9.8g source shows that they use SO_REUSEADDR when
openssl.exe is called with the 's_server' option, for example. See
http://bugs.python.org/issue2550 for more info. The following site also
has a very thorough description about the implications of both REUSEADDR
and EXCLUSIVEADDRUSE on Windows:
http://msdn2.microsoft.com/en-us/library/ms740621(VS.85).aspx)
XXX: although this approach is a vast improvement on previous attempts to
elicit unused ports, it rests heavily on the assumption that the ephemeral
port returned to us by the OS won't immediately be dished back out to some
other process when we close and delete our temporary socket but before our
calling code has a chance to bind the returned port. We can deal with this
issue if/when we come across it.(tsocketRtclose(tfamilytsocktypettempsocktport((s'/usr/lib/python2.6/test/test_support.pyR�s
6
cCs|itijo�|itijo�ttd�o3|ititi�djot d��qinttd�o3|ititi
�djot d��q�nttd�o|ititid�q�n|i
|df�|i�d}|S(s%Bind the socket to a free port and return the port number. Relies on
ephemeral ports in order to ensure we are using an unbound port. This is
important as many tests may be running simultaneously, especially in a
buildbot environment. This method raises an exception if the sock.family
is AF_INET and sock.type is SOCK_STREAM, *and* the socket has SO_REUSEADDR
or SO_REUSEPORT set on it. Tests should *never* set these socket options
for TCP/IP sockets. The only case for setting these options is testing
multicasting via multiple UDP sockets.
Additionally, if the SO_EXCLUSIVEADDRUSE socket option is available (i.e.
on Windows), it will be set on the socket. This will prevent anyone else
from bind()'ing to our host/port for the duration of the test.
tSO_REUSEADDRisHtests should never set the SO_REUSEADDR socket option on TCP/IP sockets!tSO_REUSEPORTsHtests should never set the SO_REUSEPORT socket option on TCP/IP sockets!tSO_EXCLUSIVEADDRUSEi(R`R^tAF_INETttypetSOCK_STREAMthasattrt
getsockoptt
SOL_SOCKETRdRRet
setsockoptRftbindtgetsockname(tsockthostRc((s'/usr/lib/python2.6/test/test_support.pyR�s&!g�����ư>cCs-t|t�pt|t�oHy:t|�t|�t}t||�|jodSWqqXn�t|�t|�jo�t|ttf�o�xRttt |�t |���D]/}t
||||�}|djo|Sq�Wt |�t |�jt |�t |�jS||j||jS(Ni(t
isinstancetfloattabsRRhttupletlisttrangetmintlenR(txtytfuzztitoutcome((s'/usr/lib/python2.6/test/test_support.pyR�s /"
-tjavas$testtriscosttestfiles@testts@test-��slatin-1tgetwindowsversioniis'u"@test-\u5171\u6709\u3055\u308c\u308b"tLatin1sgWARNING: The filename %r CAN be encoded by the filesystem. Unicode filename tests may not be effectivesw+s/tmps6WARNING: tests will fail, unable to write to: %s or %scCs|tii|�o|Sti}tii|�g|}x;|D]3}tii||�}tii|�o|SqAW|S(s�Try to find a file on sys.path and the working 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).(RFRMtisabsRCRTRQtexists(tfilethereRMtdntfn((s'/usr/lib/python2.6/test/test_support.pyR<s stest failedcCs|pt|��ndS(s�Verify that condition is true. If not, raise TestFailed.
The optional argument reason can be given to provide
a better error text.
N(R(t conditiontreason((s'/usr/lib/python2.6/test/test_support.pyRIscCs+||jptd||f��ndS(s$Raise TestFailed if a == b is false.
This is better than verify(a == b) because, in case of failure, the
error message incorporates repr(a) and repr(b) so you can see the
inputs.
Note that "not (a == b)" isn't necessarily the same as "a != b"; the
former is tested.
s%r == %rN(R(tatb((s'/usr/lib/python2.6/test/test_support.pyRSs
cCsR|i�}|i�g}|D]}|d|q!~}di|�}d|S(s%Like repr(dict), but in sorted order.s%r: %rs, s{%s}(titemstsortRQ(tdictR�t_[1]tpairt reprpairst
withcommas((s'/usr/lib/python2.6/test/test_support.pyRas
%cCs9ttd�}z|i�SWd|i�tt�XdS(s`
Create an invalid file descriptor by opening and closing a file and return
its fd.
twbN(topenRtfilenoR_R(R�((s'/usr/lib/python2.6/test/test_support.pytmake_bad_fdis
cCs?yt|dd�Wntj
onX|id|�dS(Ns
<test string>texecsMissing SyntaxError: "%s"(tcompiletSyntaxErrortfail(ttestcaset statement((s'/usr/lib/python2.6/test/test_support.pyRus
c
Cs:ddk}ddk}td�|i|�did�d}xStiitiigD]9}tii||�}tii |�ot
|�Sq[Wt�d|IJ|i|dd�}zdt
|d�i
i�}zA|~}|i�} x%| o|i| �|i�} q�WWdQXWd|i�Xt
|�S( Ni����turlfetchit/s fetching %s ...ttimeoutiR�(turlparseturllib2RtsplitRFRMtcurdirtpardirRQR�R�R turlopenR8R9treadtwriteR_(
turlR�R�RHRMR�tfR�toutts((s'/usr/lib/python2.6/test/test_support.pyR}s&
&
tWarningsRecordercBs8eZdZd�Zd�Zed��Zd�ZRS(syConvenience wrapper for the warnings list returned on
entry to the warnings.catch_warnings() context manager.
cCs||_d|_dS(Ni(t _warningst_last(tselft
warnings_list((s'/usr/lib/python2.6/test/test_support.pyt__init__�s cCs`t|i�|ijot|id|�S|tiijodStd||f��dS(Ni����s%r has no attribute %r( RyR�R�tgetattrR6tWarningMessaget_WARNING_DETAILSRUtAttributeError(R�tattr((s'/usr/lib/python2.6/test/test_support.pyt__getattr__�s
cCs|i|iS(N(R�R�(R�((s'/usr/lib/python2.6/test/test_support.pyR6�scCst|i�|_dS(N(RyR�R�(R�((s'/usr/lib/python2.6/test/test_support.pytreset�s(R1R2R3R�R�tpropertyR6R�(((s'/usr/lib/python2.6/test/test_support.pyR��s
ccs�tid�}|iid�}|o|i�ntidt�ii �}z,|~}ti
did�t|�VWdQXg}|D]}||i
q�~}g} x�|D]�\}
}t}x^|D]U}
t|
�}ti|
|ti�o*t|
i|�ot}|i|
�q�q�W|o"|o| i|
|if�q�q�W|otd|d��n| otd | d��ndS(
s�Catch the warnings, then check if all the expected
warnings have been raised and re-raise unexpected warnings.
If 'quiet' is True, only re-raise the unexpected warnings.
it__warningregistry__trecordR6talwaysNsunhandled warning %ris)filter (%r, %s) did not catch any warning(RCRXRZR[tclearR6R7tTrueR8R9RDtsimplefilterR�tmessagetFalsetstrtretmatchtIt
issubclasst __class__tremovetappendR1tAssertionError(tfilterstquiettframetregistryR�twt_[2]twarningtreraisetmissingR\tcattseentexcR�((s'/usr/lib/python2.6/test/test_support.pyt_filterwarnings�s4)$cOsM|id�}|p*dtff}|djo
t}q@nt||�S(s�Context manager to silence warnings.
Accept 2-tuples as positional arguments:
("message regexp", WarningCategory)
Optional argument:
- if 'quiet' is True, it does not fail if a filter catches nothing
(default True without argument,
default False if some filters are defined)
Without argument, it defaults to:
check_warnings(("", Warning), quiet=True)
R�R�N(R[tWarningRUR�R�(R�tkwargsR�((s'/usr/lib/python2.6/test/test_support.pyR�s
cOsDtio|pdtff}q.nd}t||id��S(skContext manager to silence py3k warnings.
Accept 2-tuples as positional arguments:
("message regexp", WarningCategory)
Optional argument:
- if 'quiet' is True, it does not fail if a filter catches nothing
(default False)
Without argument, it defaults to:
_check_py3k_warnings(("", DeprecationWarning), quiet=False)
R�R�((RCtpy3kwarningR;R�R[(R�R�((s'/usr/lib/python2.6/test/test_support.pyR�s
cBs)eZdZd�Zd�Zd�ZRS(sContext manager to force import to return a new module reference.
This is useful for testing module-level behaviours, such as
the emission of a DeprecationWarning on import.
Use like this:
with CleanImport("foo"):
__import__("foo") # new reference
cGsstii�|_xZ|D]R}|tijo<ti|}|i|joti|i=nti|=qqWdS(N(RCRDtcopytoriginal_modulesR1(R�tmodule_namestmodule_nameR@((s'/usr/lib/python2.6/test/test_support.pyR�s
cCs|S(N((R�((s'/usr/lib/python2.6/test/test_support.pyR9scGstii|i�dS(N(RCRDtupdateR�(R�t
ignore_exc((s'/usr/lib/python2.6/test/test_support.pyR8s(R1R2R3R�R9R8(((s'/usr/lib/python2.6/test/test_support.pyR s
cBs;eZdZd�Zd�Zd�Zd�Zd�ZRS(s_Class to help protect the environment variable properly. Can be used as
a context manager.cCs
h|_dS(N(t_changed(R�((s'/usr/lib/python2.6/test/test_support.pyR�'scCs>||ijotii|�|i|<n|ti|<dS(N(R�RFtenvironR[(R�tenvvartvalue((s'/usr/lib/python2.6/test/test_support.pytset*scCsO||ijotii|�|i|<n|tijoti|=ndS(N(R�RFR�R[(R�R�((s'/usr/lib/python2.6/test/test_support.pytunset0scCs|S(N((R�((s'/usr/lib/python2.6/test/test_support.pyR97scGs`xY|ii�D]H\}}|djo"|tijoti|=qXq|ti|<qWdS(N(R�R�RURFR�(R�R�tktv((s'/usr/lib/python2.6/test/test_support.pyR8:s
(R1R2R3R�R�R�R9R8(((s'/usr/lib/python2.6/test/test_support.pyR!"s cBs2eZdZd�Zd�Zdddd�ZRS(s�Raise ResourceDenied if an exception is raised while the context manager
is in effect that matches the specified exception and attributes.cKs||_||_dS(N(R�tattrs(R�R�R�((s'/usr/lib/python2.6/test/test_support.pyR�Hs cCs|S(N((R�((s'/usr/lib/python2.6/test/test_support.pyR9LscCs�|dj ost|i|�o`x]|ii�D]<\}}t||�pPnt||�|joPq0q0Wtd��ndS(s�If type_ is a subclass of self.exc and value has attributes matching
self.attrs, raise ResourceDenied. Otherwise let the exception
propagate (if any).s%an optional resource is not availableN(RUR�R�R�t iteritemsRjR�R(R�ttype_R�t tracebackR�t
attr_value((s'/usr/lib/python2.6/test/test_support.pyR8Os N(R1R2R3R�R9RUR8(((s'/usr/lib/python2.6/test/test_support.pyR$Cs cCsUttdti�}ttidti�}ttdti�}ti|||�S(s�Return a context manager that raises ResourceDenied when various issues
with the Internet connection manifest themselves as exceptions.RJ( R$tIOErrorRJt ETIMEDOUTR^terrort
ECONNRESETt
contextlibtnested(ttime_outtsocket_peer_resettioerror_peer_reset((s'/usr/lib/python2.6/test/test_support.pyR%]sc cs[ddk}tt|�}tt||i��ztt|�VWdtt||�XdS(sRun the 'with' statement body using a StringIO object in place of a
specific attribute on the sys module.
Example use (with 'stream_name=stdout')::
with captured_stdout() as s:
print "hello"
assert s.getvalue() == "hello"
i����N(tStringIOR�RCtsetattr(tstream_nameR�torig_stdout((s'/usr/lib/python2.6/test/test_support.pyR"fs
cCs
td�S(NRB(R"(((s'/usr/lib/python2.6/test/test_support.pyR#xscs��fd�}|S(Ncs1���fd�}�i|_�i|_|S(Nc
s�y.ddk}t|��}|i|�}Wn&tj
o
�nBd}}n1Xx-�D]%}y|i||�PWq^q^Xq^Wz�||�SWd|o|o|i||�nXdS(Ni����(tlocaleR�t setlocaleR�RU(targstkwdsR�tcategorytorig_localetloc(tcatstrtfunctlocales(s'/usr/lib/python2.6/test/test_support.pytinner�s&(t func_nameR3(RR(RR(Rs'/usr/lib/python2.6/test/test_support.pyt decorator�s((RRR
((RRs'/usr/lib/python2.6/test/test_support.pyR&�siicCs�hdd6td6td6dtd6}tid|titiB�}|djotd|f��ntt |i
d��||i
d �i��}|a|t
jo
t
}n|tdjotd
|f��n|adS(NiR�tmtgtts(\d+(\.\d+)?) (K|M|G|T)b?$sInvalid memory limit %riis$Memory limit %r too low to be useful(t_1Mt_1GR�R�t
IGNORECASEtVERBOSERUt
ValueErrortintRstgrouptlowertreal_max_memusetMAX_Py_ssize_tt_2GR(tlimittsizesRtmemlimit((s'/usr/lib/python2.6/test/test_support.pyR'�s
2
ics���fd�}|S(sQDecorator for bigmem tests.
'minsize' is the minimum useful size for the test (in arbitrary,
test-interpreted units.) 'memuse' is the number of 'bytes per size' for
the test, or a good estimate of it. 'overhead' specifies fixed overhead,
independent of the testsize, and defaults to 5Mb.
The decorator tries to guess a good value for 'size' and passes it to
the decorated test function. If minsize * memuse is more than the
allowed memory use (as defined by max_memuse), the test is skipped.
Otherwise, minsize is adjusted upward to use up to max_memuse.
cs7����fd�}�|_�|_�|_|S(Ncs�tp)d}|i|��dtj�nctt���}|�jo*totiid�if�ndSt |dt��}�||�S(Niis)Skipping %s because of memory constraint
i2(
RtfailIfRRRRCtstderrR�R1tmax(R�tmaxsize(R�tmemusetminsizetoverhead(s'/usr/lib/python2.6/test/test_support.pytwrapper�s#
(R!R R"(R�R#(R!R"R (R�s'/usr/lib/python2.6/test/test_support.pyR
�s
((R!R R"R
((R!R"R s'/usr/lib/python2.6/test/test_support.pyR(�s
cs���fd�}|S(Ncs4���fd�}�|_�|_�|_|S(Ncsftp
d}nI�}to;t|�jo*totiid�if�ndS�||�S(Nis)Skipping %s because of memory constraint
(RRRCRR�R1(R�R(R�R tsize(s'/usr/lib/python2.6/test/test_support.pyR#�s
(R$R R"(R�R#(R$R"R (R�s'/usr/lib/python2.6/test/test_support.pyR
�s
((R$R R"R
((R"R R$s'/usr/lib/python2.6/test/test_support.pytprecisionbigmemtest�scs�fd�}|S(s0Decorator for tests that fill the address space.csDttjo)totiid�if�q@n�|�SdS(Ns)Skipping %s because of memory constraint
(RRRRCRR�R1(R�(R�(s'/usr/lib/python2.6/test/test_support.pyR#�s
((R�R#((R�s'/usr/lib/python2.6/test/test_support.pyR)�scBseZd�ZRS(cCsti�}||�|S(N(tunittestt
TestResult(R�ttesttresult((s'/usr/lib/python2.6/test/test_support.pytruns
(R1R2R*(((s'/usr/lib/python2.6/test/test_support.pyR*scCs�totitidd�}n
t�}|i|�}|i�p�t|i �djo |i
o|i dd}nRt|i
�djo |i o|i
dd}nd}tp|d7}nt|��ndS(s2Run tests from a unittest.TestSuite-derived class.t verbosityiiismultiple errors occurreds!; run in verbose mode for detailsN(RR&tTextTestRunnerRCRBR*R*t
wasSuccessfulRyterrorstfailuresR(tsuitetrunnerR)terr((s'/usr/lib/python2.6/test/test_support.pyt
_run_suites
!!cGs�titif}ti�}x�|D]�}t|t�oA|tijo!|ititi|��q�t d��q%t||�o|i|�q%|iti
|��q%Wt|�dS(s1Run tests from unittest.TestCase-derived classes.s)str arguments must be keys in sys.modulesN(R&t TestSuitetTestCaseRrR�RCRDtaddTestt
findTestCasesRt makeSuiteR3(tclassestvalid_typesR0tcls((s'/usr/lib/python2.6/test/test_support.pyR+&s!cCs�ddk}|djo
t}nd}ti}t�t_z@|i|d|�\}}|otd||f��nWd|t_Xtod|i|fGHn||fS(s
Run doctest on the given module. Return (#failures, #tests).
If optional argument verbosity is not specified (or is None), pass
test_support's belief about verbosity on to doctest. Else doctest's
usual behavior is used (it searches sys.argv for -v).
i����NRs%d of %d doctests faileds,doctest (%s) ... %d tests with zero failures( tdoctestRURRCRBR ttestmodRR1(R@R+R<tsave_stdoutR�R
((s'/usr/lib/python2.6/test/test_support.pyR,:s
cCs(ddk}t|i�t|i�fS(Ni����(t threadingRyt_activet_limbo(R?((s'/usr/lib/python2.6/test/test_support.pyR-ZscCs�ddk}ddk}d}d}x?t|i�|jo(||jo|d7}|id�q'Wd}x?t|i�|jo(||jo|d7}|id�qoWdS(Ni����i
iig�������?(R?ttimeRyR@tsleepRA(t
num_activet num_limboR?RBt
_MAX_COUNTtcount((s'/usr/lib/python2.6/test/test_support.pyR.^s#
#
cCsittd�oUd}xLto@y1ti|ti�\}}|djoPnWqPqXqWndS(s�Use 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.
twaitpidi����iN(RjRFR�RHtWNOHANG(tany_processtpidtstatus((s'/usr/lib/python2.6/test/test_support.pyR/ms
cCstidd|�i�}|S(s�Strip the stderr of a Python process from potential debug output
emitted by the interpreter.
This will typically be run on the result of the communicate() method
of a subprocess.Popen object.
s\[\d+ refs\]\r?\n?$R�(R�tsubtstrip(R((s'/usr/lib/python2.6/test/test_support.pyR0�si((jR3R1R=R�RJR^RCRFRIR6R&R�t__all__t ExceptionRRRRR�RRRURRRRARR R
RRR
RRRRgRiRRRRtunicodeR�Rt NameErrortplatformt
startswithRR>RRrtTESTFN_UNICODEtgetfilesystemencodingtTESTFN_ENCODINGRjR�tTESTFN_UNICODE_UNENCODEABLEtevaltencodetUnicodeEncodeErrortfpR�R�RMRQt
TMP_TESTFNR_t__file__RRRRR�RRtobjectR�R�tcontextmanagerRRR R!R$R%R"R#R&RRRt_4GRRR'R(R%R)R*R3R+R,R-R.R/R0(((s'/usr/lib/python2.6/test/test_support.pyt<module>s�
<
' ! %
'