test_io

Module Contents

class TextIO(s='')

Bases:io.BytesIO

Helper IO class.

Writes encode strings to bytes if needed, reads return bytes. This makes it easier to emulate files opened in binary mode without needing to explicitly convert strings to bytes in setting up the test data.

write(self, s)
writelines(self, lines)
IS_64BIT
strptime(s, fmt=None)

This function is available in the datetime module only from Python >= 2.5.

class RoundtripTest

Bases:object

roundtrip(self, save_func, *args, **kwargs)
save_func : callable
Function used to save arrays to file.
file_on_disk : bool
If true, store the file on disk, instead of in a string buffer.
save_kwds : dict
Parameters passed to save_func.
load_kwds : dict
Parameters passed to numpy.load.
args : tuple of arrays
Arrays stored to file.
check_roundtrips(self, a)
test_array(self)
test_array_object(self)
test_1D(self)
test_mmap(self)
test_record(self)
test_format_2_0(self)
class TestSaveLoad

Bases:test_io.RoundtripTest, numpy.ma.testutils.TestCase

roundtrip(self, *args, **kwargs)
class TestSavezLoad

Bases:test_io.RoundtripTest, numpy.ma.testutils.TestCase

roundtrip(self, *args, **kwargs)
test_big_arrays(self)
test_multiple_arrays(self)
test_named_arrays(self)
test_savez_filename_clashes(self)
test_not_closing_opened_fid(self)
test_closing_fid(self)
test_closing_zipfile_after_load(self)
class TestSaveTxt

Bases:numpy.ma.testutils.TestCase

test_array(self)
test_1D(self)
test_record(self)
test_delimiter(self)
test_format(self)

Test the functionality of the header and footer keyword argument.

test_file_roundtrip(self)
test_complex_arrays(self)
test_custom_writer(self)
class TestLoadTxt

Bases:numpy.ma.testutils.TestCase

test_record(self)
test_array(self)
test_1D(self)
test_missing(self)
test_converters_with_usecols(self)
test_comments(self)
test_skiprows(self)
test_usecols(self)
test_fancy_dtype(self)
test_shaped_dtype(self)
test_3d_shaped_dtype(self)
test_empty_file(self)
test_unused_converter(self)
test_dtype_with_object(self)

Test using an explicit dtype with an object

test_uint64_type(self)
test_int64_type(self)
test_universal_newline(self)
test_empty_field_after_tab(self)
test_structure_unpack(self)
test_ndmin_keyword(self)
test_generator_source(self)
test_bad_line(self)
test_none_as_string(self)
class Testfromregex

Bases:numpy.ma.testutils.TestCase

test_record(self)
test_record_2(self)
test_record_3(self)
class TestFromTxt

Bases:numpy.ma.testutils.TestCase

test_record(self)

Test w/ explicit dtype

test_array(self)

Test outputing a standard ndarray

test_1D(self)

Test squeezing to 1D

test_comments(self)

Test the stripping of comments

test_skiprows(self)

Test row skipping

test_header(self)

Test retrieving a header

test_auto_dtype(self)

Test the automatic definition of the output dtype

test_auto_dtype_uniform(self)

Tests whether the output dtype can be uniformized

test_fancy_dtype(self)

Check that a nested dtype isn’t MIA

test_names_overwrite(self)

Test overwriting the names of the dtype

test_commented_header(self)

Check that names can be retrieved even if the line is commented out.

test_autonames_and_usecols(self)

Tests names and usecols

test_converters_with_usecols(self)

Test the combination user-defined converters and usecol

test_converters_with_usecols_and_names(self)

Tests names and usecols

test_converters_cornercases(self)

Test the conversion to datetime.

test_converters_cornercases2(self)

Test the conversion to datetime64.

test_unused_converter(self)

Test whether unused converters are forgotten

test_invalid_converter(self)
test_tricky_converter_bug1666(self)

Test some corner case

test_dtype_with_converters(self)
test_dtype_with_converters_and_usecols(self)
test_dtype_with_object(self)

Test using an explicit dtype with an object

test_userconverters_with_explicit_dtype(self)

Test user_converters w/ explicit (standard) dtype

test_spacedelimiter(self)

Test space delimiter

test_integer_delimiter(self)

Test using an integer for delimiter

test_missing(self)
test_missing_with_tabs(self)

Test w/ a delimiter tab

test_usecols(self)

Test the selection of columns

test_usecols_as_css(self)

Test giving usecols with a comma-separated string

test_usecols_with_structured_dtype(self)

Test usecols with an explicit structured dtype

test_usecols_with_integer(self)

Test usecols with an integer

test_usecols_with_named_columns(self)

Test usecols with named columns

test_empty_file(self)

Test that an empty file raises the proper warning.

test_fancy_dtype_alt(self)

Check that a nested dtype isn’t MIA

test_shaped_dtype(self)
test_withmissing(self)
test_user_missing_values(self)
test_user_filling_values(self)

Test with missing and filling values

test_withmissing_float(self)
test_with_masked_column_uniform(self)

Test masked column

test_with_masked_column_various(self)

Test masked column

test_invalid_raise(self)

Test invalid raise

test_invalid_raise_with_usecols(self)

Test invalid_raise with usecols

test_inconsistent_dtype(self)

Test inconsistent dtype

test_default_field_format(self)

Test default format

test_single_dtype_wo_names(self)

Test single dtype w/o names

test_single_dtype_w_explicit_names(self)

Test single dtype w explicit names

test_single_dtype_w_implicit_names(self)

Test single dtype w implicit names

test_easy_structured_dtype(self)

Test easy structured dtype

test_autostrip(self)

Test autostrip

test_replace_space(self)

Test the ‘replace_space’ option

test_incomplete_names(self)

Test w/ incomplete names

test_names_auto_completion(self)

Make sure that names are properly completed

test_names_with_usecols_bug1636(self)

Make sure we pick up the right names w/ usecols

test_fixed_width_names(self)

Test fix-width w/ names

test_filling_values(self)

Test missing values

test_comments_is_none(self)
test_recfromtxt(self)
test_recfromcsv(self)
test_gft_using_filename(self)
test_gft_using_generator(self)
test_gzip_load()
test_gzip_loadtxt()
test_gzip_loadtxt_from_string()
test_npzfile_dict()
test_load_refcount()