Skip to content

Commit 3591d23

Browse files
committed
add unitest2 as test dependency for python 2.6
1 parent fa504a1 commit 3591d23

3 files changed

Lines changed: 12 additions & 3 deletions

File tree

‎.travis.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ before_install:
1414
- ulimit -a
1515
- pip install -q --use-mirrors numpy
1616
- python -V
17-
17+
- if [[ $TRAVIS_PYTHON_VERSION == '2.6' ]] ; then pip install unittest2; fi
1818
install:
1919
- pip install .
2020

‎blosc/test.py‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
from __future__ import division
22
import sys
3-
import unittest
43
import ctypes
4+
5+
try:
6+
import unittest2 as unittest
7+
except ImportError:
8+
import unittest
9+
510
import blosc
611

712
try:

‎setup.py‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ def exit_with_error(message):
3535
else:
3636
exit_with_error("You need Python 2.6/3.1 or greater to install blosc!")
3737

38+
tests_require = ['numpy']
39+
if sys.version_info[:2] < (2, 7):
40+
tests_require += ['unittest2']
41+
3842
########### End of checks ##########
3943

4044

@@ -139,7 +143,7 @@ def exit_with_error(message):
139143
extra_link_args=LFLAGS,
140144
extra_compile_args=CFLAGS ),
141145
],
142-
tests_require=['numpy'],
146+
tests_require=tests_require,
143147
packages = ['blosc'],
144148

145149
)

0 commit comments

Comments
 (0)