HOME


sh-3ll 1.0
DIR:/usr/local/lib64/python3.6/site-packages/pandas/tests/io/__pycache__/
Upload File :
Current File : //usr/local/lib64/python3.6/site-packages/pandas/tests/io/__pycache__/conftest.cpython-36.pyc
3

���h�	�@spddlZddlZddljZddlmZejdd��Zejdd��Z	ejdd��Z
ejd	d
��Zejdd��ZdS)
�N)�read_csvcCs|dddd�S)zPath to the tips dataset�io�data�csvztips.csv�)�datapathrr�:/tmp/pip-build-5_djhm0z/pandas/pandas/tests/io/conftest.py�	tips_file
sr	cCs|dddd�S)zPath to a JSONL datasetr�parserrzitems.jsonlr)rrrr�
jsonl_filesrcCst|dddd�dd�S)z#DataFrame with the salaries datasetrr
rzsalaries.csv�	)�sep)r)rrrr�salaries_tablesrcCs|dddd�S)NrrZfeatherzfeather-0_3_1.featherr)rrrr�feather_filesrc	#s�tjd�}tjd�}tj���tjjdd�tjjdd�tjd�}d|fd	|fd
|dfd|d
fd|fd|fg���fdd�}z`|j�}|j�d}|j	ddd���j
|d�||��j
ddd�|d�|jj��VWd|j
�XWdQRXdS)a4
    Fixture for mocking S3 interaction.

    The primary bucket name is "pandas-test". The following datasets
    are loaded.

    - tips.csv
    - tips.csv.gz
    - tips.csv.bz2
    - items.jsonl

    A private bucket "cant_get_it" is also created. The boto3 s3 resource
    is yielded by the fixture.
    �s3fs�boto3ZAWS_ACCESS_KEY_IDZ
foobar_keyZAWS_SECRET_ACCESS_KEYZ
foobar_secret�motoz
tips#1.csvztips.csvztips.csv.gzz.gzztips.csv.bz2z.bz2zitems.jsonlzsimple_dataset.feathercs@x:�D]2\}}t|d��}�j|�j||d�WdQRXqWdS)N�rb)ZKeyZBody)�open�BucketZ
put_object)Zbucket_nameZs3_key�	file_name�f)�conn�
test_s3_filesrr�add_tips_filesEsz#s3_resource.<locals>.add_tips_fileszpandas-test�s3z	us-east-1)Zregion_name)rZcant_get_itZprivate)rZACLN)�pytestZimportorskip�tmZ!ensure_safe_environment_variables�os�environ�
setdefaultZmock_s3�start�resourceZ
create_bucketZS3FileSystemZclear_instance_cache�stop)	r	rrrrrrrZbucketr)rrr�s3_resource!s2








r$)
rrZpandas._testingZ_testingrZpandas.io.parsersrZfixturer	rrrr$rrrr�<module>s