diff options
Diffstat (limited to 'numpy/core/tests')
-rw-r--r-- | numpy/core/tests/test_arrayprint.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/numpy/core/tests/test_arrayprint.py b/numpy/core/tests/test_arrayprint.py index 7ff2efce9..ffa939633 100644 --- a/numpy/core/tests/test_arrayprint.py +++ b/numpy/core/tests/test_arrayprint.py @@ -280,6 +280,19 @@ class TestPrintOptions(object): assert_equal(repr(np.array(False)), 'array(False, dtype=bool)') + def test_sign_spacing(self): + a = np.arange(4.) + assert_equal(repr(a), 'array([0., 1., 2., 3.])') + assert_equal(repr(np.array(1.)), 'array(1.)') + + np.set_printoptions(sign=' ') + assert_equal(repr(a), 'array([ 0., 1., 2., 3.])') + assert_equal(repr(np.array(1.)), 'array(1.)') + + np.set_printoptions(sign='+') + assert_equal(repr(a), 'array([+0., +1., +2., +3.])') + assert_equal(repr(np.array(1.)), 'array(+1.)') + def test_unicode_object_array(): import sys |