U
    ui                     @   s   d dl mZ d dlZd dlmZmZ edddddd	d
edddidd
edddddd
dZej	de
 dd Zdd Zdd ZdS )    )cleandocN)SetuptoolsDeprecationWarningSetuptoolsWarning)z	Hello {x}z
	{target} {v:.1f}      ZWorld)xvtargetz
    Hello 5
    !!

            ********************************************************************************
            World 3.0
            ********************************************************************************

    !!
    )argskwargsexpected)SummaryLorem ipsumdue_date)i'        a  
    Summary
    !!

            ********************************************************************************
            Lorem ipsum

            By 9999-Nov-22, you need to update your project and remove deprecated calls
            or your builds will no longer be supported.
            ********************************************************************************

    !!
    i  r   r   some_page.html)r   Zsee_docs  
    Summary
    !!

            ********************************************************************************
            Lorem ipsum

            This deprecation is overdue, please update your project and remove deprecated
            calls to avoid build errors in the future.

            See https://setuptools.pypa.io/en/latest/some_page.html for details.
            ********************************************************************************

    !!
    )defaultZfutue_due_dateZpast_due_date_with_docsexample_namec              	   C   sj   t | d }t | d }t | d }| dd tt}tj|| W 5 Q R X t|t|ksftdS )z]
    It should automatically handle indentation, interpolation and things like due date.
    r
   r   r   SETUPTOOLS_ENFORCE_DEPRECATIONfalseN)		_EXAMPLESsetenvpytestZwarnsr   emit_get_messager   AssertionError)monkeypatchr   r
   r   r   	warn_info r!   B/tmp/pip-unpacked-wheel-9osl9suo/setuptools/tests/test_warnings.pytest_formatting=   s    r#   c              	   C   sX   G dd dt }| dd tt }|  W 5 Q R X d}t|jt|ksTtd S )Nc                   @   s   e Zd ZdZdZdZdZdS )z1test_due_date_enforcement.<locals>._MyDeprecationr   r   r   r   N)__name__
__module____qualname__Z_SUMMARYZ_DETAILSZ	_DUE_DATEZ	_SEE_DOCSr!   r!   r!   r"   _MyDeprecationM   s   r'   r   truer   )	r   r   r   Zraisesr   strvaluer   r   )r   r'   exc_infor   r!   r!   r"   test_due_date_enforcementL   s    r,   c                 C   s   t dd | D S )Nc                 s   s   | ]}|j jd  V  qdS )r   N)messager
   ).0warnr!   r!   r"   	<genexpr>j   s     z_get_message.<locals>.<genexpr>)next)r    r!   r!   r"   r   i   s    r   )inspectr   r   Zsetuptools.warningsr   r   dictr   markZparametrizekeysr#   r,   r   r!   r!   r!   r"   <module>   s,   
6
