summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2018-11-06 19:53:49 -0600
committerGitHub <noreply@github.com>2018-11-06 19:53:49 -0600
commitc41c0115ddcce9d0ad99349807d2f84e1fff6d85 (patch)
treea81730e7e6f0bcf99b1629fd478ad87a999164b4 /numpy
parente1a8230b2e1d35ec2711d4d2ae4cea97284f131b (diff)
parent9fe2f4fb9cc198a51c8099c669f872293db1b691 (diff)
downloadnumpy-c41c0115ddcce9d0ad99349807d2f84e1fff6d85.tar.gz
Merge pull request #12330 from tylerjereddy/shippable_remove_pathlib
TST: test_tofile_fromfile now uses initialized memory
Diffstat (limited to 'numpy')
-rw-r--r--numpy/core/tests/test_records.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/numpy/core/tests/test_records.py b/numpy/core/tests/test_records.py
index af6c86b9e..08d8865a0 100644
--- a/numpy/core/tests/test_records.py
+++ b/numpy/core/tests/test_records.py
@@ -332,15 +332,14 @@ class TestPathUsage(object):
def test_tofile_fromfile(self):
with temppath(suffix='.bin') as path:
path = Path(path)
- a = np.empty(10, dtype='f8,i4,a5')
+ np.random.seed(123)
+ a = np.random.rand(10).astype('f8,i4,a5')
a[5] = (0.5,10,'abcde')
- a.newbyteorder('<')
with path.open("wb") as fd:
a.tofile(fd)
x = np.core.records.fromfile(path,
formats='f8,i4,a5',
- shape=10,
- byteorder='<')
+ shape=10)
assert_array_equal(x, a)