diff options
author | Eric Wieser <wieser.eric@gmail.com> | 2017-03-25 10:31:40 +0000 |
---|---|---|
committer | Eric Wieser <wieser.eric@gmail.com> | 2017-03-25 10:36:30 +0000 |
commit | 0960eedb783fcdb2710bdcf832a807d9b28b17a3 (patch) | |
tree | 244b7b042ccaf351ba9fe90d9221286f1259d543 /numpy | |
parent | b87fca27261f79be20ab06a222ed2330d60d9f2c (diff) | |
download | numpy-0960eedb783fcdb2710bdcf832a807d9b28b17a3.tar.gz |
MAINT: Remove asbytes_nested where b prefixes would suffice
Diffstat (limited to 'numpy')
-rw-r--r-- | numpy/core/tests/test_defchararray.py | 136 | ||||
-rw-r--r-- | numpy/core/tests/test_regression.py | 4 | ||||
-rw-r--r-- | numpy/lib/tests/test__iotools.py | 29 | ||||
-rw-r--r-- | numpy/lib/tests/test_format.py | 36 | ||||
-rw-r--r-- | numpy/lib/tests/test_twodim_base.py | 3 | ||||
-rw-r--r-- | numpy/linalg/tests/test_build.py | 4 | ||||
-rw-r--r-- | numpy/ma/tests/test_core.py | 6 | ||||
-rw-r--r-- | numpy/ma/tests/test_mrecords.py | 9 |
8 files changed, 111 insertions, 116 deletions
diff --git a/numpy/core/tests/test_defchararray.py b/numpy/core/tests/test_defchararray.py index 3e0eebc91..00fca3b2c 100644 --- a/numpy/core/tests/test_defchararray.py +++ b/numpy/core/tests/test_defchararray.py @@ -4,7 +4,7 @@ import sys import numpy as np from numpy.core.multiarray import _vec_string -from numpy.compat import asbytes, asbytes_nested, sixu +from numpy.compat import sixu from numpy.testing import ( TestCase, run_module_suite, assert_, assert_equal, assert_array_equal ) @@ -18,8 +18,8 @@ class TestBasic(TestCase): ['long ', '0123456789']], dtype='O') B = np.char.array(A) assert_equal(B.dtype.itemsize, 10) - assert_array_equal(B, asbytes_nested([['abc', '2'], - ['long', '0123456789']])) + assert_array_equal(B, [[b'abc', b'2'], + [b'long', b'0123456789']]) def test_from_object_array_unicode(self): A = np.array([['abc', sixu('Sigma \u03a3')], @@ -31,8 +31,8 @@ class TestBasic(TestCase): ['long', '0123456789']]) def test_from_string_array(self): - A = np.array(asbytes_nested([['abc', 'foo'], - ['long ', '0123456789']])) + A = np.array([[b'abc', b'foo'], + [b'long ', b'0123456789']]) assert_equal(A.dtype.type, np.string_) B = np.char.array(A) assert_array_equal(B, A) @@ -315,9 +315,9 @@ class TestMethods(TestCase): [sixu('123 \t 345 \0 '), sixu('UPPER')]]).view(np.chararray) def test_capitalize(self): - tgt = asbytes_nested([[' abc ', ''], - ['12345', 'Mixedcase'], - ['123 \t 345 \0 ', 'Upper']]) + tgt = [[b' abc ', b''], + [b'12345', b'Mixedcase'], + [b'123 \t 345 \0 ', b'Upper']] assert_(issubclass(self.A.capitalize().dtype.type, np.string_)) assert_array_equal(self.A.capitalize(), tgt) @@ -337,8 +337,8 @@ class TestMethods(TestCase): assert_(np.all(C.endswith(b'#'))) C = np.char.center(b'FOO', [[10, 20], [15, 8]]) - tgt = asbytes_nested([[' FOO ', ' FOO '], - [' FOO ', ' FOO ']]) + tgt = [[b' FOO ', b' FOO '], + [b' FOO ', b' FOO ']] assert_(issubclass(C.dtype.type, np.string_)) assert_array_equal(C, tgt) @@ -388,15 +388,15 @@ class TestMethods(TestCase): assert_(np.all(C.endswith(b'#'))) C = np.char.ljust(b'FOO', [[10, 20], [15, 8]]) - tgt = asbytes_nested([['FOO ', 'FOO '], - ['FOO ', 'FOO ']]) + tgt = [[b'FOO ', b'FOO '], + [b'FOO ', b'FOO ']] assert_(issubclass(C.dtype.type, np.string_)) assert_array_equal(C, tgt) def test_lower(self): - tgt = asbytes_nested([[' abc ', ''], - ['12345', 'mixedcase'], - ['123 \t 345 \0 ', 'upper']]) + tgt = [[b' abc ', b''], + [b'12345', b'mixedcase'], + [b'123 \t 345 \0 ', b'upper']] assert_(issubclass(self.A.lower().dtype.type, np.string_)) assert_array_equal(self.A.lower(), tgt) @@ -407,16 +407,16 @@ class TestMethods(TestCase): assert_array_equal(self.B.lower(), tgt) def test_lstrip(self): - tgt = asbytes_nested([['abc ', ''], - ['12345', 'MixedCase'], - ['123 \t 345 \0 ', 'UPPER']]) + tgt = [[b'abc ', b''], + [b'12345', b'MixedCase'], + [b'123 \t 345 \0 ', b'UPPER']] assert_(issubclass(self.A.lstrip().dtype.type, np.string_)) assert_array_equal(self.A.lstrip(), tgt) - tgt = asbytes_nested([[' abc', ''], - ['2345', 'ixedCase'], - ['23 \t 345 \x00', 'UPPER']]) - assert_array_equal(self.A.lstrip(asbytes_nested(['1', 'M'])), tgt) + tgt = [[b' abc', b''], + [b'2345', b'ixedCase'], + [b'23 \t 345 \x00', b'UPPER']] + assert_array_equal(self.A.lstrip([b'1', b'M']), tgt) tgt = [[sixu('\u03a3 '), ''], ['12345', 'MixedCase'], @@ -425,19 +425,19 @@ class TestMethods(TestCase): assert_array_equal(self.B.lstrip(), tgt) def test_partition(self): - P = self.A.partition(asbytes_nested(['3', 'M'])) - tgt = asbytes_nested([[(' abc ', '', ''), ('', '', '')], - [('12', '3', '45'), ('', 'M', 'ixedCase')], - [('12', '3', ' \t 345 \0 '), ('UPPER', '', '')]]) + P = self.A.partition([b'3', b'M']) + tgt = [[(b' abc ', b'', b''), (b'', b'', b'')], + [(b'12', b'3', b'45'), (b'', b'M', b'ixedCase')], + [(b'12', b'3', b' \t 345 \0 '), (b'UPPER', b'', b'')]] assert_(issubclass(P.dtype.type, np.string_)) assert_array_equal(P, tgt) def test_replace(self): - R = self.A.replace(asbytes_nested(['3', 'a']), - asbytes_nested(['##########', '@'])) - tgt = asbytes_nested([[' abc ', ''], - ['12##########45', 'MixedC@se'], - ['12########## \t ##########45 \x00', 'UPPER']]) + R = self.A.replace([b'3', b'a'], + [b'##########', b'@']) + tgt = [[b' abc ', b''], + [b'12##########45', b'MixedC@se'], + [b'12########## \t ##########45 \x00', b'UPPER']] assert_(issubclass(R.dtype.type, np.string_)) assert_array_equal(R, tgt) @@ -462,40 +462,40 @@ class TestMethods(TestCase): [[False, True], [False, False], [False, False]]) C = np.char.rjust(b'FOO', [[10, 20], [15, 8]]) - tgt = asbytes_nested([[' FOO', ' FOO'], - [' FOO', ' FOO']]) + tgt = [[b' FOO', b' FOO'], + [b' FOO', b' FOO']] assert_(issubclass(C.dtype.type, np.string_)) assert_array_equal(C, tgt) def test_rpartition(self): - P = self.A.rpartition(asbytes_nested(['3', 'M'])) - tgt = asbytes_nested([[('', '', ' abc '), ('', '', '')], - [('12', '3', '45'), ('', 'M', 'ixedCase')], - [('123 \t ', '3', '45 \0 '), ('', '', 'UPPER')]]) + P = self.A.rpartition([b'3', b'M']) + tgt = [[(b'', b'', b' abc '), (b'', b'', b'')], + [(b'12', b'3', b'45'), (b'', b'M', b'ixedCase')], + [(b'123 \t ', b'3', b'45 \0 '), (b'', b'', b'UPPER')]] assert_(issubclass(P.dtype.type, np.string_)) assert_array_equal(P, tgt) def test_rsplit(self): A = self.A.rsplit(b'3') - tgt = asbytes_nested([[[' abc '], ['']], - [['12', '45'], ['MixedCase']], - [['12', ' \t ', '45 \x00 '], ['UPPER']]]) + tgt = [[[b' abc '], [b'']], + [[b'12', b'45'], [b'MixedCase']], + [[b'12', b' \t ', b'45 \x00 '], [b'UPPER']]] assert_(issubclass(A.dtype.type, np.object_)) assert_equal(A.tolist(), tgt) def test_rstrip(self): assert_(issubclass(self.A.rstrip().dtype.type, np.string_)) - tgt = asbytes_nested([[' abc', ''], - ['12345', 'MixedCase'], - ['123 \t 345', 'UPPER']]) + tgt = [[b' abc', b''], + [b'12345', b'MixedCase'], + [b'123 \t 345', b'UPPER']] assert_array_equal(self.A.rstrip(), tgt) - tgt = asbytes_nested([[' abc ', ''], - ['1234', 'MixedCase'], - ['123 \t 345 \x00', 'UPP'] - ]) - assert_array_equal(self.A.rstrip(asbytes_nested(['5', 'ER'])), tgt) + tgt = [[b' abc ', b''], + [b'1234', b'MixedCase'], + [b'123 \t 345 \x00', b'UPP'] + ] + assert_array_equal(self.A.rstrip([b'5', b'ER']), tgt) tgt = [[sixu(' \u03a3'), ''], ['12345', 'MixedCase'], @@ -504,16 +504,16 @@ class TestMethods(TestCase): assert_array_equal(self.B.rstrip(), tgt) def test_strip(self): - tgt = asbytes_nested([['abc', ''], - ['12345', 'MixedCase'], - ['123 \t 345', 'UPPER']]) + tgt = [[b'abc', b''], + [b'12345', b'MixedCase'], + [b'123 \t 345', b'UPPER']] assert_(issubclass(self.A.strip().dtype.type, np.string_)) assert_array_equal(self.A.strip(), tgt) - tgt = asbytes_nested([[' abc ', ''], - ['234', 'ixedCas'], - ['23 \t 345 \x00', 'UPP']]) - assert_array_equal(self.A.strip(asbytes_nested(['15', 'EReM'])), tgt) + tgt = [[b' abc ', b''], + [b'234', b'ixedCas'], + [b'23 \t 345 \x00', b'UPP']] + assert_array_equal(self.A.strip([b'15', b'EReM']), tgt) tgt = [[sixu('\u03a3'), ''], ['12345', 'MixedCase'], @@ -523,10 +523,10 @@ class TestMethods(TestCase): def test_split(self): A = self.A.split(b'3') - tgt = asbytes_nested([ - [[' abc '], ['']], - [['12', '45'], ['MixedCase']], - [['12', ' \t ', '45 \x00 '], ['UPPER']]]) + tgt = [ + [[b' abc '], [b'']], + [[b'12', b'45'], [b'MixedCase']], + [[b'12', b' \t ', b'45 \x00 '], [b'UPPER']]] assert_(issubclass(A.dtype.type, np.object_)) assert_equal(A.tolist(), tgt) @@ -537,9 +537,9 @@ class TestMethods(TestCase): assert_(len(A[0]) == 3) def test_swapcase(self): - tgt = asbytes_nested([[' ABC ', ''], - ['12345', 'mIXEDcASE'], - ['123 \t 345 \0 ', 'upper']]) + tgt = [[b' ABC ', b''], + [b'12345', b'mIXEDcASE'], + [b'123 \t 345 \0 ', b'upper']] assert_(issubclass(self.A.swapcase().dtype.type, np.string_)) assert_array_equal(self.A.swapcase(), tgt) @@ -550,9 +550,9 @@ class TestMethods(TestCase): assert_array_equal(self.B.swapcase(), tgt) def test_title(self): - tgt = asbytes_nested([[' Abc ', ''], - ['12345', 'Mixedcase'], - ['123 \t 345 \0 ', 'Upper']]) + tgt = [[b' Abc ', b''], + [b'12345', b'Mixedcase'], + [b'123 \t 345 \0 ', b'Upper']] assert_(issubclass(self.A.title().dtype.type, np.string_)) assert_array_equal(self.A.title(), tgt) @@ -563,9 +563,9 @@ class TestMethods(TestCase): assert_array_equal(self.B.title(), tgt) def test_upper(self): - tgt = asbytes_nested([[' ABC ', ''], - ['12345', 'MIXEDCASE'], - ['123 \t 345 \0 ', 'UPPER']]) + tgt = [[b' ABC ', b''], + [b'12345', b'MIXEDCASE'], + [b'123 \t 345 \0 ', b'UPPER']] assert_(issubclass(self.A.upper().dtype.type, np.string_)) assert_array_equal(self.A.upper(), tgt) diff --git a/numpy/core/tests/test_regression.py b/numpy/core/tests/test_regression.py index d2b568875..def80694a 100644 --- a/numpy/core/tests/test_regression.py +++ b/numpy/core/tests/test_regression.py @@ -18,7 +18,7 @@ from numpy.testing import ( assert_raises, assert_warns, dec, suppress_warnings ) from numpy.testing.utils import _assert_valid_refcount, HAS_REFCOUNT -from numpy.compat import asbytes, asunicode, asbytes_nested, long, sixu +from numpy.compat import asbytes, asunicode, long, sixu rlevel = 1 @@ -1175,7 +1175,7 @@ class TestRegression(TestCase): def test_char_array_creation(self, level=rlevel): a = np.array('123', dtype='c') - b = np.array(asbytes_nested(['1', '2', '3'])) + b = np.array([b'1', b'2', b'3']) assert_equal(a, b) def test_unaligned_unicode_access(self, level=rlevel): diff --git a/numpy/lib/tests/test__iotools.py b/numpy/lib/tests/test__iotools.py index db3ee4f90..6c0b2c6db 100644 --- a/numpy/lib/tests/test__iotools.py +++ b/numpy/lib/tests/test__iotools.py @@ -5,7 +5,6 @@ import time from datetime import date import numpy as np -from numpy.compat import asbytes_nested from numpy.testing import ( run_module_suite, TestCase, assert_, assert_equal, assert_allclose, assert_raises @@ -23,59 +22,59 @@ class TestLineSplitter(TestCase): "Test LineSplitter w/o delimiter" strg = b" 1 2 3 4 5 # test" test = LineSplitter()(strg) - assert_equal(test, asbytes_nested(['1', '2', '3', '4', '5'])) + assert_equal(test, [b'1', b'2', b'3', b'4', b'5']) test = LineSplitter('')(strg) - assert_equal(test, asbytes_nested(['1', '2', '3', '4', '5'])) + assert_equal(test, [b'1', b'2', b'3', b'4', b'5']) def test_space_delimiter(self): "Test space delimiter" strg = b" 1 2 3 4 5 # test" test = LineSplitter(b' ')(strg) - assert_equal(test, asbytes_nested(['1', '2', '3', '4', '', '5'])) + assert_equal(test, [b'1', b'2', b'3', b'4', b'', b'5']) test = LineSplitter(b' ')(strg) - assert_equal(test, asbytes_nested(['1 2 3 4', '5'])) + assert_equal(test, [b'1 2 3 4', b'5']) def test_tab_delimiter(self): "Test tab delimiter" strg = b" 1\t 2\t 3\t 4\t 5 6" test = LineSplitter(b'\t')(strg) - assert_equal(test, asbytes_nested(['1', '2', '3', '4', '5 6'])) + assert_equal(test, [b'1', b'2', b'3', b'4', b'5 6']) strg = b" 1 2\t 3 4\t 5 6" test = LineSplitter(b'\t')(strg) - assert_equal(test, asbytes_nested(['1 2', '3 4', '5 6'])) + assert_equal(test, [b'1 2', b'3 4', b'5 6']) def test_other_delimiter(self): "Test LineSplitter on delimiter" strg = b"1,2,3,4,,5" test = LineSplitter(b',')(strg) - assert_equal(test, asbytes_nested(['1', '2', '3', '4', '', '5'])) + assert_equal(test, [b'1', b'2', b'3', b'4', b'', b'5']) # strg = b" 1,2,3,4,,5 # test" test = LineSplitter(b',')(strg) - assert_equal(test, asbytes_nested(['1', '2', '3', '4', '', '5'])) + assert_equal(test, [b'1', b'2', b'3', b'4', b'', b'5']) def test_constant_fixed_width(self): "Test LineSplitter w/ fixed-width fields" strg = b" 1 2 3 4 5 # test" test = LineSplitter(3)(strg) - assert_equal(test, asbytes_nested(['1', '2', '3', '4', '', '5', ''])) + assert_equal(test, [b'1', b'2', b'3', b'4', b'', b'5', b'']) # strg = b" 1 3 4 5 6# test" test = LineSplitter(20)(strg) - assert_equal(test, asbytes_nested(['1 3 4 5 6'])) + assert_equal(test, [b'1 3 4 5 6']) # strg = b" 1 3 4 5 6# test" test = LineSplitter(30)(strg) - assert_equal(test, asbytes_nested(['1 3 4 5 6'])) + assert_equal(test, [b'1 3 4 5 6']) def test_variable_fixed_width(self): strg = b" 1 3 4 5 6# test" test = LineSplitter((3, 6, 6, 3))(strg) - assert_equal(test, asbytes_nested(['1', '3', '4 5', '6'])) + assert_equal(test, [b'1', b'3', b'4 5', b'6']) # strg = b" 1 3 4 5 6# test" test = LineSplitter((6, 6, 9))(strg) - assert_equal(test, asbytes_nested(['1', '3 4', '5 6'])) + assert_equal(test, [b'1', b'3 4', b'5 6']) # ----------------------------------------------------------------------------- @@ -238,7 +237,7 @@ class TestStringConverter(TestCase): converter = StringConverter(int, default=0, missing_values=b"N/A") assert_equal( - converter.missing_values, set(asbytes_nested(['', 'N/A']))) + converter.missing_values, set([b'', b'N/A'])) def test_int64_dtype(self): "Check that int64 integer types can be specified" diff --git a/numpy/lib/tests/test_format.py b/numpy/lib/tests/test_format.py index 77ac5942a..2dcb260c3 100644 --- a/numpy/lib/tests/test_format.py +++ b/numpy/lib/tests/test_format.py @@ -284,7 +284,7 @@ import warnings from io import BytesIO import numpy as np -from numpy.compat import asbytes_nested, sixu +from numpy.compat import sixu from numpy.testing import ( run_module_suite, assert_, assert_array_equal, assert_raises, raises, dec, SkipTest @@ -682,23 +682,23 @@ def test_write_version(): raise AssertionError("we should have raised a ValueError for the bad version %r" % (version,)) -bad_version_magic = asbytes_nested([ - '\x93NUMPY\x01\x01', - '\x93NUMPY\x00\x00', - '\x93NUMPY\x00\x01', - '\x93NUMPY\x02\x00', - '\x93NUMPY\x02\x02', - '\x93NUMPY\xff\xff', -]) -malformed_magic = asbytes_nested([ - '\x92NUMPY\x01\x00', - '\x00NUMPY\x01\x00', - '\x93numpy\x01\x00', - '\x93MATLB\x01\x00', - '\x93NUMPY\x01', - '\x93NUMPY', - '', -]) +bad_version_magic = [ + b'\x93NUMPY\x01\x01', + b'\x93NUMPY\x00\x00', + b'\x93NUMPY\x00\x01', + b'\x93NUMPY\x02\x00', + b'\x93NUMPY\x02\x02', + b'\x93NUMPY\xff\xff', +] +malformed_magic = [ + b'\x92NUMPY\x01\x00', + b'\x00NUMPY\x01\x00', + b'\x93numpy\x01\x00', + b'\x93MATLB\x01\x00', + b'\x93NUMPY\x01', + b'\x93NUMPY', + b'', +] def test_read_magic(): s1 = BytesIO() diff --git a/numpy/lib/tests/test_twodim_base.py b/numpy/lib/tests/test_twodim_base.py index 98b8aa39c..d57791e34 100644 --- a/numpy/lib/tests/test_twodim_base.py +++ b/numpy/lib/tests/test_twodim_base.py @@ -15,7 +15,6 @@ from numpy import ( ) import numpy as np -from numpy.compat import asbytes_nested def get_mat(n): @@ -91,7 +90,7 @@ class TestEye(TestCase): def test_strings(self): assert_equal(eye(2, 2, dtype='S3'), - asbytes_nested([['1', ''], ['', '1']])) + [[b'1', b''], [b'', b'1']]) def test_bool(self): assert_equal(eye(2, 2, dtype=bool), [[True, False], [False, True]]) diff --git a/numpy/linalg/tests/test_build.py b/numpy/linalg/tests/test_build.py index dfb154190..a91f97670 100644 --- a/numpy/linalg/tests/test_build.py +++ b/numpy/linalg/tests/test_build.py @@ -7,8 +7,6 @@ import re from numpy.linalg import lapack_lite from numpy.testing import TestCase, dec, run_module_suite -from numpy.compat import asbytes_nested - class FindDependenciesLdd(object): @@ -49,7 +47,7 @@ class TestF77Mismatch(TestCase): def test_lapack(self): f = FindDependenciesLdd() deps = f.grep_dependencies(lapack_lite.__file__, - asbytes_nested(['libg2c', 'libgfortran'])) + [b'libg2c', b'libgfortran']) self.assertFalse(len(deps) > 1, """Both g77 and gfortran runtimes linked in lapack_lite ! This is likely to cause random crashes and wrong results. See numpy INSTALL.txt for more diff --git a/numpy/ma/tests/test_core.py b/numpy/ma/tests/test_core.py index d82e352b0..541f8fe65 100644 --- a/numpy/ma/tests/test_core.py +++ b/numpy/ma/tests/test_core.py @@ -1757,7 +1757,7 @@ class TestFillingValues(TestCase): # Tests the behavior of fill_value during conversion # We had a tailored comment to make sure special attributes are # properly dealt with - a = array(asbytes_nested(['3', '4', '5'])) + a = array([b'3', b'4', b'5']) a._optinfo.update({'comment':"updated!"}) b = array(a, dtype=int) @@ -4279,7 +4279,7 @@ class TestMaskedFields(TestCase): assert_equal(base_c.dtype, '|S8') assert_equal(base_c._data, - asbytes_nested(['pi', 'two', 'three', 'four', 'five'])) + [b'pi', b'two', b'three', b'four', b'five']) def test_set_record_slice(self): base = self.data['base'] @@ -4294,7 +4294,7 @@ class TestMaskedFields(TestCase): assert_equal(base_c.dtype, '|S8') assert_equal(base_c._data, - asbytes_nested(['pi', 'pi', 'pi', 'four', 'five'])) + [b'pi', b'pi', b'pi', b'four', b'five']) def test_mask_element(self): "Check record access" diff --git a/numpy/ma/tests/test_mrecords.py b/numpy/ma/tests/test_mrecords.py index 6e830b5b2..785733400 100644 --- a/numpy/ma/tests/test_mrecords.py +++ b/numpy/ma/tests/test_mrecords.py @@ -13,7 +13,6 @@ import pickle import numpy as np import numpy.ma as ma from numpy import recarray -from numpy.compat import asbytes_nested from numpy.ma import masked, nomask from numpy.testing import TestCase, run_module_suite, temppath from numpy.core.records import ( @@ -39,7 +38,7 @@ class TestMRecords(TestCase): # Generic setup ilist = [1, 2, 3, 4, 5] flist = [1.1, 2.2, 3.3, 4.4, 5.5] - slist = asbytes_nested(['one', 'two', 'three', 'four', 'five']) + slist = [b'one', b'two', b'three', b'four', b'five'] ddtype = [('a', int), ('b', float), ('c', '|S8')] mask = [0, 1, 0, 0, 1] self.base = ma.array(list(zip(ilist, flist, slist)), @@ -233,7 +232,7 @@ class TestMRecords(TestCase): assert_equal(mbase.b._data, [5., 5., 3.3, 4.4, 5.5]) assert_equal(mbase.b._mask, [0, 0, 0, 0, 1]) assert_equal(mbase.c._data, - asbytes_nested(['5', '5', 'three', 'four', 'five'])) + [b'5', b'5', b'three', b'four', b'five']) assert_equal(mbase.b._mask, [0, 0, 0, 0, 1]) mbase = base.view(mrecarray).copy() @@ -243,7 +242,7 @@ class TestMRecords(TestCase): assert_equal(mbase.b._data, [1.1, 2.2, 3.3, 4.4, 5.5]) assert_equal(mbase.b._mask, [1, 1, 0, 0, 1]) assert_equal(mbase.c._data, - asbytes_nested(['one', 'two', 'three', 'four', 'five'])) + [b'one', b'two', b'three', b'four', b'five']) assert_equal(mbase.b._mask, [1, 1, 0, 0, 1]) def test_setslices_hardmask(self): @@ -256,7 +255,7 @@ class TestMRecords(TestCase): assert_equal(mbase.a._data, [1, 2, 3, 5, 5]) assert_equal(mbase.b._data, [1.1, 2.2, 3.3, 5, 5.5]) assert_equal(mbase.c._data, - asbytes_nested(['one', 'two', 'three', '5', 'five'])) + [b'one', b'two', b'three', b'5', b'five']) assert_equal(mbase.a._mask, [0, 1, 0, 0, 1]) assert_equal(mbase.b._mask, mbase.a._mask) assert_equal(mbase.b._mask, mbase.c._mask) |