Plan 9 from Bell Labs’s /usr/web/sources/contrib/jas/root/sys/lib/python2.7/site-packages/nose/selector.pyc

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


�9�c@s�dZddlZddlZddlZddlmZddlmZmZm	Z	m
Z
mZeje
�ZdddgZejjZejjZejjZejjZejjZejjZdefd��YZeZdefd	��YZ dS(
s�
Test Selection
--------------

Test selection is handled by a Selector. The test loader calls the
appropriate selector method for each object it encounters that it
thinks may be a test.
i�N(tConfig(tsplit_test_nametsrctgetfilenamet
getpackaget	ispackagetSelectortdefaultSelectortTestAddresscBs_eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�ZRS(
s�Core test selector. Examines test candidates and determines whether,
    given the specified configuration, the test candidate should be selected
    as a test.
    cCs)|dkrt�}n|j|�dS(N(tNoneRt	configure(tselftconfig((s1/sys/lib/python2.7/site-packages/nose/selector.pyt__init__"scCsI||_|j|_|j|_|j|_|j|_|j|_dS(N(RtexcludetignoreFilestincludetpluginst	testMatchtmatch(RR((s1/sys/lib/python2.7/site-packages/nose/selector.pyR
's	c
Cs�|jj|�sI|jotdg|jD]}|j|�^q+�o|jptdg|jD]}|j|�^qc�S(s�Does the name match my requirements?

        To match, a name must match config.testMatch OR config.include
        and it must not match config.exclude
        N(RtsearchRtfilterR	R(Rtnametinctexc((s1/sys/lib/python2.7/site-packages/nose/selector.pytmatches/s	(
cCs�t|dd�}|dk	r'|}n7|jjd�o[t|tj�p[|j|j�}|jj	|�}|dk	r�t
jd||�|}nt
jd||�|S(s�Is the class a wanted test class?

        A class must be a unittest.TestCase subclass, or match test name
        requirements. Classes that start with _ are always excluded.
        t__test__t_s$Plugin setting selection of %s to %sswantClass %s? %sN(tgetattrR	t__name__t
startswitht
issubclasstunittesttTestCaseRRt	wantClasstlogtdebug(Rtclstdeclaredtwantedt
plug_wants((s1/sys/lib/python2.7/site-packages/nose/selector.pyR">s		cCs�t|�}t|�rT|jpNtdg|jD]}|j|�^q2�}n-|j|�p~|jjo~||jjk}|j	j
|�}|dk	r�tjd||�|}ntjd||�|S(s�Is the directory a wanted test directory?

        All package directories match, so long as they do not match exclude. 
        All other directories must match test requirements.
        s$Plugin setting selection of %s to %sswantDirectory %s? %sN(
top_basenameRRRR	RRRtsrcDirsRt
wantDirectoryR#R$(RtdirnamettailRR'R(((s1/sys/lib/python2.7/site-packages/nose/selector.pyR+Ss
,	
	c
Cst|�}g|jD]}|j|�r|^q}|rQtjd|�tS|jjr�tj	|tj
�r�tjd|�tSt|�\}}|dk}|o�|j
|�}|jj|�}	|	dk	r�jd||	�|	}ntjd||�|S(sIs the file a wanted test file?

        The file must be a python source file and match testMatch or
        include, and not match exclude. Files that match ignore are *never*
        wanted, regardless of plugin, testMatch, include or exclude settings.
        s'%s matches ignoreFiles pattern; skippeds%s is executable; skippeds.pysplugin setting want %s to %sswantFile %s? %sN(R)RRR#R$tFalseRt
includeExetostaccesstX_OKtinfotop_splitextRRtwantFileR	(
Rtfiletbasetignore_thistignore_matchestdummytexttpysrcR'R(((s1/sys/lib/python2.7/site-packages/nose/selector.pyR5ks&		"	cCs�y(t|d�r|j}n	|j}Wntk
r<tSXt|dd�}|dk	rd|}n|jd�o�|j|�}|j	j
|�}|dk	r�|}ntjd||�|S(s)Is the function a test function?
        tcompat_func_nameRRswantFunction %s? %sN(
thasattrR=RtAttributeErrorR.RR	RRRtwantFunctionR#R$(RtfunctiontfuncnameR&R'R(((s1/sys/lib/python2.7/site-packages/nose/selector.pyR@�s

		cCs�y
|j}Wntk
r!tSX|jd�r5tSt|dd�}|dk	r\|}n|j|�}|jj|�}|dk	r�|}nt	j
d||�|S(s%Is the method a test method?
        RRswantMethod %s? %sN(RR?R.RRR	RRt
wantMethodR#R$(Rtmethodtmethod_nameR&R'R(((s1/sys/lib/python2.7/site-packages/nose/selector.pyRC�s

		cCs�t|dd�}|dk	r'|}n.|j|jjd�d�pR|jdk}|jj|�}|dk	r||}ntjd||�|S(s�Is the module a test module?

        The tail of the module name must match test requirements. One exception:
        we always want __main__.
        Rt.i�t__main__swantModule %s? %sN(	RR	RRtsplitRt
wantModuleR#R$(RtmoduleR&R'R(((s1/sys/lib/python2.7/site-packages/nose/selector.pyRI�s		(Rt
__module__t__doc__R
R
RR"R+R5R@RCRI(((s1/sys/lib/python2.7/site-packages/nose/selector.pyRs								cBs5eZdZdd�Zd�Zd�Zd�ZRS(s�A test address represents a user's request to run a particular
    test. The user may specify a filename or module (or neither),
    and/or a callable (a class, function, or method). The naming
    format for test addresses is:

    filename_or_module:callable

    Filenames that are not absolute will be made absolute relative to
    the working dir.

    The filename or module part will be considered a module name if it
    doesn't look like a file, that is, if it doesn't exist on the file
    system and it doesn't contain any directory separators and it
    doesn't end in .py.

    Callables may be a class name, function name, method name, or
    class.method specification.
    cCs>|dkrtj�}n||_||_t|�\|_|_|_t	j
d||j|j|j�|jdkr�|jdk	r�t|j|j�|_q�n|jrt|j�|_t
|j�s�t||j��|_n|jdkrt|j�|_qnt	j
d||j|j|j�dS(Ns4Test name %s resolved to file %s, module %s, call %ss;Final resolution of test name %s: file %s module %s call %s(R	R0tgetcwdRt
workingDirRtfilenameRJtcallR#R$RRtop_isabst
op_abspathtop_joinR(RRRN((s1/sys/lib/python2.7/site-packages/nose/selector.pyR
�s(					cCs|j|j|jfS(N(RORJRP(R((s1/sys/lib/python2.7/site-packages/nose/selector.pyttotuple�scCs|jS(N(R(R((s1/sys/lib/python2.7/site-packages/nose/selector.pyt__str__�scCs d|j|j|j|jfS(Ns%s: (%s, %s, %s)(RRORJRP(R((s1/sys/lib/python2.7/site-packages/nose/selector.pyt__repr__�sN(RRKRLR	R
RTRURV(((s1/sys/lib/python2.7/site-packages/nose/selector.pyR�s
		(!RLtloggingR0R tnose.configRt	nose.utilRRRRRt	getLoggerRR#t__all__tpathtjoinRStbasenameR)texistst	op_existstsplitextR4tisabsRQtabspathRRtobjectRRR(((s1/sys/lib/python2.7/site-packages/nose/selector.pyt<module>s (�

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.