Mercurial > kallithea
changeset 5228:f9367342412a
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).
author | Thomas De Schampheleire <thomas.de.schampheleire@gmail.com> |
---|---|
date | Thu, 02 Jul 2015 12:07:19 +0200 |
parents | 148360f533a4 |
children | 616f9d1ab33a |
files | kallithea/tests/conftest.py |
diffstat | 1 files changed, 5 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/kallithea/tests/conftest.py Mon Jul 13 19:37:39 2015 +0200 +++ b/kallithea/tests/conftest.py Thu Jul 02 12:07:19 2015 +0200 @@ -1,5 +1,6 @@ import os import sys +import logging import pkg_resources from paste.deploy import loadapp @@ -11,7 +12,11 @@ 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