[Cython] Use unittest2 when necessary to support Python 2.6

This commit is contained in:
Ray Speth 2013-07-23 15:30:47 +00:00
parent ab7775e67e
commit 346f9e196f
6 changed files with 14 additions and 6 deletions

View file

@ -1,8 +1,8 @@
import unittest
import numpy as np
import cantera as ct
from . import utilities
from .utilities import unittest
class TestFunc1(utilities.CanteraTest):
def test_function(self):

View file

@ -1,5 +1,5 @@
import numpy as np
import unittest
from .utilities import unittest
import re
import cantera as ct

View file

@ -1,4 +1,4 @@
import unittest
from .utilities import unittest
import numpy as np
import cantera as ct

View file

@ -1,4 +1,4 @@
import unittest
from .utilities import unittest
import numpy as np
import cantera as ct

View file

@ -1,5 +1,13 @@
import numpy as np
import unittest
import sys
if sys.version_info[:2] < (2,7):
# unittest2 is a backport of the new features added to the
# unittest testing framework in Python 2.7. See
# https://pypi.python.org/pypi/unittest2
import unittest2 as unittest
else:
import unittest
class CanteraTest(unittest.TestCase):

View file

@ -15,7 +15,7 @@ if sys.version_info[0] == 3:
else:
sys.path.insert(0, os.sep.join(cantera_root + ['build', 'python2']))
import unittest
from cantera.test.utilities import unittest
import cantera
if __name__ == '__main__':