U
    b7                     @   s   d dl Z d dlZd dlZd dlmZ d dlmZ d dlmZ d dl	m
Z
mZ d dlmZ d dlmZ d dlmZ ejd	d
dd Zejdddd Zejd	d
dd Zejdddd Zejdddd ZdS )    N)TemporaryDirectory)
SubdirData)dals)reset_contextcontext)YamlRawParameter)odict)yaml_round_trip_loadT)Zautousec                   C   s   t jdtd dS )z
    Suppress `Unclosed Socket Warning`

    It seems urllib3 keeps a socket open to avoid costly recreation costs.

    xref: https://github.com/kennethreitz/requests/issues/1882
    ignore)categoryN)warningsfilterwarningsResourceWarning r   r   5lib/python3.8/site-packages/conda/testing/fixtures.pysuppress_resource_warning   s    	r   Zfunction)Zscopec                 C   s(   t t| d} || j tj| jS )N)dir)r   strZaddfinalizerZcleanuppypathlocalname)tmpdirZrequestr   r   r   r      s    r   c                   C   s   t   d S )N)r   Zclear_cached_local_channel_datar   r   r   r   clear_subdir_cache$   s    r   c                  c   sB   t d} td ttdt| d}t| dV  td dS )z
    Fixture that will set "context.number_channel_notices" to 0 and then set
    it back to its original value.

    This is also a good example of how to override values in the context object.
    z+
        number_channel_notices: 0
        r   testdata)r   N)r   r   r   r   Zmake_raw_parametersr	   r   Z_set_raw_data)Zyaml_strZrdr   r   r   disable_channel_notices)   s    
r   c                   c   s   dV  t   dS )zD
    Resets the context object after each test function is run.
    N)r   r   r   r   r   reset_conda_contextA   s    r   )r   r   ZpytestZconda.gateways.disk.creater   Zconda.core.subdir_datar   Zconda.auxlib.ishr   Zconda.base.contextr   r   Zconda.common.configurationr   Zconda.common.compatr   Zconda.common.serializer	   Zfixturer   r   r   r   r   r   r   r   r   <module>   s&   








