Removed logging through ietf.utils.log.log when running tests -- should shave another 15% off the test suite run time.

- Legacy-Id: 10454
This commit is contained in:
Henrik Levkowetz 2015-11-08 14:26:41 +00:00
parent fdc7dea3df
commit 2191ec3cbd
2 changed files with 5 additions and 3 deletions

View file

@ -10,10 +10,9 @@ except ImportError: # import syslog will fail on Windows box
pass
import sys
import inspect
import os.path
import ietf
from django.conf import settings
def getclass(frame):
@ -31,6 +30,8 @@ def getcaller():
return (pmodule, pclass, pfunction, pfile, pline)
def log(msg):
if settings.SERVER_MODE == 'test':
return
if isinstance(msg, unicode):
msg = msg.encode('unicode_escape')
try:
@ -45,4 +46,4 @@ def log(msg):
file, line, where = "/<UNKNOWN>", 0, ""
logger("ietf%s(%d)%s: %s" % (file, line, where, msg))
log("IETFdb v%s started (as %s)" % (ietf.__version__,sys.argv[0]))

View file

@ -330,6 +330,7 @@ class IetfTestRunner(DiscoverRunner):
ietf.utils.mail.SMTP_ADDR['port'] = 2025
# switch to a much faster hasher
settings.PASSWORD_HASHERS = ( 'django.contrib.auth.hashers.MD5PasswordHasher', )
settings.SERVER_MODE = 'test'
#
if self.check_coverage:
if self.coverage_file.endswith('.gz'):