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:
parent
f3885f84ca
commit
fe27205d8d
|
@ -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
|
||||
|
|
|
@ -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):
|
||||
|
|
|
@ -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(
|
||||
|
|
Loading…
Reference in New Issue