From 4530b6e3b85f5ee2de7a21defd94c81e1b5d4227 Mon Sep 17 00:00:00 2001 From: rr- Date: Sat, 30 Apr 2016 12:46:52 +0200 Subject: [PATCH] server/tests: show SQL queries only with -v --- server/szurubooru/tests/conftest.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/server/szurubooru/tests/conftest.py b/server/szurubooru/tests/conftest.py index be4162d..5b4cbfd 100644 --- a/server/szurubooru/tests/conftest.py +++ b/server/szurubooru/tests/conftest.py @@ -51,9 +51,10 @@ def query_counter(): @pytest.fixture def query_logger(): - import logging - logging.basicConfig() - logging.getLogger('sqlalchemy.engine').setLevel(logging.INFO) + if pytest.config.option.verbose > 0: + import logging + logging.basicConfig() + logging.getLogger('sqlalchemy.engine').setLevel(logging.INFO) @pytest.yield_fixture(scope='function', autouse=True) def session(query_logger):