Permalink
Browse files

Merge pull request #2879 from rgommers/issue-413-arm-failures

Fix ARM failures (gh-413)
  • Loading branch information...
2 parents c745862 + 8c05bdb commit cce1c45afa3d821c5ca313f06b2481e55c98a238 @njsmith njsmith committed Jan 3, 2013
@@ -1,25 +0,0 @@
-#!/bin/sh
-
-VIRTENV=$1
-
-set -x
-set -e
-
-curl -O http://www.python.org/ftp/python/2.4.6/Python-2.4.6.tar.bz2
-tar xjf Python-2.4.6.tar.bz2
-cd Python-2.4.6
-cat >setup.cfg <<EOF
-[build_ext]
-library_dirs=/usr/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH)/
-EOF
-./configure --prefix=$PWD/install
-make
-make install
-# This is the last version of virtualenv to support python 2.4:
-curl -O https://raw.github.com/pypa/virtualenv/1.7.2/virtualenv.py
-# And this is the last version of pip to support python 2.4. If
-# there's a file matching "^pip-.*(zip|tar.gz|tar.bz2|tgz|tbz)$" in
-# the current directory then virtualenv will take that as the pip
-# source distribution to install
-curl -O http://pypi.python.org/packages/source/p/pip/pip-1.1.tar.gz
-install/bin/python2.4 ./virtualenv.py --distribute $VIRTENV
View
@@ -2,44 +2,19 @@
# http://lint.travis-ci.org/
language: python
python:
- - 2.5
- 2.6
- 2.7
- 3.2
- 3.3
-env:
- # Hack:
- #
- # We want to test from Python 2.4 to Python 3.2
- # but Travis doesn't support python 2.4, and never will:
- # https://github.com/travis-ci/travis-ci/issues/485
- #
- # So what we do is add TEST_PY24=true to the build matrix, and then for that one
- # version we don't actually use the system python, but instead build 2.4 and
- # use it.
- #
- - TEST_PY24=""
matrix:
include:
- - python: 2.5
- env: TEST_PY24="true"
- python: 2.7
env: NPY_SEPARATE_COMPILATION=1
- python: 3.2
env: NPY_SEPARATE_COMPILATION=1
before_install:
- mkdir builds
- pushd builds
- # This has to be on a single "virtual line" because of how Travis
- # munges each line before executing it to print out the exit status.
- # It's okay for it to be on multiple physical lines, so long as you remember:
- # - There can't be any leading "-"s
- # - All newlines will be removed, so use ";"s
- - if [ "${TEST_PY24}" == "true" ]; then
- deactivate;
- ../.travis-make-py24-virtualenv.sh $PWD/py24-ve;
- source $PWD/py24-ve/bin/activate;
- fi
- pip install nose
# pip install coverage
- python -V
@@ -1,37 +1,30 @@
-# The following exec statement (or something like it) is needed to
-# prevent SyntaxError on Python < 2.5. Even though this is a test,
-# SyntaxErrors are not acceptable; on Debian systems, they block
-# byte-compilation during install and thus cause the package to fail
-# to install.
+import platform
+
+import numpy as np
+from numpy.testing import TestCase, assert_, run_module_suite, dec
-import sys
-if sys.version_info[:2] >= (2, 5):
- exec """
-from __future__ import with_statement
-from numpy.core import *
-from numpy.random import rand, randint
-from numpy.testing import *
class TestErrstate(TestCase):
+ @dec.skipif(platform.machine() == "armv5tel", "See gh-413.")
def test_invalid(self):
- with errstate(all='raise', under='ignore'):
- a = -arange(3)
+ with np.errstate(all='raise', under='ignore'):
+ a = -np.arange(3)
# This should work
- with errstate(invalid='ignore'):
- sqrt(a)
+ with np.errstate(invalid='ignore'):
+ np.sqrt(a)
# While this should fail!
try:
- sqrt(a)
+ np.sqrt(a)
except FloatingPointError:
pass
else:
self.fail("Did not raise an invalid error")
def test_divide(self):
- with errstate(all='raise', under='ignore'):
- a = -arange(3)
+ with np.errstate(all='raise', under='ignore'):
+ a = -np.arange(3)
# This should work
- with errstate(divide='ignore'):
+ with np.errstate(divide='ignore'):
a // 0
# While this should fail!
try:
@@ -44,14 +37,13 @@ def test_divide(self):
def test_errcall(self):
def foo(*args):
print(args)
- olderrcall = geterrcall()
- with errstate(call=foo):
- assert_(geterrcall() is foo, 'call is not foo')
- with errstate(call=None):
- assert_(geterrcall() is None, 'call is not None')
- assert_(geterrcall() is olderrcall, 'call is not olderrcall')
+ olderrcall = np.geterrcall()
+ with np.errstate(call=foo):
+ assert_(np.geterrcall() is foo, 'call is not foo')
+ with np.errstate(call=None):
+ assert_(np.geterrcall() is None, 'call is not None')
+ assert_(np.geterrcall() is olderrcall, 'call is not olderrcall')
-"""
if __name__ == "__main__":
run_module_suite()
@@ -1,7 +1,9 @@
-import warnings
+import platform
+
import numpy as np
from numpy import uint16, float16, float32, float64
-from numpy.testing import TestCase, run_module_suite, assert_, assert_equal
+from numpy.testing import TestCase, run_module_suite, assert_, assert_equal, \
+ dec
def assert_raises_fpe(strmatch, callable, *args, **kwargs):
@@ -357,8 +359,8 @@ def test_half_coercion(self):
assert_equal(np.power(b32,a16).dtype, float16)
assert_equal(np.power(b32,b16).dtype, float32)
+ @dec.skipif(platform.machine() == "armv5tel", "See gh-413.")
def test_half_fpe(self):
- """Test that half raises the correct underflows and overflows"""
oldsettings = np.seterr(all='raise')
try:
sx16 = np.array((1e-4,),dtype=float16)
Oops, something went wrong.

0 comments on commit cce1c45

Please sign in to comment.