summaryrefslogtreecommitdiff
path: root/numpy/core
diff options
context:
space:
mode:
authorJonathan Helmus <jjhelmus@gmail.com>2017-03-30 12:43:35 -0500
committerJonathan Helmus <jjhelmus@gmail.com>2017-03-30 12:43:35 -0500
commit0724f58bf999f844930a0b49dba449e0f12e5bd6 (patch)
tree284d0287fb2e4df34b1b597047750b4847fc406b /numpy/core
parentee6780faf1308f2e0e8cb056f5a4ad5c89aaf191 (diff)
downloadnumpy-0724f58bf999f844930a0b49dba449e0f12e5bd6.tar.gz
TST: Use explicit NaT in test_structure_format
Using np.nan to fill a datetime64 array with NaT depends on the undefined behavior of a float64 to int64 cast, which may have different behaviors on non-x64 platforms. See #8325. For this reason np.datetime64('NaT') should be used fill or set datetime64 arrays with NaT.
Diffstat (limited to 'numpy/core')
-rw-r--r--numpy/core/tests/test_arrayprint.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/numpy/core/tests/test_arrayprint.py b/numpy/core/tests/test_arrayprint.py
index 396d7a613..62effc425 100644
--- a/numpy/core/tests/test_arrayprint.py
+++ b/numpy/core/tests/test_arrayprint.py
@@ -141,7 +141,7 @@ class TestArray2String(TestCase):
# for issue #5692
A = np.zeros(shape=10, dtype=[("A", "M8[s]")])
- A[5:].fill(np.nan)
+ A[5:].fill(np.datetime64('NaT'))
assert_equal(np.array2string(A),
"[('1970-01-01T00:00:00',) ('1970-01-01T00:00:00',) " +
"('1970-01-01T00:00:00',)\n ('1970-01-01T00:00:00',) " +