ó
çiõ\c           @` s=  d  Z  d d l m Z d d l m Z d d l m Z d d l m Z d d l m Z d d l m	 Z	 d d	 l m
 Z
 d d
 l m Z d d l m Z d d l m Z d d l m Z d d l m Z d d l m Z d d d d g Z d „  Z d „  Z d „  Z e e _ d „  Z d „  Z d „  Z d „  Z d „  Z d S(   s?    generic mechanism for marking and selecting python functions. i    (   t   absolute_import(   t   division(   t   print_functioni   (   t   matchkeyword(   t	   matchmark(   t   EMPTY_PARAMETERSET_OPTION(   t   get_empty_parameterset_mark(   t   Mark(   t   MARK_GEN(   t   MarkDecorator(   t   MarkGenerator(   t   ParameterSet(   t
   UsageErrorR   R	   R
   R   c          O` s   t  j |  | Ž  S(   s|  Specify a parameter in `pytest.mark.parametrize`_ calls or
    :ref:`parametrized fixtures <fixture-parametrize-marks>`.

    .. code-block:: python

        @pytest.mark.parametrize("test_input,expected", [
            ("3+5", 8),
            pytest.param("6*9", 42, marks=pytest.mark.xfail),
        ])
        def test_eval(test_input, expected):
            assert eval(test_input) == expected

    :param values: variable args of the values of the parameter set, in order.
    :keyword marks: a single mark or a list of marks to be applied to this parameter set.
    :keyword str id: the id to attribute to this parameter set.
    (   R   t   param(   t   valuest   kw(    (    s4   lib/python2.7/site-packages/_pytest/mark/__init__.pyR      s    c         C` s¥   |  j  d ƒ } | j d d d d d d d d	 d
 d d ƒ| j d d d d d d d d	 d d d ƒ| j d d d d d ƒ|  j d d d ƒ |  j t d ƒ d  S(   Nt   generals   -kt   actiont   storet   destt   keywordt   defaultt    t   metavart
   EXPRESSIONt   helps—  only run tests which match the given substring expression. An expression is a python evaluatable expression where all names are substring-matched against test names and their parent classes. Example: -k 'test_method or test_other' matches all test functions and classes whose name contains 'test_method' or 'test_other', while -k 'not test_method' matches those that don't contain 'test_method' in their names. -k 'not test_method and not test_other' will eliminate the matches. Additionally keywords are matched to classes and functions containing extra names in their 'extra_keyword_matches' set, as well as functions which have names assigned directly to them.s   -mt   markexprt   MARKEXPRsR   only run tests matching given mark expression.  example: -m 'mark1 and not mark2'.s	   --markerst
   store_trues4   show markers (builtin, plugin and per-project ones).t   markerss   markers for test functionst   linelists&   default marker for empty parametersets(   t   getgroupt
   _addoptiont	   addoptiont   addiniR   (   t   parsert   group(    (    s4   lib/python2.7/site-packages/_pytest/mark/__init__.pyt   pytest_addoption)   s*    c         C` sÌ   d d  l  } |  j j rÈ |  j ƒ  | j j |  ƒ } xƒ |  j d ƒ D]r } | j d d ƒ } | d } t | ƒ d k r‚ | d n d } | j	 d | d t
 ƒ| j | ƒ | j ƒ  qD W|  j ƒ  d Sd  S(	   Ni    R   t   :i   i   R   s   @pytest.mark.%s:t   bold(   t   _pytest.configt   optionR   t   _do_configuret   configt   create_terminal_writert   getinit   splitt   lent   writet   Truet   linet   _ensure_unconfigure(   R+   t   _pytestt   twR2   t   partst   namet   rest(    (    s4   lib/python2.7/site-packages/_pytest/mark/__init__.pyt   pytest_cmdline_mainR   s    

"
c         C` së   | j  j j ƒ  } | s d  S| j d ƒ r< d | d } n  t } | d d k re t } | d  } n  g  } g  } xP |  D]H } | r¤ t | | ƒ r¤ | j | ƒ qx | r³ d  } n  | j | ƒ qx W| rç | j	 j
 d | ƒ | |  (n  d  S(   Nt   -s   not i   iÿÿÿÿR&   t   items(   R)   R   t   lstript
   startswitht   FalseR1   R   t   appendt   Nonet   hookt   pytest_deselected(   R;   R+   t   keywordexprt   selectuntilt	   remainingt
   deselectedt   colitem(    (    s4   lib/python2.7/site-packages/_pytest/mark/__init__.pyt   deselect_by_keywordf   s(    	c         C` s†   | j  j } | s d  Sg  } g  } x: |  D]2 } t | | ƒ rN | j | ƒ q) | j | ƒ q) W| r‚ | j j d | ƒ | |  (n  d  S(   NR;   (   R)   R   R   R?   RA   RB   (   R;   R+   t	   matchexprRE   RF   t   item(    (    s4   lib/python2.7/site-packages/_pytest/mark/__init__.pyt   deselect_by_mark   s    c         C` s   t  |  | ƒ t |  | ƒ d  S(   N(   RH   RK   (   R;   R+   (    (    s4   lib/python2.7/site-packages/_pytest/mark/__init__.pyt   pytest_collection_modifyitems“   s    c         C` sO   t  j |  _ |  t  _ |  j t ƒ } | d k rK t d j t | ƒ ƒ ‚ n  d  S(   Nt   skipt   xfailt   fail_at_collectR   sA   {!s} must be one of skip, xfail or fail_at_collect but it is {!r}(   RM   RN   RO   NR   (   R   t   _configt   _old_mark_configR-   R   R@   R   t   format(   R+   t   empty_parameterset(    (    s4   lib/python2.7/site-packages/_pytest/mark/__init__.pyt   pytest_configure˜   s    	c         C` s   t  |  d d  ƒ t _ d  S(   NRQ   (   t   getattrR@   R   RP   (   R+   (    (    s4   lib/python2.7/site-packages/_pytest/mark/__init__.pyt   pytest_unconfigure¥   s    N(   t   __doc__t
   __future__R    R   R   t   legacyR   R   t
   structuresR   R   R   R   R	   R
   R   R(   R   t   __all__R   R%   R9   R1   t   tryfirstRH   RK   RL   RT   RV   (    (    (    s4   lib/python2.7/site-packages/_pytest/mark/__init__.pyt   <module>   s.   		)						