~jtaylor/ubuntu/precise/python-numpy/multiarch-fix-818867

« back to all changes in this revision

Viewing changes to numpy/core/tests/test_print.py

  • Committer: Bazaar Package Importer
  • Author(s): Sandro Tosi
  • Date: 2010-10-07 10:19:13 UTC
  • mfrom: (7.1.5 sid)
  • Revision ID: james.westby@ubuntu.com-20101007101913-8b1kmt8ho4upcl9s
Tags: 1:1.4.1-5
* debian/patches/10_use_local_python.org_object.inv_sphinx.diff
  - fixed small typo in description
* debian/patches/changeset_r8364.diff
  - fix memory corruption (double free); thanks to Joseph Barillari for the
    report and to Michael Gilbert for pushing resolution; Closes: #581058

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
        assert_equal(str(tp(1e10)), ref,
27
27
                     err_msg='Failed str formatting for type %s' % tp)
28
28
 
29
 
#@dec.knownfailureif(True, "formatting tests are known to fail")
30
29
def test_float_types():
31
30
    """ Check formatting.
32
31
 
43
42
        assert_equal(str(tp(x)), _REF[x],
44
43
                     err_msg='Failed str formatting for type %s' % tp)
45
44
 
46
 
#@dec.knownfailureif(True, "formatting tests are known to fail")
47
45
def test_nan_inf_float():
48
46
    """ Check formatting of nan & inf.
49
47
 
76
74
        assert_equal(str(tp(1e10)), ref,
77
75
                     err_msg='Failed str formatting for type %s' % tp)
78
76
 
79
 
#@dec.knownfailureif(True, "formatting tests are known to fail")
80
77
def test_complex_types():
81
78
    """Check formatting of complex types.
82
79
 
171
168
            ref = '1e+10'
172
169
        _test_redirected_print(float(1e10), tp, ref)
173
170
 
174
 
#@dec.knownfailureif(True, "formatting tests are known to fail")
175
171
def check_complex_type_print(tp):
176
172
    # We do not create complex with inf/nan directly because the feature is
177
173
    # missing in python < 2.6
197
193
    for t in [np.float32, np.double, np.longdouble] :
198
194
        yield check_float_type_print, t
199
195
 
200
 
#@dec.knownfailureif(True, "formatting tests are known to fail")
201
196
def test_complex_type_print():
202
197
    """Check formatting when using print """
203
198
    for t in [np.complex64, np.cdouble, np.clongdouble] :
225
220
            locale.setlocale(locale.LC_NUMERIC, locale=curloc)
226
221
    return nose.tools.make_decorator(func)(wrapper)
227
222
 
228
 
#@dec.knownfailureif(True, "formatting tests are known to fail")
229
223
@in_foreign_locale
230
224
def test_locale_single():
231
225
    assert_equal(str(np.float32(1.2)), str(float(1.2)))
232
226
 
233
 
#@dec.knownfailureif(True, "formatting tests are known to fail")
234
227
@in_foreign_locale
235
228
def test_locale_double():
236
229
    assert_equal(str(np.double(1.2)), str(float(1.2)))
237
230
 
238
 
#@dec.knownfailureif(True, "formatting tests are known to fail")
239
231
@in_foreign_locale
240
232
def test_locale_longdouble():
241
233
    assert_equal(str(np.longdouble(1.2)), str(float(1.2)))