diff options
author | Jonathan Helmus <jjhelmus@gmail.com> | 2017-03-30 12:43:35 -0500 |
---|---|---|
committer | Jonathan Helmus <jjhelmus@gmail.com> | 2017-03-30 12:43:35 -0500 |
commit | 0724f58bf999f844930a0b49dba449e0f12e5bd6 (patch) | |
tree | 284d0287fb2e4df34b1b597047750b4847fc406b /numpy/core | |
parent | ee6780faf1308f2e0e8cb056f5a4ad5c89aaf191 (diff) | |
download | numpy-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.py | 2 |
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',) " + |