Skip to content

Commit 0e14926

Browse files
author
Matthew Fisher
committed
test(controller): create log directory
1 parent b2b8cbc commit 0e14926

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

controller/api/tests/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11

22
from __future__ import unicode_literals
33
import logging
4+
import os
45

6+
from django.conf import settings
57
from django.test.client import RequestFactory, Client
68
from django.test.simple import DjangoTestSuiteRunner
79

@@ -37,6 +39,9 @@ def run_tests(self, test_labels, extra_tests=None, **kwargs):
3739
"""Run tests with all but critical log messages disabled."""
3840
# hide any log messages less than critical
3941
logging.disable(logging.CRITICAL)
42+
# also, create the log directory
43+
if not os.path.exists(settings.DEIS_LOG_DIR):
44+
os.makedirs(settings.DEIS_LOG_DIR)
4045
return super(SilentDjangoTestSuiteRunner, self).run_tests(
4146
test_labels, extra_tests, **kwargs)
4247

0 commit comments

Comments
 (0)