aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMuriithi Frederick Muriuki2018-04-13 15:39:47 +0300
committerMuriithi Frederick Muriuki2018-04-13 15:39:47 +0300
commit90da7aa5028d64437f3fcaf903075cbda293b575 (patch)
tree64e369ce493f5791dc59dc9be5575b55b0d5b024 /test
parent55cc4c63478de9587e282522540334e5375aebf1 (diff)
downloadgenenetwork2-90da7aa5028d64437f3fcaf903075cbda293b575.tar.gz
Fix logging in tests
* Use the LOG_LEVEL provided by the application settings to enable easy control of logging when running tests. It helps avoid a lot of verbosity when running tests.
Diffstat (limited to 'test')
-rw-r--r--test/requests/parametrized_test.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/test/requests/parametrized_test.py b/test/requests/parametrized_test.py
index abf98fce..c585e910 100644
--- a/test/requests/parametrized_test.py
+++ b/test/requests/parametrized_test.py
@@ -1,5 +1,6 @@
import logging
import unittest
+from wqflask import app
from elasticsearch import Elasticsearch, TransportError
class ParametrizedTest(unittest.TestCase):
@@ -14,6 +15,7 @@ class ParametrizedTest(unittest.TestCase):
self.es_cleanup = []
es_logger = logging.getLogger("elasticsearch")
+ es_logger.setLevel(app.config.get("LOG_LEVEL"))
es_logger.addHandler(
logging.FileHandler("/tmp/es_TestRegistrationInfo.log"))
es_trace_logger = logging.getLogger("elasticsearch.trace")