Mercurial > kallithea
changeset 3872:2b9da8749065 beta
Use unittest2 for testing
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Sun, 19 May 2013 15:42:08 +0200 |
parents | 35bce50df618 |
children | 4b0d283ecede |
files | rhodecode/lib/compat.py rhodecode/tests/__init__.py |
diffstat | 2 files changed, 7 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/rhodecode/lib/compat.py Sun May 19 16:08:21 2013 +0200 +++ b/rhodecode/lib/compat.py Sun May 19 15:42:08 2013 +0200 @@ -32,6 +32,10 @@ #============================================================================== from rhodecode.lib.ext_json import json +if __py_version__ >= (2, 7): + import unittest +else: + import unittest2 as unittest #============================================================================== # izip_longest
--- a/rhodecode/tests/__init__.py Sun May 19 16:08:21 2013 +0200 +++ b/rhodecode/tests/__init__.py Sun May 19 15:42:08 2013 +0200 @@ -25,7 +25,6 @@ import tempfile from os.path import join as jn -from unittest import TestCase from tempfile import _RandomNameSequence from paste.deploy import loadapp @@ -41,6 +40,7 @@ from webtest import TestApp from nose.plugins.skip import SkipTest +from rhodecode.lib.compat import unittest from rhodecode import is_windows from rhodecode.model.meta import Session from rhodecode.model.db import User @@ -157,11 +157,11 @@ pylons.translator._push_object(translator) -class BaseTestCase(TestCase): +class BaseTestCase(unittest.TestCase): def __init__(self, *args, **kwargs): self.wsgiapp = pylons.test.pylonsapp init_stack(self.wsgiapp.config) - TestCase.__init__(self, *args, **kwargs) + unittest.TestCase.__init__(self, *args, **kwargs) class TestController(BaseTestCase):