§
|<ˆjÄ ã óx — d Z ddlmZ ddlmZ dZdefd„Zd„ 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.compositeÚreturnc ó¼ — | 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)Ú
decoratorsÚargsÚnameÚnodesÚ as_stringÚCOMPOSITE_NAMES)ÚnodeÚdecorator_attributes úp/builddir/build/BUILD/cloudlinux-venv-1.0.12/venv/lib/python3.11/site-packages/astroid/brain/brain_hypothesis.pyÚis_decorated_with_st_compositer sk € à„ð ˜4œ9œ>ð ¨d¬i¬n¸QÔ.?Ô.DÈÒ.NÐ.NØ#'¤?Ô#8ð ð ÐØ"×,Ò,Ñ.Ô.µ/ÐAÐAØ�t�tð Bàˆ5ó c óT — | j j d= | j j d= | j j d= | S )zÊGiven 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 )Ú
node_classÚ transformÚ predicateN)
Ú__doc__Úastroid.managerr Úastroid.nodes.scoped_nodesr r Úboolr r Úregister_transform© r r ú