Stop loading unittest(2) during normal operation

On my system with CPython 2.7.3 it saves 1.1 MB of memory and 60 imports
when importing raven.handlers.logging
This commit is contained in:
Jakub Stasiak 2015-02-02 15:01:49 +01:00
parent f3885f84ca
commit fe27205d8d
3 changed files with 5 additions and 7 deletions

View File

@ -46,8 +46,3 @@ except ImportError:
from urllib import parse as _urlparse # NOQA
urlparse = _urlparse
try:
from unittest2 import TestCase
except ImportError:
from unittest import TestCase # NOQA

View File

@ -9,7 +9,10 @@ from __future__ import absolute_import
from exam import Exam
from .compat import TestCase as BaseTestCase
try:
from unittest2 import TestCase as BaseTestCase
except ImportError:
from unittest import TestCase as BaseTestCase # NOQA
class TestCase(Exam, BaseTestCase):

View File

@ -2,7 +2,7 @@ import fnmatch
import os
from subprocess import call
from raven.utils.compat import TestCase
from raven.utils.testutils import BaseTestCase as TestCase
ROOT = os.path.normpath(