tests/_helpers.py
def zip_files_to_tmpdir(file_list, tmpdir):
    """Function to zip csv files to the tmpdir."""
    for file in file_list:
        data_dir = os.path.abspath(os.path.dirname(__file__))
        data_file = os.path.join(data_dir, file)
        file_name = os.path.basename(file)
        zipped_data_file_name = file_name[:-3] + 'zip'
        zipped_data_file = str(tmpdir.join(zipped_data_file_name))

        with zipfile.ZipFile(zipped_data_file, 'w') as zip_file:
            zip_file.write(data_file, file_name)
Function to zip csv files to the tmpdir.
Function to zip csv files to the tmpdir.
Function to zip csv files to the tmpdir .
def zip_files_to_tmpdir(file_list, tmpdir):
    for file in file_list:
        data_dir = os.path.abspath(os.path.dirname(__file__))
        data_file = os.path.join(data_dir, file)
        file_name = os.path.basename(file)
        zipped_data_file_name = file_name[:-3] + 'zip'
        zipped_data_file = str(tmpdir.join(zipped_data_file_name))
        with zipfile.ZipFile(zipped_data_file, 'w') as zip_file:
            zip_file.write(data_file, file_name)
def zip_files_to_tmpdir ( file_list , tmpdir ) : for file in file_list : data_dir = os . path . abspath ( os . path . dirname ( __file__ ) ) data_file = os . path . join ( data_dir , file ) file_name = os . path . basename ( file ) zipped_data_file_name = file_name [ : - 3 ] + 'zip' zipped_data_file = str ( tmpdir . join ( zipped_data_file_name ) ) with zipfile . ZipFile ( zipped_data_file , 'w' ) as zip_file : zip_file . write ( data_file , file_name )
Function to zip csv files to the tmpdir.
Function to zip csv files to the tmpdir .
"""Function to zip csv files to the tmpdir."""
file_list
tmpdir