Changeset - f9367342412a
[Not reviewed]
default
0 1 0
Thomas De Schampheleire - 10 years ago 2015-07-02 12:07:19
thomas.de.schampheleire@gmail.com
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).
1 file changed with 5 insertions and 0 deletions:
0 comments (0 inline, 0 general)
kallithea/tests/conftest.py
Show inline comments
 
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
0 comments (0 inline, 0 general)