
    e                     F    d Z ddlmZ ddlmZ dZdefdZd Zdedd	fd
Z	y	)aV  
Astroid hook for the Hypothesis library.

Without this hook pylint reports no-value-for-parameter for use of strategies
defined using the `@hypothesis.strategies.composite` decorator.  For example:

    from hypothesis import strategies as st

    @st.composite
    def a_strategy(draw):
        return draw(st.integers())

    a_strategy()
    )AstroidManager)FunctionDef)	compositezst.compositezstrategies.compositezhypothesis.strategies.compositereturnc                     | j                   ro| j                  j                  rY| j                  j                  d   j                  dk(  r3| j                   j                  D ]  }|j	                         t
        v s y y)z:Return whether a decorated node has @st.composite applied.r   drawTF)
decoratorsargsnamenodes	as_stringCOMPOSITE_NAMES)nodedecorator_attributes     @/usr/lib/python3/dist-packages/astroid/brain/brain_hypothesis.pyis_decorated_with_st_compositer      s`    499>>diinnQ.?.D.D.N#'??#8#8 	",,./A	     c                     | j                   j                   d= | j                   j                  d= | j                   j                  d= | S )zGiven that the FunctionDef is decorated with @st.composite, remove the
    first argument (`draw`) - it's always supplied by Hypothesis so we don't
    need to emit the no-value-for-parameter lint.
    r   )r
   annotationstype_comment_args)r   s    r   -remove_draw_parameter_from_composite_strategyr   '   s=    
 			q		a 		##A&Kr   managerNc                 D    | j                  t        t        t               y )N)
node_class	transform	predicate)register_transformr   r   r   )r   s    r   registerr   2   s    ?0  r   )
__doc__astroid.managerr   astroid.nodes.scoped_nodesr   r   boolr   r   r    r   r   <module>r$      s=   
 + 2D n  r   