server/tests: show SQL queries only with -v

This commit is contained in:
rr- 2016-04-30 12:46:52 +02:00
parent 29b57b0af0
commit 4530b6e3b8
1 changed files with 4 additions and 3 deletions

View File

@ -51,9 +51,10 @@ def query_counter():
@pytest.fixture @pytest.fixture
def query_logger(): def query_logger():
import logging if pytest.config.option.verbose > 0:
logging.basicConfig() import logging
logging.getLogger('sqlalchemy.engine').setLevel(logging.INFO) logging.basicConfig()
logging.getLogger('sqlalchemy.engine').setLevel(logging.INFO)
@pytest.yield_fixture(scope='function', autouse=True) @pytest.yield_fixture(scope='function', autouse=True)
def session(query_logger): def session(query_logger):