Skip to content

Commit 2191ec3

Browse files
committed
Removed logging through ietf.utils.log.log when running tests -- should shave another 15% off the test suite run time.
- Legacy-Id: 10454
1 parent fdc7dea commit 2191ec3

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

ietf/utils/log.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,9 @@
1010

1111
pass
1212

13-
import sys
1413
import inspect
1514
import os.path
16-
import ietf
15+
1716
from django.conf import settings
1817

1918
def getclass(frame):
@@ -31,6 +30,8 @@ def getcaller():
3130
return (pmodule, pclass, pfunction, pfile, pline)
3231

3332
def log(msg):
33+
if settings.SERVER_MODE == 'test':
34+
return
3435
if isinstance(msg, unicode):
3536
msg = msg.encode('unicode_escape')
3637
try:
@@ -45,4 +46,4 @@ def log(msg):
4546
file, line, where = "/<UNKNOWN>", 0, ""
4647
logger("ietf%s(%d)%s: %s" % (file, line, where, msg))
4748

48-
log("IETFdb v%s started (as %s)" % (ietf.__version__,sys.argv[0]))
49+

ietf/utils/test_runner.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,7 @@ def setup_test_environment(self, **kwargs):
330330
ietf.utils.mail.SMTP_ADDR['port'] = 2025
331331
# switch to a much faster hasher
332332
settings.PASSWORD_HASHERS = ( 'django.contrib.auth.hashers.MD5PasswordHasher', )
333+
settings.SERVER_MODE = 'test'
333334
#
334335
if self.check_coverage:
335336
if self.coverage_file.endswith('.gz'):

0 commit comments

Comments
 (0)