# HG changeset patch # User Thomas De Schampheleire # Date 2015-07-02 12:07:19 # Node ID f9367342412a92c29a6f4bb771d525645d986fc2 # Parent 148360f533a45499fbedea972343916b55cb5474 tests: hide database setup queries with pytest Unlike nosetest, pytest would show the database setup queries at the beginning of the test run, which don't bring added value. Hide them by disabling logging during this time. Note that this does not provide an easy method of enabling the logging on demand (what could be done with the -s switch in nosetest). diff --git a/kallithea/tests/conftest.py b/kallithea/tests/conftest.py --- a/kallithea/tests/conftest.py +++ b/kallithea/tests/conftest.py @@ -1,5 +1,6 @@ import os import sys +import logging import pkg_resources from paste.deploy import loadapp @@ -11,7 +12,11 @@ def pytest_configure(): path = os.getcwd() sys.path.insert(0, path) pkg_resources.working_set.add_entry(path) + + # Disable INFO logging of test database creation, restore with NOTSET + logging.disable(logging.INFO) pylons.test.pylonsapp = loadapp('config:test.ini', relative_to=path) + logging.disable(logging.NOTSET) # Setup the config and app_globals, only works if we can get # to the config object