Skip to content

Commit

Permalink
fix test so it doesn't fail on 32 bit machines
Browse files Browse the repository at this point in the history
  • Loading branch information
jswhit committed Jun 20, 2021
1 parent c25c53d commit e5eb3fa
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions test/tst_slicing.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from numpy.random import seed, randint
from numpy.testing import assert_array_equal, assert_equal,\
assert_array_almost_equal
import tempfile, unittest, os, random
import tempfile, unittest, os, random, sys
import numpy as np

file_name = tempfile.NamedTemporaryFile(suffix='.nc', delete=False).name
Expand Down Expand Up @@ -35,8 +35,8 @@ def setUp(self):
vu[:,::-1,:] = data

v1[:] = data[:, 0, 0]
#v2[0:2**31] = 1 # issue 1112 (overflow on windows)
v2[2**31] = 1 # issue 1112 (overflow on windows)
if sys.maxsize > 2**32:
v2[2**31] = 1 # issue 1112 (overflow on windows)
f.close()

def tearDown(self):
Expand Down Expand Up @@ -82,8 +82,8 @@ def test_1d(self):
v2 = f.variables['data1dx']
d = data[:,0,0]
assert_equal(v1[:], d)
#assert_equal(v2[:], np.ones(2**31,dtype=np.uint8))
assert_equal(v2[2**31], 1)
if sys.maxsize > 2**32:
assert_equal(v2[2**31], 1)
assert_equal(v1[4:], d[4:])
# test return of array scalar.
assert_equal(v1[0].shape, ())
Expand Down

0 comments on commit e5eb3fa

Please sign in to comment.