1ԅ@ x d Z ddlmZ ddlmZ dZdefdZd Z e eee d S )
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) compositezst.compositezstrategies.compositezhypothesis.strategies.compositereturnc | j rT| j j rH| j j d j dk r-| j j D ] }| t
v r dS !dS )z:Return whether a decorated node has @st.composite applied.r drawTF)
decoratorsargsnamenodes as_stringCOMPOSITE_NAMES)nodedecorator_attributes p/builddir/build/BUILD/cloudlinux-venv-1.0.10/venv/lib/python3.11/site-packages/astroid/brain/brain_hypothesis.pyis_decorated_with_st_compositer sk 49> dinQ.?.D.N.N#'?#8 ",,../AAtt B5 c T | 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
annotationstype_comment_args)r s r -remove_draw_parameter_from_composite_strategyr ' s/
q a #A&Kr )
node_class transform predicateN)
__doc__astroid.managerr astroid.nodes.scoped_nodesr r boolr r register_transform r r